SQL to CSV
Get table data out of a SQL dump without restoring it into a database. Paste the dump and the converter reads every INSERT … VALUES statement, takes column names from column lists or CREATE TABLE statements, and writes the rows of the table you choose as CSV, with your choice of delimiter and NULL representation, formula-injection protection and an Excel byte-order mark.
- Runs in your browser
- No sign-up
- Free to use
How to use SQL to CSV
- Paste a SQL dump or open a .sql file.
- Choose the table to export.
- Pick the delimiter and how NULL is written.
- Copy or download the CSV.
SQL to CSV features
Dump-aware parsing
Multi-row INSERTs, quoted names, escapes and comments.
Real column names
From INSERT column lists or CREATE TABLE statements.
Any table
Lists every table with its row count.
NULL options
Empty cell, NULL or \N as MySQL’s import expects.
Spreadsheet safe
Formula-injection protection and optional BOM.
No database needed
Parsed in your browser; nothing is executed.
When to use SQL to CSV
- Opening data from a database backup in Excel.
- Extracting one table from a large mysqldump file.
- Reviewing seed data stored as SQL in a repository.
- Moving rows into a system that imports CSV.
SQL to CSV FAQ
Which dumps are supported?
Any SQL with INSERT … VALUES statements: mysqldump, MariaDB, pg_dump with --inserts or --column-inserts, SQLite .dump and hand-written scripts.
Where do the column names come from?
From the INSERT column list if present, otherwise from the CREATE TABLE statement for the table. Without either, columns are named column1, column2 and so on.
What happens to expressions like NOW()?
Their result is only known to the database, so they are kept as text and counted in a note.
Does it support pg_dump COPY blocks?
No. Export with --inserts, or use COPY … TO in PostgreSQL to write CSV directly.
Is anything executed?
No. The SQL is only parsed; no database is involved.
Is my dump uploaded?
No. Everything happens in your browser.
Reading rows from SQL dumps
A SQL dump is a backup written as SQL: CREATE TABLE statements describe the tables and INSERT statements recreate the rows. To look at the data, the usual route is to restore the dump into a database and export from there. When you only need the rows of a table, parsing the INSERT statements directly is much faster and needs no database at all.
The parser is the same one used by the SQL to JSON tool. It reads string literals with both doubled quotes and MySQL backslash escapes, quoted identifiers in backticks, brackets and double quotes, comments, and multi-row INSERT statements with thousands of tuples. Column names come from the INSERT column list or, when the dump omits it, from the CREATE TABLE statement for that table.
Each table found is listed with its row count, and the selected table is written as CSV. NULL has no standard CSV form, so you choose: an empty cell suits spreadsheets, the word NULL makes it explicit, and \N matches what MySQL’s LOAD DATA expects when the file is imported again.
Spreadsheet safety is built in. Values beginning with =, +, - or @ could be run as formulas when the CSV is opened, so they are prefixed with an apostrophe while protection is on, and a byte-order mark can be added so Excel reads UTF-8 correctly.
Values that are SQL expressions, such as NOW() or CONCAT(…), cannot be evaluated without a database; they are kept as their SQL text and counted in a note. Nothing in the dump is ever executed.