Skip to content

SQL to CSV Converter

Extract data from SQL INSERT statements and convert it into CSV. Paste one or many INSERT INTO ... VALUES statements and get a clean, spreadsheet-ready CSV table.

Category: data
Use Case: Database Export, Data Migration, SQL Dump Review
Privacy: 100% browser-based

Conversion Options

Recommended Settings

Pro Tips

  • Works with a single INSERT statement with many VALUES tuples, or multiple separate INSERT statements for the same table
  • Escaped single quotes ('') inside string values are automatically unescaped
  • NULL, TRUE, and FALSE keywords are recognized and converted to empty, true, and false in the output
  • If an INSERT statement doesn't list column names, generic column1, column2... headers are generated
  • Values containing commas, quotes, or parentheses are handled correctly, even inside quoted strings

Most Popular

Most users paste a batch of INSERT statements with explicit column names and keep the header row enabled

When to Use This Tool

Database Export & Migration

Extract data from a SQL dump or seed file's INSERT statements into CSV for import into a different database, spreadsheet, or data pipeline.

Reviewing SQL Dumps

Quickly inspect the actual data inside a large .sql backup or seed file by converting its INSERT statements into a readable CSV table.

Test Data & Fixtures

Convert INSERT statements used for database seeding or test fixtures into CSV for sharing with QA, analysts, or non-technical teammates.

Spreadsheet-Based Data Review

Bring data captured in SQL INSERT statements into Excel or Google Sheets for filtering, sorting, and further analysis.

How It Works

1

Split the SQL input into individual statements, respecting semicolons inside quoted strings

2

Filter to statements starting with INSERT INTO, and parse each one's table name, optional column list, and VALUES section

3

Extract each parenthesized VALUES tuple, correctly handling nested parentheses and commas inside quoted string values

4

Parse each value into its proper type: strings (with escaped quotes unescaped), numbers, booleans, or NULL

5

Combine all extracted rows into a single table and format it as CSV with the selected delimiter

100% Private

Files never leave your device. All processing happens locally in your browser.

Lightning Fast

Powered by Pure JavaScript for optimal performance on modern browsers.

Secure

No data collection, no tracking, no sign-up required.

Frequently Asked Questions

What SQL syntax does this tool support?

It parses standard INSERT INTO table (columns) VALUES (...), (...); statements, including statements without an explicit column list. It focuses on extracting data, not schema - CREATE TABLE statements and other SQL are ignored.

Can I convert multiple INSERT statements at once?

Yes. Paste any number of INSERT statements - whether they're multiple separate statements or one statement with many VALUES tuples - and all their rows are combined into a single CSV output.

What happens if column names aren't specified in the SQL?

If an INSERT statement doesn't list column names (e.g., INSERT INTO t VALUES (1, 'x')), generic headers like column1, column2 are generated based on the widest row.

How are strings, NULL, and booleans handled?

Single-quoted strings are unescaped ('' becomes a single quote), NULL becomes an empty CSV cell, and TRUE/FALSE become the literal words true/false in the output.

Can it handle values containing commas or parentheses?

Yes. The parser tracks quotes and parenthesis depth character by character, so a string value like 'Loves (parens) and, commas' is parsed as a single value and won't be mistaken for multiple columns.