SQL on a CSV
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.
How to query a CSV with SQL
- Paste the CSV or drop a file. The line under the drop zone lists the column names it found.
- Write your query against the table
csv— the aliastworks too, soSELECT * FROM tis valid. - Press Run query or hit ⌘/Ctrl + Enter.
- 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
- Leave "detect numbers" on so
WHERE qty > 5compares numbers instead of text. Turn it off when IDs like007must keep their leading zeros. - Avoid reserved words as aliases.
AS totalfails;AS amount_totalworks. Same forcount,value, andkey. - Sort by position with
ORDER BY 1 DESCwhen you don't want to type the column name. - Big files — everything is in memory, so a few hundred thousand rows is a realistic ceiling. Above that, split the file or use Group & aggregate, which is lighter.
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.