Run SQL on a CSV file
Real SQL, on your file, without installing a database.
- Real SQL, not a filter box
- GROUP BY, JOIN, window functions
- No database to install
- Nothing uploaded
CSV or TSV. Drag it here, or choose a file.
Why it exists
The usual advice for querying a CSV is to load it into a database first, which is three steps of setup before the first question gets asked. This runs a SQL engine, DuckDB compiled to WebAssembly, inside the browser tab, so the file becomes a queryable table the moment you drop it in.
What it does
- Registers your file as a table named `csv` and lets you query it.
- Full DuckDB SQL: WHERE, GROUP BY, HAVING, ORDER BY, JOIN, CTEs, window functions.
- Column names and types are inferred and listed for you before you type.
- Errors come back from the engine verbatim, so a typo says what it is.
Why DuckDB
It is an analytical database that runs in a single process, and it compiles to WebAssembly, which means the same engine that would query the file on a server can query it in a tab instead. Your file is registered by reference and read as the query needs it.
Questions
- What SQL dialect is this?
- DuckDB's, which is close to PostgreSQL. Aggregates, joins, CTEs and window functions all work. Anything that writes to disk does not, because there is no disk.
- What is my table called?
- `csv`. So `SELECT * FROM csv LIMIT 10` is always a valid first query. Column names come from your header row and are shown above the editor.
- Is the file sent to a server to be queried?
- No. The database engine is downloaded to your browser and the query runs there. The file is read from your disk and never leaves it.
The longer answer
This page does the job. The guide explains it — including the parts a tool cannot decide for you.
How to run SQL queries on a CSV file without a database (2026 guide)You do not need Postgres to run a GROUP BY. Here is how to query a CSV in place with DuckDB, SQLite, q or your phone, and which one fits which situation.The other tools
- Open a CSV file onlineDrop a file in. It opens in your browser, and it stays there.Open it
- Merge CSV files into oneSeveral files in, one file out, columns matched by name.Open it
- Remove duplicate rows from a CSVDuplicates on the columns you say identify a row.Open it
- Compare two CSV filesAdded, removed, changed, matched on a key rather than line by line.Open it
- Convert a CSV to PDFA CSV, laid out as a readable table, saved as a PDF.Open it
- Convert a CSV to ExcelA real .xlsx, with nothing in it changed on the way.Open it
- Convert a CSV to JSONEvery row an object, every header a key.Open it
- Convert JSON to CSVA tree, flattened into a table you can open anywhere.Open it
- Convert Excel to CSVEvery sheet of a workbook, out as clean UTF-8 CSV.Open it
- Split a CSV fileOne file too big to use, as several that are not.Open it
- Clean up a messy CSVGermany, germany and “Germany ” become one value again.Open it
- Convert a CSV to SQL INSERT statementsA CSV in, a .sql script any database will run.Open it
- Format and validate JSONValid JSON, pretty. Broken JSON, located and mostly fixed.Open it
- View JSON as a tree or a graphThe shape of a JSON document, before you read a line of it.Open it
- Turn a Markdown outline into a mind mapType a list. See a map.Open it
- Make a printable 30-day challenge trackerThirty boxes per habit, on paper, where you will see them.Open it
- Reverse a videoPlay it backwards, sound and all, without uploading it.Open it