Data

SQL on CSV

Drop CSV or JSON files, write SQL, get a result table — joins, aggregates and window functions included. Export CSV, JSON or SQLite.

Add a CSV or JSON file to begin
Tables & query —
or drop files here
Result —
Query results will appear here
Settings Header row · auto delimiter · detect numbers · 500 rows shown
How It Works

How to Use SQL on CSV in 3 Steps

1

Load your data

Drop one or more CSV, TSV or JSON files — each becomes a table named after the file (sales.csv → sales), listed with its columns and detected types. Or paste data to get a table called pasted. Click a table or column name to insert it into the query.

2

Write SQL and run

Any SQLite query works: WHERE, GROUP BY, JOIN across files, WITH CTEs, window functions like ROW_NUMBER() OVER (…), date functions, even CREATE TABLE … AS SELECT. Press Run query or Ctrl/⌘ + Enter.

3

Export the result

Download the result as CSV or JSON, or export every loaded table as one SQLite .db file to open later in DB Browser, DBeaver or Python. Copy puts the result on the clipboard as CSV.

FAQ

SQL on CSV — Frequently Asked Questions

Which SQL dialect is this?

SQLite, running as WebAssembly (sql.js) inside your browser — the same engine inside every phone and browser. Joins, subqueries, CTEs, window functions, GROUP_CONCAT, strftime and JSON functions are all available; LIMIT works, TOP does not. The engine (about 1 MB) downloads once, when you run your first query.

How are column types decided?

Each CSV column that contains only numbers becomes INTEGER or REAL, so SUM, AVG and numeric sorting behave; everything else stays TEXT. Empty cells become NULL in numeric columns and empty strings in text columns. Untick “Detect numbers” to keep everything as text (useful for ZIP / PIN codes with leading zeros). JSON keeps its own numbers and strings.

Can I join two files?

Yes — load both, then SELECT … FROM orders o JOIN customers c ON c.id = o.customer_id. Table names come from the file names (lower-cased, non-letters replaced by underscores); a second file with the same name gets a _2 suffix. Column names with spaces need double quotes: "Order Date".

How big can the files be?

Up to 50 MB per file. Everything lives in your tab’s memory, so a few hundred thousand rows are fine; multi-million-row files will be slow to load. The result table shows up to the number of rows you choose in Settings, while downloads always include every row — add a LIMIT if a query returns more than you need.

What JSON shapes are accepted?

An array of objects ([{"id":1,"name":"Ada"}, …]) — each key becomes a column, and keys missing from some objects are NULL there. An object with a data array is unwrapped. Nested objects and arrays are stored as JSON text, which you can query with SQLite’s json_extract().

Is my data uploaded anywhere?

No. Parsing and converting happen in JavaScript inside your browser tab. Your text and files are never sent to Toolity or anyone else.