Converter Tools
SQL INSERT to CSV Converter
Paste SQL INSERT statements and convert the rows to CSV, TSV, JSON, or a Markdown table. Handles multi-row inserts, NULLs, and quotes. No upload.
Output format
NULL becomes
Header toggle applies to CSV and TSV. JSON keys and Markdown headers always use the column names. Merge off exports only the first table.
Parsing runs entirely in your browser. The SQL you paste is never uploaded.
What this handles
- Multi-row and single-row VALUES lists, several statements at once, and statements with or without an explicit column list (missing columns become col1, col2, and so on).
- Every quote style: backtick, double quote, and [bracket] identifiers, plus string literals escaped with doubled quotes (it''s), backslashes (it\'s), or PostgreSQL dollar quoting.
- Real types: NULL, numbers, and TRUE / FALSE are detected so JSON output is correctly typed and NULL maps to whatever you choose.
- Messy dumps: line and block comments, INSERT IGNORE, REPLACE INTO, and ON CONFLICT or ON DUPLICATE KEY tails are skipped so the rows still come through.
How to use
- Paste one or more SQL INSERT statements into the input, or press Load sample to see a worked example with multi-row VALUES and escaped quotes.
- Pick an output format: CSV or TSV for spreadsheets, JSON for an array of objects, or Markdown for a documentation table.
- Choose what NULL should become: an empty cell, the word NULL, or a custom token like \N. Toggle the header row for CSV and TSV if you do not want column names.
- Leave Merge all statements on to combine every INSERT into one table, or turn it off to export only the first table when a paste mixes several.
- Read the extracted rows on the right. The status badges show how many rows, columns, and tables were parsed, and any skipped statements are listed as warnings.
- Press Copy output or Download to save the result. Parsing stays in your browser and nothing is uploaded.
About this tool
SQL INSERT to CSV Converter is the reverse of generating INSERT statements: it reads the INSERT statements you find in a database dump, a seed script, or a migration file and pulls the actual rows back out as CSV, TSV, JSON, or a Markdown table. People reach for it when the data they need is trapped inside a .sql file and the destination is a spreadsheet, a notebook, a JSON fixture, or a quick documentation table, and copying the values out by hand would be slow and error prone. The parser is a small SQL scanner rather than a naive regular expression, so it copes with the things that break simpler tools. It understands all three string-literal escaping styles seen in real exports: doubled single quotes such as 'it''s', backslash escapes such as 'it\'s' and '\n' from MySQL dumps, and PostgreSQL dollar-quoted strings written as $$ text $$. It reads identifiers quoted with backticks, double quotes, or square brackets as well as bare table and column names, and it strips line comments, hash comments, and block comments before parsing. It handles both single-row inserts and multi-row VALUES lists, several statements in one paste, INSERT IGNORE and REPLACE INTO, schema-qualified table names, and trailing clauses like ON CONFLICT or ON DUPLICATE KEY without choking on them. Statements that have no explicit column list still work; the columns are named col1, col2, and so on in order. Each value is classified as it is read. NULL is recognized and mapped to whatever you choose, an empty cell by default, the literal word NULL, or a custom token such as \N for re-importing. Numbers and TRUE or FALSE are detected so the JSON output is correctly typed instead of wrapping everything in strings, and string values are unescaped to their real text, with an optional trim. When a paste contains several INSERT statements you can merge them all into one result, with differing column sets unioned and gaps filled, or export only the first table, and the tool tells you how many rows, columns, and distinct tables it found. CSV and TSV output is quoted to the usual rules so commas, quotes, and newlines inside a value survive a round trip into Excel or Google Sheets, JSON is emitted as an array of objects keyed by column name, and the Markdown table escapes pipes and line breaks so it renders cleanly in a README. Everything runs in your browser. The SQL you paste, including data from private databases, is never uploaded, logged, or stored.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
CSV to SQL Converter
Turn CSV rows into portable SQL INSERT statements for any major database.
Open tool
ConverterJSON to SQL Converter
Turn JSON rows into portable SQL INSERT statements for any major database.
Open tool
DeveloperSQL Formatter
Pretty print SQL with configurable keyword case, indent, and comma style.
Open tool
ConverterCSV to JSON Converter
Two-way CSV and JSON converter with delimiter and header controls.
Open tool
ConverterCSV Viewer
View any CSV as a sortable, filterable, paginated table.
Open tool
DeveloperSQL CREATE TABLE Builder
Visual CREATE TABLE builder with constraints, indexes, and foreign keys for four SQL dialects.
Open tool