csvkit.org
CSV (Comma-Separated Values) utilities, in the browser
Say hi →

SQL on a CSV

SELECT · WHERE · GROUP BY · JOIN · subqueries · ⌘/Ctrl + Enter to run

Query a CSV the way you'd query a table — no database to spin up, no import step, no upload. Paste the file, write SQL against the table named csv, and get results back as a table you can download as CSV or JSON. Everything runs in your browser, so confidential exports stay on your machine.

sql
Drop a .csv file here, or
result
ready

How to query a CSV with SQL

  1. Paste the CSV or drop a file. The line under the drop zone lists the column names it found.
  2. Write your query against the table csv — the alias t works too, so SELECT * FROM t is valid.
  3. Press Run query or hit /Ctrl + Enter.
  4. Download the result as CSV or JSON. Only the first 200 rows are rendered on screen; the download contains everything.

What SQL is supported

Enough for real analysis: SELECT with expressions, WHERE, GROUP BY with HAVING, ORDER BY, LIMIT/OFFSET, DISTINCT, CASE WHEN, aggregate functions (COUNT, SUM, AVG, MIN, MAX), string and maths functions, subqueries, UNION, and self-joins such as:

SELECT a.customer_id, COUNT(*) AS orders_n, SUM(a.amount) AS amount_sum
FROM csv a
GROUP BY a.customer_id
HAVING COUNT(*) > 1
ORDER BY amount_sum DESC

Column names with spaces or punctuation need square brackets: SELECT [Order Date] FROM csv.

Tips that save time

FAQ

Is my data uploaded to run the query?

No. The SQL engine is JavaScript running in your browser tab. Nothing is sent to a server, which is the point — you can query an export containing customer data without it leaving your laptop.

Can I join two different CSV files?

Not in this tool — it loads one file as csv. For two files use Join on key, which does inner, left, right, and full joins with a UI.

Why does my query fail with a parse error?

Usually a reserved word used as an alias or an unbracketed column name containing a space. The status line shows the engine's own message, including where it stopped parsing.

Do INSERT and UPDATE work?

They run against the in-memory table, but the result is discarded when you re-run or reload — this is a read-only analysis tool in practice. Use SELECT.

Privacy

100% client-side. No upload. See the privacy policy.