csvkit.org
CSV (Comma-Separated Values) utilities, in the browser
Say hi →

SQL to CSV

INSERT … VALUES · multi-row and multi-table dumps · CREATE TABLE column names

Turn a SQL dump back into data. Paste INSERT INTO … VALUES (…) statements — from mysqldump, pg_dump, or a migration file — and get a CSV per table. Column names come from the INSERT's column list, or from a CREATE TABLE above it if the INSERT doesn't name them.

sql → csv
Or drop a .sql file here, or
ready

How to convert SQL to CSV

  1. Paste the SQL, or drop a .sql file.
  2. If the dump contains several tables, pick the one you want from the dropdown — the row count is shown next to each name.
  3. Copy or download the CSV.

What it understands

What it doesn't do

This is a parser for literal INSERT data, not a SQL engine. It ignores INSERT … SELECT (there are no literal values to read), function calls like NOW() are passed through as the literal text, and binary or hex blobs come out as written. If a dump has no column names anywhere, columns are numbered column_1…n so nothing is lost — you can rename them with Header row. Going the other way is CSV to SQL.

FAQ

My dump has several tables — do I get all of them?

All of them are parsed; the dropdown switches which one is shown. Download each in turn.

Why are some columns numbered instead of named?

Because neither the INSERT nor a CREATE TABLE in the pasted text named them. Include the CREATE TABLE statement and the names appear.

Are the values unescaped?

Yes — '' becomes ', and \n, \t, \' are decoded, then the CSV is re-quoted properly.

Is my dump uploaded?

No. Parsing happens in your browser, which matters for a dump full of production data.

Privacy

100% client-side. No upload. See the privacy policy.