SQL Dump → CSV
Paste a SQL dump and extract the rows from its INSERT statements as CSV — one section per table. Runs entirely in your browser, no server, no sign-up.
What this tool does
Paste a SQL dump — a .sql file from mysqldump, pg_dump, SQLite .dump, or
any migration/export — and this tool pulls the actual row data out of its
INSERT statements and hands it back as CSV. When the dump touches more than one
table, each gets its own labelled CSV section. Everything runs locally in your
browser: nothing is uploaded, it works offline, and there is no sign-up.
How columns are named
The header row (when enabled) is resolved in this order:
- The INSERT column list —
INSERT INTO users (id, name) VALUES …→id,name. - A matching
CREATE TABLEin the same dump, if the INSERT has no column list. - Generated
col1..colNas a last resort, when neither is available.
Comments (-- …, # …, /* … */) and every non-INSERT statement are used for
context or skipped. Multiple INSERTs into the same table are concatenated in
order.
Options
| Option | What it does |
|---|---|
| Only this table | Export just one table by name (case-insensitive). Leave blank to export them all. Selecting one table also drops the ### TABLE: section marker, giving you clean single-table CSV. |
| Delimiter | comma (CSV, default), tab (TSV), semicolon, or pipe. |
| Header row | On by default — turn it off to emit rows only. |
| Text for SQL NULL | What to write for a NULL cell. Empty by default (an empty field); set it to NULL or \N to make nulls explicit. |
| Quoting | minimal (default) quotes a field only when it contains the delimiter, a ", or a newline; all wraps every field in double quotes. |
| UTF-8 BOM | Prepend a byte-order mark so Excel opens the file as UTF-8. |
Example
Input:
INSERT INTO users (id, name, email) VALUES
(1, 'Alice', '[email protected]'),
(2, 'Bob', NULL);
Output (default settings):
id,name,email
1,Alice,[email protected]
2,Bob,
With multiple tables, each is prefixed with a ### TABLE: <name> line and
separated by a blank line, so you can split the result or copy one section:
### TABLE: authors
id,name
1,Ada
### TABLE: books
id,title,author_id
10,On Computation,1
Limits & edge cases
- Values are extracted verbatim — numbers,
TRUE/FALSE, and hex/blob literals (0x…,X'…') are written as they appear; no type conversion. - String literals honour SQL-standard doubled quotes (
'') and MySQL backslash escapes (\',\n,\t). A PostgreSQL dump that stores a literal backslash before a quote is the one ambiguous case. - Only the
INSERT … VALUES (…)form carries rows.INSERT … SET …andINSERT … SELECT …have no literal tuples and are skipped. - Schema-qualified names (
db.users) are grouped by the final component (users). - Line endings are LF. If a field spans lines it is quoted per RFC 4180.
- Processing is in-memory in your browser; very large dumps (hundreds of MB) may be slow or hit the tab's memory limit.
FAQ
Do I need the CREATE TABLE statements too?
No. If your INSERT statements already list their columns
(INSERT INTO t (a, b) VALUES …), that is enough for the header row. Including
the CREATE TABLE only helps when the INSERTs omit the column list — then the
column names come from the schema instead of generic col1, col2, ….
How are multiple tables returned?
Each table is emitted as its own CSV block, preceded by a ### TABLE: name
marker and separated by a blank line. To get one table on its own with no
marker, put its name in the Only this table box.
How are SQL NULL values handled?
By default a NULL becomes an empty field. If you would rather see it spelled
out — for round-tripping into another database, say — set Text for SQL NULL
to NULL, \N, or whatever your target expects.
Which SQL dialects work?
The row extractor is dialect-agnostic for the common cases: MySQL/MariaDB,
PostgreSQL, SQLite, and SQL Server dumps all use the same INSERT INTO … VALUES
shape. It understands backtick, double-quote, and [bracket] quoted identifiers,
N'…' national strings, and multi-row VALUES lists.
Is my data uploaded anywhere?
No. The parsing happens entirely in your browser via WebAssembly. Your dump never leaves your device, and the page keeps working offline once loaded.
Developer & Automation Access
Run it from the terminal
Same engine as this page, headless — via the gizza CLI:
gizza tool sql-dump-to-csv "INSERT INTO users (id, name) VALUES (1, 'Alice'), (2, 'Bob');"New to the CLI? Get gizza →
Open it by URL
Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:
https://gizza.ai/tools/sql-dump-to-csv/?sql=INSERT%20INTO%20users%20%28id%2C%20name%29%20VALUES%20%281%2C%20%27Alice%27%29%2C%20%282%2C%20%27Bob%27%29%3B&table=users&delimiter=comma&header=true&null_value=%5CN"e=minimal&bom=trueMachine-readable descriptor: tool.json — title + parameters JSON Schema for agents.
