SQL to CSV Converter

Pull the rows out of INSERT INTO … VALUES statements and save them as a spreadsheet-ready CSV.

100% Client-Side Processing — your data never leaves this browser. Works offline. How it works

0 lines • 0 bytes Ready
Tip: drop a file anywhere on the editor
Input
Paste, type or drop a file
1
Result
Updates as you type
// Output will appear here…
About this tool

How the SQL to CSV works

Convert SQL INSERT statements from a database dump into CSV. Handles multi-row VALUES, quoted strings, NULL and MySQL or PostgreSQL syntax, in your browser.

How to use the SQL to CSV

  1. Paste INSERT statements or upload a .sql dump.
  2. Optionally type the table to export and choose the delimiter.
  3. Copy the CSV or download it and open it in Excel or Google Sheets.

SQL to CSV example

Input
INSERT INTO orders (id, customer, total) VALUES
  (1, 'Aarav', 250.00),
  (2, 'Sara O''Neil', NULL);
Result
id,customer,total
1,Aarav,250
2,Sara O'Neil,

When to use it

  • Opening data from a database backup without restoring it.
  • Sharing a table with colleagues who work in spreadsheets.
  • Checking the contents of a seed or fixture file.

Tip: Dumps made with --extended-insert pack many rows into each INSERT; they are read just as well as one-row statements.

Reads real dumps

Understands mysqldump and pg_dump style INSERTs: multi-row VALUES, comments, backtick or double-quoted names and escaped quotes.

Column names from CREATE TABLE

When INSERTs leave out the column list, names are taken from the CREATE TABLE statement in the same input.

Pick a table

A dump with several tables? Type the table name to export just that one; otherwise the first table is used.

Spreadsheet-ready

Choose comma, semicolon or tab delimiters; NULL becomes an empty cell.

FAQ

Common questions

Which SQL statements are read?

INSERT INTO … VALUES (and REPLACE INTO). CREATE TABLE is used only for column names. Other statements such as SELECT or UPDATE are skipped, because they contain no row data.

What about functions like NOW()?

Expressions are kept as their SQL text, for example NOW(), because the converter does not run SQL.

Does it work with large dumps?

Yes, within your browser's memory. Everything is processed locally, so nothing is uploaded.

Can I export every table?

CSV holds one table at a time. Use SQL to JSON to get all tables at once, grouped by table name.