Skip to content

SQL to CSV converter

SQL to CSV runs through our table engine, parsing INSERT INTO ... VALUES data without executing SQL.

  • Converted with Table engine · nothing stored
  • Free: 5 conversions a day · 5 MB each
  • Higher limits →

From real runs

What you get — and what changes

  • INSERT rows Kept

    MySQL, PostgreSQL, and SQLite-style INSERT INTO ... VALUES statements are parsed into table rows.

  • Multiple tables Changed

    Each table becomes its own CSV; when more than one table is present, the outputs are packaged as a ZIP.

  • Column names Changed

    Explicit INSERT column lists are used first; CREATE TABLE definitions provide column names when INSERT statements omit them.

  • Escaped strings Kept

    Quoted strings, doubled quotes, backslash escapes, commas inside values, and NULL tokens are handled by the dump parser.

  • Queries and expressions Lost

    SELECT queries, stored procedures, triggers, computed expressions, and database-specific DDL are ignored rather than executed.

  • Types and constraints Lost

    CSV carries text values only; primary keys, indexes, foreign keys, and column types do not survive as schema metadata.

  • Statement safety Kept

    The converter parses dump text and does not connect to a database or run statements.

Sample conversions

MySQL dump with two tables

Input
CREATE TABLE users (id int, email varchar(255)); INSERT INTO users VALUES (1,'ada@example.com'); CREATE TABLE orders (id int, user_id int, total decimal(10,2)); INSERT INTO orders VALUES (10,1,29.95),(11,1,49.00);
Output
ZIP containing users.csv with id,email and orders.csv with id,user_id,total. No CREATE TABLE statements are executed.

Escaped commas

Input
INSERT INTO products (sku,name,notes) VALUES ('A-1','Widget, large','Bob\'s sample');
Output
products.csv quotes the comma in "Widget, large" and unescapes the apostrophe in Bob's sample.

PostgreSQL explicit columns

Input
INSERT INTO public.events (id, happened_at, payload) VALUES (1, '2026-09-10', '{"type":"signup"}');
Output
events.csv uses id,happened_at,payload from the INSERT column list and keeps the JSON payload as a quoted CSV field.

A real SQL → CSV run

We converted our SQL sample (455 B) with Table engine on 2026-09-11. It took 1 ms and produced a 235 B CSV file, 48% smaller than the input. The engine raised no warnings.

Input · sample.sql · 455 B

1 CREATE TABLE, 4 INSERT statements

CREATE TABLE
1
INSERT statements
4
Lines
5

Output · sample.csv · 235 B

4 data rows × 5 columns; header: column_1,column_2,column_3,column_4,column_5

Rows
4
Columns
5
Header
column_1,column_2,column_3,column_4,column_5

First lines of the output

csv
column_1,column_2,column_3,column_4,column_5
Northwind Traders,Proposal,48000,R. Ayers,2026-10-14
Contoso Ltd,Negotiation,120000,P. Ng,2026-09-30
Fabrikam,Qualified,22500,R. Ayers,2026-11-02
Tailspin Toys,Won,64000,M. Okafor,2026-09-03

Options and when to change them

dialect
Choose MySQL, PostgreSQL, or SQLite when dump quoting differs; auto works for common INSERT lists.
tableName
Filter to one table when a dump contains many tables but you only need a specific export.
zipMultipleTables
Keep enabled for multi-table dumps so each table has its own CSV file inside one download.

Do it yourself

sqlite3 import then export

bash
sqlite3 scratch.db < dump.sql
sqlite3 -header -csv scratch.db "select * from users;" > users.csv

This executes the dump in a local database. Only do it with trusted dumps and a disposable database file.

Python parser approach

bash
python - <<'PY'
# For trusted, simple INSERT dumps, parse values and write csv.writer rows.
# Prefer a real SQL dump parser for production automation.
PY

Regex-only SQL parsers fail on nested quotes and dialect-specific escapes.

SQL to CSV by API or MCP

The HTTP API and the MCP server run the exact engine this page uses (Table engine); the response carries the same warnings the web converter shows. Check support first with GET /api/v1/pairs?from=sql&to=csv.

curl
curl -X POST https://filetypeconverters.com/api/v1/convert \
  -H "Authorization: Bearer $FTC_API_KEY" \
  -F "file=@input.sql" -F "from=sql" -F "to=csv" \
  -F 'options={"encoding":"utf-8"}' \
  --output output.csv

Options this engine accepts for SQL → CSV

KeyApplies toTypeDefault
encodingReading SQLutf-8 · latin1utf-8
delimiterWriting CSVstring,
newlineWriting CSV ·
API reference

When this is the wrong conversion

  • Do not use this for SELECT query results; export the query from the database client instead.
  • Do not expect triggers, indexes, constraints, stored procedures, or views to appear in CSV output.
  • If the dump uses COPY, bulk loader syntax, or binary blobs, verify support before depending on the result.

SQL to CSV questions

Does SQL to CSV execute my SQL dump?

It parses INSERT INTO ... The conversion counts toward your daily or monthly allowance like every other, and the input is deleted within 24 hours.

What happens when the dump has multiple tables?

Each table becomes a separate CSV file. When there are multiple tables, the download is a ZIP containing one CSV per table.

How are column names chosen?

INSERT column lists are used when present. If the INSERT omits columns, a CREATE TABLE statement can supply the column order.

Is SQL to CSV processed on my device?

The conversion counts toward your daily or monthly allowance like every other, and the input is deleted within 24 hours.