WebToolsPlanet
Converter Tools

SQL to CSV Converter

Paste SQL INSERT statements and get CSV output — pick a delimiter, toggle the header, and paste into your spreadsheet or data tool.

Last updated: May 27, 2026

Client-Side Processing
Input Data Stays on Device
Instant Local Execution

Find this tool useful? Support the project to keep it free!

Buy me a coffee

What is SQL to CSV Converter?

A SQL INSERT statement holds the same information as a CSV row, just wrapped in different syntax. Converting between them is mechanical work — but doing it by hand for a dump file with thousands of rows is impractical, and naive find-and-replace breaks on embedded commas and quotes.

This tool parses INSERT statements with a real tokenizer (the same one used for SQL to JSON) and emits a properly quoted CSV. Cells that contain the delimiter, a double quote, or a newline are wrapped in double quotes per RFC 4180, with embedded quotes doubled. The result drops cleanly into Excel, Google Sheets, or any CSV parser.

How to Use SQL to CSV Converter

1

Paste one or more SQL INSERT statements.

2

Pick a delimiter: comma, semicolon, pipe, or tab.

3

Toggle the header row and quote-every-cell options.

4

Copy the CSV output.

Common Use Cases

  • Migrating data from a SQL dump to a spreadsheet for analysis.
  • Converting database fixtures into a CSV file for a downstream load.
  • Pasting data from a SQL export into Excel or Google Sheets.
  • Generating tab-separated output to paste into a TSV-aware tool.

Example Input and Output

A multi-row INSERT becomes a CSV table with a header row.

SQL input
INSERT INTO users (id, name) VALUES (1, 'Alice'), (2, 'Bob, Jr.');
CSV output
id,name
1,Alice
2,"Bob, Jr."

Privacy

All parsing happens in your browser. No SQL is sent to a server.

RFC 4180

The output follows RFC 4180: double quotes wrap fields containing delimiters, quotes, or newlines; embedded double quotes are escaped by doubling them.

Frequently Asked Questions

How is NULL represented in the CSV?
NULL becomes an empty cell. To distinguish empty string from NULL, enable "Quote every cell" — strings will then be wrapped in quotes while NULL stays unquoted-empty.
What is "Quote every cell" for?
Some downstream CSV consumers (PostgreSQL COPY, certain data warehouses) require every value to be quoted. The default is to quote only when necessary.
Does this support SELECT result output?
Only INSERT statements. To export SELECT results, save them as INSERT statements from your client and paste them here.
Does this send my SQL anywhere?
No. All parsing happens locally in your browser.