SQL to JSON, CSV & Excel Converter

Paste a SQL dump or a few INSERT statements and get the rows back as JSON, CSV or an Excel workbook with one sheet per table.

Runs in your browserUpdated
Output
Open .sql file
Backslash escapes (\' \n)

Table preview

Your data never leaves your computer. All processing happens 100% locally in your browser.

How to use the SQL to JSON, CSV & Excel

  1. Paste INSERT statements or open a .sql dump file (mysqldump, pg_dump --inserts, SQLite .dump, phpMyAdmin export).
  2. Pick the output: JSON, CSV or Excel. With several tables, choose one from the table menu.
  3. Column names come from the INSERT column list or the matching CREATE TABLE statement.
  4. Copy the result or download it — the Excel download contains one sheet per table.

What is SQL to JSON / CSV conversion?

Database exports are often SQL scripts: a CREATE TABLE followed by thousands of INSERT INTO … VALUES (…) rows. That is great for restoring a database but awkward when you just want to look at the data, hand it to a colleague in Excel or load it into a script. This tool parses the INSERT statements and gives you the rows as JSON objects, a CSV file or an .xlsx workbook — without installing or restoring a database.

What it understands

  • Multi-row inserts: VALUES (…), (…), (…) as written by mysqldump and most export tools.
  • Column names from the INSERT column list, or — when the INSERT has none — from the matching CREATE TABLE in the same script.
  • Quoted identifiers: `backticks`, "double quotes" and [brackets], plus schema-qualified names like public.users.
  • String escapes: doubled quotes ('O''Brien') everywhere, and MySQL backslash escapes ('O\'Brien', \n) — detected automatically or set manually.
  • Literals: numbers, NULL, TRUE/FALSE, N'…' Unicode strings, X'…' hex and MySQL charset introducers such as _utf8mb4'…'.
  • Comments (--, #, /* … */) and other statements (SET, LOCK TABLES, ALTER) are skipped.

Expressions such as NOW() or CAST(…) cannot be evaluated without a database, so they are kept as text and counted in a notice.

Choosing an output format

FormatBest for
JSONAPIs, fixtures, JavaScript and Python scripts. With several tables, “All tables” returns an object keyed by table name.
CSVImporting into another database, data tools or Google Sheets. The download includes a UTF-8 BOM so Excel shows accents correctly.
ExcelSharing with non-developers: one worksheet per table, bold frozen header, numbers stored as numbers.

Limits

INSERT … SELECT statements have no literal values and are skipped, as are Oracle INSERT ALL blocks. PostgreSQL COPY … FROM stdin sections are not INSERTs — export with pg_dump --inserts or --column-inserts instead. Going the other way? Use CSV & Excel to SQL or JSON to SQL.

Tools that pair well with the SQL to JSON, CSV & Excel

  • JSON to Excel — Turn a JSON array into a real Excel workbook.
  • JSON to CSV — Turn a JSON array into a spreadsheet-ready CSV.
  • Excel to JSON — Open an .xlsx workbook or paste cells straight from Excel or Google Sheets and get clean JSON.
  • CSV & Excel to HTML Table — Paste spreadsheet cells, CSV or JSON and get semantic, escaped HTML table markup — with an optional ready-made style and a live preview.

Frequently asked questions

How do I convert a .sql file to Excel?
Open the .sql file with Open .sql file, choose Excel as the output and click Download .xlsx. Each table in the dump becomes its own worksheet.
Why are my columns named column1, column2…?
The INSERT statements have no column list and the script does not include the CREATE TABLE for that table. Add the CREATE TABLE statement (or a column list) and the real names are used.
Does it work with PostgreSQL dumps?
Yes, if the dump was created with pg_dump --inserts or --column-inserts. The default COPY format is not made of INSERT statements.
Is my SQL dump uploaded?
No. The file is read and parsed in your browser, so customer data in the dump stays on your device.
How big can the dump be?
There is no fixed limit, but very large dumps (hundreds of MB) may be slow in a browser tab. Split them by table if needed.

Related tools