Esta página ainda não foi traduzida para o português, por isso aparece em inglês.

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.

Atualizado em
Output
Open .sql file
Backslash escapes (\' \n)

Table preview

Seus dados nunca saem do seu computador. Todo o processamento acontece localmente no navegador.

Como usar: 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.

Também pesquisado como: sql to json, sql to csv, sql to excel, sql dump to csv, mysqldump to json, insert statements to csv, sql to xlsx, convert sql file to excel.

Ferramentas que combinam com: SQL to JSON, CSV & Excel

  • SQL Formatter — Paste a query — or a whole migration — and get readable SQL with one clause per line, aligned joins and consistent keyword case, using the grammar of your database.
  • 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.

Perguntas frequentes

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.
Posso instalar o SQL to JSON, CSV & Excel como um aplicativo da web e usá-lo offline?
Sim. O SQL to JSON, CSV & Excel é um aplicativo da web instalável (PWA) — instalado a partir do seu navegador, não baixado de uma loja de aplicativos. Clique em “Instalar aplicativo” na parte superior desta página no Chrome ou no Edge (Windows, macOS, Linux, ChromeOS) ou, no Android, use “Compartilhar” → “Adicionar à tela inicial” no iPhone e no iPad, ou “Arquivo” → “Adicionar ao Dock” no Safari 17+ em um Mac. Em seguida, ela se abre em uma janela própria com seu próprio ícone e, como é executada inteiramente no seu navegador, continua funcionando offline. O Firefox no desktop não permite a instalação de aplicativos da web. Como funciona a instalação.

Ferramentas relacionadas