Open one or more CSV, Excel, JSON or Parquet files and query them with real SQL: filter, group, join files together, use window functions, then export the result. Everything runs in your browser with DuckDB-WASM, so your data never leaves your computer.
Last updated:
Engine: not loaded
Ctrl + Enter to run
Advertisement
Advertisement
How to use the Query CSV with SQL
Add your files with Add files or by dropping them on the page. Each file becomes a table named after the file; Excel workbooks create one table per sheet.
Check the schema in the sidebar: table names, columns and detected types. Click a table to preview it.
Write your SQL in the editor or start from an example, e.g. SELECT country, COUNT(*) FROM customers GROUP BY country.
Run the query with the Run query button or Ctrl+Enter (Cmd+Enter on Mac). The first run loads the SQL engine once (a few MB).
Export the result as CSV, JSON or Excel, or copy it to paste into another tool.
Supported files and how they become tables
File
Read with
Notes
.csv, .tsv, .txt
read_csv_auto
Delimiter, quoting, header and column types are detected automatically.
.xlsx, .xlsm
Built-in reader, then read_csv_auto
One table per sheet; the first row is used as column names.
.json, .ndjson, .jsonl
read_json_auto
An array of objects or one object per line; nested objects become STRUCT columns.
.parquet
read_parquet
Columnar and typed, so it loads fastest and keeps exact types.
Handy DuckDB SQL for CSV files
Task
SQL
Profile every column (min, max, nulls, distinct)
SUMMARIZE sales;
All columns except some
SELECT * EXCLUDE (notes, internal_id) FROM sales;
Group by every non-aggregated column
SELECT region, product, SUM(amount) FROM sales GROUP BY ALL;
Top row per group
SELECT * FROM sales QUALIFY ROW_NUMBER() OVER (PARTITION BY region ORDER BY amount DESC) = 1;
Parse European dates
SELECT strptime(day, '%d/%m/%Y')::DATE AS day FROM sales;
Month from a date
SELECT date_trunc('month', order_date) AS month, COUNT(*) FROM orders GROUP BY 1;
Pivot rows into columns
PIVOT sales ON region USING SUM(amount) GROUP BY product;
Stack two files with the same columns
SELECT * FROM jan UNION ALL BY NAME SELECT * FROM feb;
Text search (case-insensitive)
SELECT * FROM customers WHERE name ILIKE '%smith%';
Tips
Quote odd column names with double quotes: SELECT "Order Date", "Unit Price ($)" FROM sales. String values use single quotes.
Create helper tables with CREATE TABLE big_orders AS SELECT …; they appear in the sidebar and can be queried like files.
Multiple statements separated by semicolons run in order; the result of the last one is shown.
To explore an existing database file instead of flat files, use the SQLite Viewer. To tidy up a long query, try the SQL Formatter.
Frequently asked questions
Can I really run SQL on a CSV file without a database?
Yes. DuckDB-WASM is a complete analytical database compiled to WebAssembly that runs inside your browser tab. Each file you add is loaded into an in-memory table, so you can use standard SQL with no installation, server or account.
Are my files uploaded anywhere?
No. Files are read locally by your browser and processed by DuckDB inside the page. Only the SQL engine itself is downloaded from a public CDN the first time you run a query; your data is never sent.
How are table names chosen?
The file name is lower-cased and anything that isn't a letter, digit or underscore becomes an underscore: Sales Report 2025.csv becomes sales_report_2025. Excel files get one table per sheet, such as budget_q1. Names are shown in the sidebar and you can quote them with double quotes.
How do I join two CSV files?
Add both files, then use a normal join on the shared column: SELECT * FROM orders o JOIN customers c ON o.customer_id = c.customer_id. With identical column names you can also write JOIN customers USING (customer_id).
Which SQL dialect is used?
DuckDB's SQL, which is close to PostgreSQL. Besides standard SQL it supports handy extras such as SELECT * EXCLUDE (col), GROUP BY ALL, QUALIFY for filtering window functions, PIVOT, and functions like strftime, regexp_matches and list_aggregate.
How large can my files be?
It depends on your device's memory. Files of a few hundred MB usually work in desktop browsers, and Parquet is much more compact than CSV. Results are shown up to 1,000 rows on screen, while exports include every row.
Why are some columns detected as text?
DuckDB samples the file to guess each column's type. Mixed values such as numbers with units or inconsistent date formats are kept as VARCHAR. Convert them in the query, for example CAST(price AS DOUBLE) or strptime(day, '%d/%m/%Y').
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.