SQL INSERT to CSV
Extract rows from SQL INSERT statements or dumps into CSV or JSON.
About this tool
Paste INSERT statements, or a whole dump from mysqldump, pg_dump --inserts, SQLite .dump or SQL Server, and pick a table if there are several. Choose CSV or JSON and how NULL should appear, then copy or download. CSV downloads include a BOM so Excel shows accented characters correctly.
How the INSERTs are parsed
Each INSERT INTO table (columns) VALUES (โฆ), (โฆ); statement is read tuple by tuple, including multi-row inserts with thousands of rows. Table and column names can use `backticks`, "double quotes" or [brackets], and schema-qualified names such as dbo.notes are supported. String values handle both SQL-standard doubled quotes ('O''Brien') and MySQL backslash escapes (\", \n), and N'โฆ' Unicode strings. NULL, numbers and true/false become real values in JSON, while function calls such as NOW() or CONCAT('a', 'b') are kept as text, because the tool can't evaluate them. If an INSERT has no column list, columns are named column1, column2 and so on. CSV output quotes any value containing commas, quotes or line breaks. Honest limits: CREATE TABLE, UPDATE and other statements are ignored, and very large dumps can be slow in a browser tab. For gigabyte-sized dumps, a command-line tool or importing into a database is better. CSV to SQL, the SQL formatter and CSV to JSON are related, and CSV vs Excel: what each file really contains, and what breaks in between explains CSV.
Frequently asked questions
How do I convert SQL INSERT statements to CSV?
Paste them here, pick the table and copy or download the CSV.
Does it work with mysqldump files?
Yes, including multi-row INSERTs, backtick identifiers and backslash escapes.
What happens to NULL values?
Choose empty cells, the word NULL, or \N (as used by MySQL LOAD DATA).
Is my data uploaded?
No. Everything runs in your browser and nothing is stored or sent.