DT Data Tools

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 uploaded

Drop CSV, TSV, JSON or Parquet files here or click to browse

Add several files to join them. Each file becomes a SQL view named after the file.

Ctrl/Cmd + Enter runs the query

Load a file or run the demo query. The DuckDB SQL engine (about 35 MB) downloads from this site on first use, then runs offline in your browser.

Advertisement

Query 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

  1. Add your filesDrop one or more CSV, TSV, JSON or Parquet files. Each one becomes a SQL view named after the file.
  2. Check the schemaReview the detected column names, types and row counts shown for every loaded file.
  3. Write and run SQLPick an example query or write your own, then click Run query or press Ctrl/Cmd + Enter.
  4. Export the resultDownload the full query result as a CSV file.

Frequently asked questions

Are my files uploaded to a server?
No. Files are read into memory in your browser and queried by DuckDB compiled to WebAssembly. The engine itself is downloaded from a CDN, and your data never leaves your device.
Which file formats can I query?
CSV, TSV and plain text tables, JSON arrays or newline-delimited JSON (NDJSON/JSON Lines), and Apache Parquet. Column names and types are detected automatically.
What SQL dialect is supported?
DuckDB SQL, which is close to PostgreSQL. You can use joins, GROUP BY, window functions, CTEs, SUMMARIZE, string and date functions, and more.
How many rows can I see?
The results table shows the first 1,000 rows to keep the page responsive. The CSV export contains every row returned by the query.
How large can my files be?
Files are loaded fully into browser memory, so practical limits depend on your device. Files of tens to a few hundred megabytes usually work well on a desktop browser.
Advertisement