Tools

Home
JSON FormatterSQL FormatterJS ValidatorMinify CSS
Merge PDFCompress PDFImage to PDF
JPG to PNGPNG to WebPCrop Image

SQL to CSV Exporter

Paste SQL INSERT statements and instantly extract data into CSV format

Your files never leave your browser
SQL Input0 chars, 0 lines
CSV Output0 chars, 0 lines
Ready·

Paste SQL INSERT statements and get clean CSV rows back — column headers, NULL handling, batch values, all sorted in one click. No regex hacking, no copy-paste acrobatics across 400 lines of a dump file. And everything runs in your browser. Nothing gets uploaded.

How It Works

Paste SQL INSERTs
→
Parse & Extract Rows
→
Download CSV

The parser reads each INSERT statement, grabs column names from the parenthesized list after the table name, then walks through every VALUES group to extract individual fields. It handles single-quoted strings, numeric literals, and NULL keywords. The extracted data gets reassembled into CSV rows with proper quoting and your chosen delimiter.

Examples

Simple User Table Export

Pulling a small users table out of a MySQL dump to review in Google Sheets.

INPUT
INSERT INTO users (name, age, email) VALUES ('Alice', 28, '[email protected]'), ('Bob', 35, '[email protected]');
OUTPUT
name,age,email Alice,28,[email protected] Bob,35,[email protected]

Handling NULLs in Product Data

Some products don't have a description yet — NULL values convert to empty CSV fields.

INPUT
INSERT INTO products (sku, name, description, price) VALUES ('WDG-001', 'Widget', 'Standard widget', 9.99), ('WDG-002', 'Deluxe Widget', NULL, 19.99);
OUTPUT
sku,name,description,price WDG-001,Widget,Standard widget,9.99 WDG-002,Deluxe Widget,,19.99

Multiple INSERT Statements from a Full Dump

Got a .sql file with several INSERT blocks? Paste them all at once. The converter merges everything into one CSV.

INPUT
INSERT INTO orders (id, customer, total) VALUES (1, 'Acme Inc', 250.00); INSERT INTO orders (id, customer, total) VALUES (2, 'Globex', 189.50), (3, 'Initech', 420.75);
OUTPUT
id,customer,total 1,Acme Inc,250.00 2,Globex,189.50 3,Initech,420.75

Who Uses This

🧑‍💻 Backend Developers

Extracting seed data from SQL dumps to share with frontend teams who need CSV.

🗄️ Database Admins

Converting production backup snippets into spreadsheets for audit reviews.

📊 Data Analysts

Turning SQL query results into CSV for quick pivot tables in Excel.

🎓 Students

Checking homework INSERT statements by viewing the actual data in a readable grid.

Common Mistakes

Pasting SELECT output instead of INSERT statements

This parser expects INSERT INTO ... VALUES syntax. If you paste a SELECT result or CREATE TABLE statement, nothing will convert. Copy the actual INSERT lines from your dump file.

Missing the column list in your INSERT

If your SQL says INSERT INTO users VALUES (...) without naming the columns, the tool still works — but headers become generic (col1, col2, col3). Add the column list to your INSERT for real headers.

Forgetting about escaped quotes inside strings

SQL escapes single quotes by doubling them: O''Brien. The converter handles this correctly and outputs O'Brien in CSV. But if your dump uses backslash escaping (\') instead of the standard double-quote style, results may vary.

Technical Details

Frequently Asked Questions

How do I convert SQL query results to CSV?

Paste your INSERT INTO statements in the input box and click Convert. The tool reads the column names and values, then builds a CSV file you can download. If you have SELECT output instead, you'll need to export it as INSERT statements first — most database clients have that option.

Can I convert a full MySQL dump file to CSV?

Yes, but with a catch. The tool only processes INSERT statements — it ignores CREATE TABLE, ALTER, and other DDL commands. So paste the whole dump if you want. It'll skip everything except the INSERT lines and give you the data rows.

What happens to NULL values in the CSV output?

NULL becomes an empty field. If you've turned on "Quote all fields," it shows up as two double quotes with nothing between them. Most spreadsheet apps treat both as blank, which is usually what you want.

Is my SQL data uploaded to a server?

No. The conversion happens entirely in your browser with JavaScript. Nothing gets sent anywhere. You can disconnect from the internet and the tool still works — that's an easy way to verify if you're skeptical.

Does it support PostgreSQL or SQL Server syntax?

The parser works with standard INSERT INTO ... VALUES syntax, which is the same across MySQL, PostgreSQL, SQLite, and SQL Server. Dialect-specific extras like ON CONFLICT or OUTPUT clauses get ignored — the tool only cares about the column names and the values inside the parentheses.

Share: