Convert · Runs in your browser

SQL to JSON Converter

Convert SQL INSERT statements — or a whole dump file — into a JSON array of objects.

SQL
Drop a file to load it
JSON
Waiting for input

How to use it

  1. Paste INSERT INTO … VALUES statements, or a mysqldump / pg_dump excerpt.
  2. Each row becomes an object, keyed by column name.
  3. Copy the JSON or download it as a .json file.

Column names

Names come from the INSERT column list. If it has none, the matching CREATE TABLE statement is used; otherwise columns are named column1, column2…

Values

Strings, numbers, NULL, TRUE/FALSE and escaped quotes are understood. Function calls like NOW() are kept as text.

Several tables

If the input inserts into more than one table, the output is an object with one array per table.