CSV SQL Query
Drop in a CSV, load it into a temporary SQLite table, and explore it with familiar SQL — right in this browser tab.
Load a CSV
Choose a file or drop one here. The first row becomes column names.
CSV preview
Write SQL
No table loadedSchema
—Load a CSV to see its columns.
Run a query to see results here.
A small, private SQL workbench
CSV SQL Query turns a flat file into a temporary SQLite table named csv_data. It is useful for quick checks, filtering, grouping and sorting without uploading data to a service.
- Quoted fields, multiline values and common delimiters are parsed locally.
- Results include headers, row counts and a one-click CSV download.
- Queries are intentionally limited to
SELECTand read-onlyPRAGMA.
How the conversion runs
Loading a file runs a hand-written CSV parser rather than a library: it strips a byte-order mark, tracks quoted fields, turns doubled quotes into a literal quote and keeps newlines that appear inside quotes. The delimiter is guessed from the first non-empty line, so commas, semicolons, tabs and pipes all work. Column names come from the first row, duplicates get numeric suffixes, and the data is inserted into a temporary SQLite table called csv_data inside sql.js — SQLite compiled to WebAssembly, fetched together with its .wasm binary only when you press the load button. Queries are guarded before execution: a statement must start with SELECT or PRAGMA, may not contain an internal semicolon and cannot be a PRAGMA that assigns a value. You get a schema list, a results table with a row count and a one-click CSV export of the result set.
Edge cases and hard limits
The engine needs a header row plus at least one data row, and only one statement may run at a time, so multi-statement scripts are rejected with a status message. INSERT, UPDATE, DELETE, CREATE and attaching another database are all blocked by that guard, which is deliberate: this is a read-only workbench. Column types are inferred by SQLite from the values it receives, so a column of numbers that starts with text can stay textual. There is no file-size ceiling in the code, but the entire CSV is held in memory and copied into the WebAssembly database, so a very large file will exhaust a browser tab long before any limit is reached; the preview panel only shows the first six rows, while queries see everything.
Privacy: processed in your browser
Your CSV is read with the File API and loaded into a database that exists only inside this tab, so the rows never travel anywhere. The single outbound request is the pinned sql.js script and its WebAssembly binary from a public CDN, fetched after you click load.
Frequently asked questions
Where is my data stored while I query it?
In memory, in a temporary SQLite database created by the WebAssembly build of SQLite running in this tab. Nothing is written to disk, and clearing the page or pressing the clear button discards the database and the imported rows.
Can I update or delete rows?
No. Only a single SELECT or read-only PRAGMA statement is accepted, so INSERT, UPDATE, DELETE and CREATE are refused with an explanatory message. Use the query box to filter, sort and aggregate, then export the result as CSV.
What if my file uses semicolons or tabs instead of commas?
That is detected automatically from the first non-empty line, along with pipe-separated files. Quoted fields, quotes escaped by doubling them, embedded newlines and UTF-8 byte-order marks are all handled by the parser.