A database dump is full of INSERT statements that are useless outside a database server, yet the data inside them is exactly what you need in a spreadsheet. This tool scans the SQL text for INSERT INTO ... VALUES (...) statements, takes the column list of the first one as the header and writes one CSV row per statement, removing the SQL quoting.
Paste the SQL, name the file and download the CSV. The extraction uses a regular expression in your browser, so a dump containing customer records never leaves your machine.
How to use SQL to CSV step by step
Paste the SQL dump or the list of INSERT statements into the text area.
Type the name of the CSV file (sql-export by default).
Click "Convert and download CSV". Values in single quotes are unquoted and doubled quotes ('') are restored to a single quote.
Input and output example
Input
INSERT INTO `users` (`id`, `name`, `city`) VALUES (1, 'Ana', 'Madrid');
INSERT INTO `users` (`id`, `name`, `city`) VALUES (2, 'Luis', 'Sevilla');
Output
id,name,city
1,Ana,Madrid
2,Luis,Sevilla
Why use our SQL to CSV?
100% free and online: no payments, no software or extensions to install.
Privacy-first: processing happens in your browser, your data never leaves your device.
No sign-up: paste your data and get the result in one click.
Fast and reliable: handle small or large files in seconds, ready for Excel and other tools.
Common use cases
Recover the content of a table from a mysqldump or phpMyAdmin export without restoring the database.
Share the rows of a seed file with a colleague who works in Excel.
Compare two versions of a data migration script by converting both to CSV and diffing them.
Load reference data from a SQL script into Google Sheets or a BI tool.
Limits and tips
Each statement must follow the pattern INSERT INTO table (col1, col2) VALUES (v1, v2); with a column list, a single row of values and a terminating semicolon. Multi-row statements such as VALUES (...), (...); are only partially read.
Values are split on commas, so a quoted string that contains a comma will be cut into two cells. Functions like NOW() or nested parentheses also confuse the extraction.
The header comes from the first statement; statements for other tables are appended as rows with the same header.
NULL is written literally as the text NULL, not as an empty cell.
Frequently asked questions
Which SQL dialects are supported?
Any dump whose INSERTs list the columns explicitly and insert one row per statement: MySQL and MariaDB (with or without backticks), PostgreSQL, SQLite and SQL Server in most cases. Bulk inserts with several value groups in one statement or INSERT ... SELECT are not converted.
Why is my CSV empty?
No statement matched the expected pattern. Check that each INSERT has a column list in parentheses, the keyword VALUES, one set of values in parentheses and a semicolon at the end. Dumps created with extended inserts (one INSERT with many rows) must be re-exported with one row per statement.
What is the difference between a SQL dump and a CSV?
A SQL dump is a script of statements that recreates tables and rows inside a database engine; it carries schema and typing but is not readable by spreadsheets. CSV holds only the values in a delimited table that any spreadsheet or scripting language can open, without the schema.
Can I convert several tables at once?
The header is taken from the first INSERT, so mixing tables produces rows with mismatched columns. Paste the statements of one table at a time for a clean result, or filter the dump by table name first.
Is the dump uploaded?
No. The regular expression runs in your browser and the CSV is generated locally. The tool is safe for dumps with personal or confidential data.