Skip to content

SQL to CSV & JSON Converter

Extract rows and columns from SQL INSERT statements (mysqldump, pg_dump, SQLite) into clean CSV or JSON without spinning up a database.

Processed in your browser. Your data is not uploaded, stored or logged — closing the tab discards it. How this works

SQL extraction options Show
SQL & CSV rules
JSON options

Changes apply automatically.

SQL input

Paste a SQL dump containing INSERT INTO statements, choose a .sql file, or load the sample.

You can also drag and drop a file here.

Converted output

The extracted CSV or JSON appears here.

Extracted rows

The parsed rows appear here after conversion.

How to convert SQL INSERT dumps to CSV or JSON

  1. Paste a SQL script or open a .sql dump file containing INSERT INTO … VALUES (…) statements.
  2. If the dump includes multiple tables, select the table you want to extract in Target table.
  3. Choose CSV or JSON array of objects as the output format.
  4. Review the extracted table preview, then copy or download the output file.

What SQL syntax is supported?

FeatureSupported syntax
Column discoveryExplicit INSERT INTO tbl (c1, c2) or preceding CREATE TABLE tbl (...)
Identifier quoting"postgres", `mysql`, [sqlserver], or unquoted
String literalsStandard 'O''Brien', MySQL 'O\'Brien', SQL Server N'text', Postgres E'line1\nline2'
Multi-row insertsVALUES (…), (…), (…); and multiple separate INSERT statements
Special valuesNULL, DEFAULT, TRUE, FALSE, and 64-bit numbers

Limitations

  • PostgreSQL COPY … FROM stdin blocks use tab-separated data rather than INSERT … VALUES; paste the rows inside a COPY block directly into the CSV ⇄ TSV Converter.
  • Complex SQL expressions inside VALUES (such as subqueries) are extracted as raw expression text rather than evaluated.

Frequently asked questions

Does this converter execute my SQL statements?

No. It uses a static SQL tokenizer that reads CREATE TABLE column names and INSERT INTO ... VALUES (...) tuples directly in your browser. Arbitrary SQL commands like DROP TABLE or DELETE are never executed.

What if my INSERT statement does not list column names?

If the dump includes a matching CREATE TABLE statement above the INSERT, the converter reads the column names from CREATE TABLE automatically. Otherwise it generates column_1, column_2, and so on.

Are 64-bit IDs and leading zeros preserved?

Yes. Unquoted SQL numbers (like 9007199254740993) are kept as exact digit strings in CSV and emitted as raw JSON numbers without passing through 64-bit IEEE-754 floating-point rounding. Quoted strings like '00142' keep their leading zeros.

Which SQL dialects are supported?

PostgreSQL ("col", 'O''Brien', E'\n'), MySQL and MariaDB (`col`, backslash escapes like \' and \n), SQLite, and SQL Server ([col], N'Unicode'). Multi-row VALUES lists and multiple INSERT statements are combined automatically.

What happens if a SQL dump file contains multiple tables?

The converter detects every table that has INSERT statements and shows a "Target table" selector in the options panel so you can export each table individually.

Last updated .