SQL on CSV — Query CSV, JSON & Parquet Files with SQL
Run SQL queries on CSV, TSV, JSON and Parquet files directly in your browser with DuckDB-wasm. Join files, aggregate, filter and export results as CSV.
🔒 Runs entirely in your browser — nothing is uploadedQuery spreadsheets and data files with real SQL
Spreadsheet formulas are great for small edits, but they get painful when you need to filter
thousands of rows, group by several columns or combine two exports that share an ID. SQL on
CSV lets you treat ordinary data files as database tables. Drop a CSV, TSV, JSON or Parquet
file and it immediately becomes a SQL view named after the file, so sales_2024.csv can be
queried as SELECT * FROM sales_2024. Add more files and you can join them, union them or
compare them without importing anything into a database server.
The engine behind the tool is DuckDB, an analytical database designed for fast queries over
columnar data. Its SQL dialect is close to PostgreSQL and supports joins, GROUP BY,
window functions, common table expressions, SUMMARIZE for instant column statistics,
and a large library of string, date and math functions. Column names and types are detected
automatically, and the schema panel shows exactly what DuckDB inferred for every file.
Private by design: everything runs in your browser
Many online SQL playgrounds ask you to upload your data first. This page does not. DuckDB is compiled to WebAssembly and runs inside your browser, so the files you add are read into your browser memory and queried locally. Nothing is sent to a server, which makes the tool suitable for customer exports, financial reports, logs and other data you should not hand to a third party. The first visit downloads the engine (about 35 MB) from a CDN; after that your browser can cache it.
Tips for faster, more accurate queries
Start with the example buttons: Preview rows shows a sample, Column stats runs
SUMMARIZE to reveal minimums, maximums, null percentages and distinct counts, and the
join template gives you a starting point for combining two files. Quote column names that contain
spaces or capital letters with double quotes, for example "Order Date". If a CSV column
is detected with the wrong type, cast it explicitly with CAST(col AS DOUBLE) or
TRY_CAST. The results grid shows up to 1,000 rows, while Export result as CSV
saves every row the query returned. Because files are held in memory, very large datasets depend
on the RAM available to your browser; Parquet files are usually the most compact option.
How to use
- Add your filesDrop one or more CSV, TSV, JSON or Parquet files. Each one becomes a SQL view named after the file.
- Check the schemaReview the detected column names, types and row counts shown for every loaded file.
- Write and run SQLPick an example query or write your own, then click Run query or press Ctrl/Cmd + Enter.
- Export the resultDownload the full query result as a CSV file.