Files never leave your device

Converter

SQL to CSV Converter

Convert a SQL dump to CSV: turn its INSERT statements into a CSV that opens in a spreadsheet. It reads dumps from MySQL, PostgreSQL, SQLite and SQL Server, and it runs in your browser.

Loading the tool…

.sql · .txt

How to use it

  1. Add your SQLPaste the INSERT statements, or open a .sql file. Several tables in one file are fine.
  2. Check the previewPick a table and rename its columns if you like. Choose how NULL is written and which separator the CSV uses.
  3. DownloadSave the table as a CSV file, copy it, or save all tables as a .zip.
The SQL to CSV tool with INSERT statements pasted in: one table of four rows was found and is shown as a preview, with the CSV options on the right.
The tool with sample data loaded. The names and numbers are made up.

Good to know

Values are written exactly as the SQL has them: 007 stays 007, a 20-digit id keeps all its digits and 12.50 stays 12.50. An expression such as NOW() or DEFAULT is written as its text, not worked out. A CSV file has no types, so numbers, dates and text are all plain text in it. Only INSERT ... VALUES statements give rows, so check the result against your data before you rely on it.

Worked example: two INSERT statements, one table

We pasted this SQL, with a NULL, an apostrophe inside a name, a comma inside a name and an empty string:

INSERT INTO customers (id, name, city, balance, note) VALUES
(1, 'Anna Müller', 'Berlin', 120.50, NULL),
(2, 'O''Neil, Pat', 'Dublin', 0, 'pays monthly'),
(3, 'Li Wei', 'Shanghai', 1999.99, 'line one\nline two');
INSERT INTO customers (id, name, city, balance, note) VALUES (4, 'Zoë Ek', 'Oslo', 15, '');

The tool found 1 table, 4 rows and 0 issues, and wrote customers.csv with the column names as the first row:

id,name,city,balance,note
1,Anna Müller,Berlin,120.50,
2,"O'Neil, Pat",Dublin,0,pays monthly
3,Li Wei,Shanghai,1999.99,line one\nline two
4,Zoë Ek,Oslo,15,

How we tested this

On 15 November 2026 we ran this page in headless Chromium on a Linux cloud server, driving it the way a person would (adding files, choosing options, saving the download) and checking the files it produced.

What we checkedResult
The example above: 1 table, 4 rows and 0 issues, a customers.csv identical to the file shown, the backslash and accent notes, the MySQL choice turning \n into a real line break, NULL written as text, the UTF-8 BOM, comma, semicolon, tab and pipe separators, and no header row12 of 12
NOW() and DEFAULT written as their text, UPDATE and DELETE giving no rows, INSERT ... SELECT reported and skipped, column names taken from CREATE TABLE and column_1 when they do not fit, a COPY block skipped with a message7 of 7
Two tables listed and saved as a .zip holding both files, a 1,000-row INSERT (preview showed 200 rows, download held all 1,000), a 20-digit id kept whole, a Windows path kept as written, no page errors and no requests to other sites8 of 8
260 generated scripts with random text (quotes, commas, semicolons, backslashes, line breaks, tabs, emoji, Japanese, Cyrillic, accents, empty strings, NULL and numbers), converted and compared cell by cell with the expected values: 100 dumped by SQLite itself, 60 in the mysqldump layout, 40 in the SQL Server script layout ([dbo] names, N'' text, GO lines) and 60 in the pg_dump --inserts layout260 of 260
Total287 of 287

How long a big file took to open on the same server (a script in the mysqldump style: backtick names, 500 rows per INSERT):

Rows in the fileTime until the preview was ready
10,0000.1 seconds
25,0000.2 seconds
50,0000.3 seconds
100,0000.5 seconds
200,000 (12 MB)0.7 seconds

The same 50,000 rows written with plain names took 0.3 seconds, and written one row per INSERT with backtick names 0.5 seconds. Files much bigger than 12 MB were not tested.

Not tested: MySQL, PostgreSQL and SQL Server themselves. Only the SQLite scripts came from a real database; the MySQL, SQL Server and PostgreSQL scripts were written by our test code to follow each program's documented output. Also not tested: other browsers, phones, scripts in other character sets, and scripts over 200,000 rows.

Frequently asked questions

What SQL does it read?

INSERT ... VALUES statements, including multi-row INSERTs, INSERT IGNORE, REPLACE INTO, and the INSERT [dbo].[Table] form that SQL Server scripts use. Other statements such as UPDATE and DELETE are not turned into rows. CREATE TABLE is read only for its column names. An INSERT ... SELECT has no values to read, so it is reported and skipped.

Is my data uploaded?

No. The SQL is read in your browser. Your SQL and the CSV are not saved; only your option choices are remembered.

Where do the column names come from?

From the column list of the INSERT, when it has one. If not, from the CREATE TABLE in the same script, when the number of columns matches. Failing both they are called column_1, column_2 and so on, and you can rename them in the preview before you download.

What does the Backslashes in text option do?

MySQL and MariaDB read a backslash in text as an escape, so \n is a line break and \' is a quote. PostgreSQL, SQLite and SQL Server keep a backslash as it is. By default the tool looks at the script, decides, and tells you what it chose. If a path such as C:\temp looks wrong, or a line break shows as \n, change the option.

Can it read a pg_dump file?

Only a dump made with INSERT statements (pg_dump --inserts or --column-inserts). The default pg_dump format stores rows in COPY blocks, which this tool skips and tells you about.

Can I convert a big file?

Yes. Open it as a file. The whole script is read in your browser's memory, the preview shows the first 200 rows of a table, and Download gives every row. In our test a script of 200,000 rows (12 MB) opened in under a second. Much bigger files were not tested, so for a very large dump, split the SQL file into smaller parts first.

How is NULL written?

As a blank cell, or as the text NULL if you choose that. By default an empty text value and NULL both look blank, so choose the text NULL option when you need to tell them apart.

Why does Excel show 7 instead of 007?

The CSV holds 007 exactly as the SQL had it. Excel turns it into a number when you open a CSV by double-clicking it. To keep it, use Data > From Text/CSV in Excel and set that column to Text before you load it.

Can I go the other way?

Yes. The CSV to SQL tool turns a CSV into INSERT statements for MySQL, PostgreSQL, SQLite or SQL Server.

Where to go next

When people use it