AnyTool
Your files never leave your device. All processing happens locally in your browser.

How do I convert SQL INSERT statements to CSV?

Paste or drop your SQL dump into AnyTool's SQL to CSV converter and it extracts the rows to CSV live in your browser. It reads CREATE TABLE for column names, parses single and multi-row INSERTs across MySQL, PostgreSQL, SQLite, SQL Server and Oracle, keeps NULL distinct from empty strings, and handles every dump with multiple tables. Copy or download the CSV — nothing is uploaded.

  • Parses CREATE TABLE + INSERT, single and multi-row
  • Multi-table dumps: pick a table or export all combined
  • Correct quoting, escaping, and NULL handling
  • 100% in your browser — no upload, no signup, no row cap

What is

SQL to CSV

SQL to CSV conversion reads SQL statements — CREATE TABLE for the column names and INSERT INTO … VALUES for the data — and writes the rows out as comma-separated values. It is the inverse of CSV to SQL and is used to pull data out of a database dump into a spreadsheet.

File Tools

Related terms

INSERT INTOCREATE TABLEmysqldumppg_dump

How to Convert SQL to CSV

Extract rows from SQL INSERT statements to CSV entirely in your browser.

20 secWeb browser
  1. 1

    Add your SQL

    Paste SQL text or drop a .sql dump. The CSV updates live as you type.

  2. 2

    Pick table & options

    For multi-table dumps choose a table (or all), then set the delimiter, header, and NULL handling.

  3. 3

    Export

    Copy the CSV or download it as a .csv file.

Result: A CSV file of the extracted rows

Frequently Asked Questions

Yes — AnyTool parses the SQL in your browser, so your data never leaves your device.

Parsing and CSV generation are 100% client-side; no file is uploaded to any server.

Yes — it detects every table and lets you export one or all of them.

Each table keeps its own columns; you can pick a single table or export all tables combined with a leading table column.

Yes — SQL NULL is distinct from an empty string, and you choose what NULL becomes in the CSV.

NULL can be output as empty, the literal NULL, \N, or any custom token, while quoted empty strings stay empty.

Detailed Explanation

Methodology

How the SQL to CSV Converter Works

AnyTool parses the SQL entirely in the browser with a string- and paren-aware scanner: it splits statements on top-level semicolons (skipping -- , # and /* */ comments and ignoring semicolons inside strings), reads CREATE TABLE definitions for column names (correctly keeping types like DECIMAL(10,2) and skipping PRIMARY KEY / FOREIGN KEY constraints), and extracts single and multi-row INSERT … VALUES tuples. It handles every dialect's identifier quoting (backtick, double-quote, bracket), schema-qualified names, doubled-quote and backslash escapes, typed string prefixes (N'..', _utf8'..'), values containing commas/newlines/function calls, and keeps SQL NULL distinct from the empty string. A dump with several tables is kept separate so you can export one table or all of them combined.

  • Runs client-side — the SQL is never uploaded
  • CREATE TABLE + INSERT parsing, single and multi-row
  • Multi-table dumps: per-table or combined CSV
  • NULL kept distinct from empty string (configurable token)
  • Dialect-aware quoting, doubled-quote and backslash escapes
  • RFC 4180-correct CSV with delimiter / header / BOM options
Privacy & Security

Privacy and Offline Use

Because the SQL is parsed locally, your data never touches a server — unlike upload-based converters that often require an account and cap rows. The tool works offline after first load and has no row limit beyond your device memory.

SQL → CSV: in-browser (AnyTool) vs typical online converters
CapabilityAnyToolTypical online converters
Data handlingParsed in your browserOften uploaded to a server
Multi-table dumpsPer-table + combined exportOften single-table or merged wrong
NULL vs emptyKept distinct, configurableOften conflated
Dialect quotingBacktick / "double" / [bracket]Often MySQL-only
Row limit / signupNo cap, no signupOften capped or account-gated

Capabilities reflect the live AnyTool tool; competitor behavior varies by service.