SQL → JSON
Turn SQL INSERT statements into JSON rows, parsed locally in your browser.
Turn INSERT statements back into row objects
Database dumps, migration scripts and seed files usually ship as SQL INSERT statements, which are awkward to feed into a script or a test fixture that expects JSON. This tool scans the SQL for INSERT INTO ... VALUES statements, including multiple statements and multi-row VALUES lists, and turns each row into a JSON object keyed by its column names. It runs locally, which matters because seed data and dumps often contain real names, emails or account values.
How to use the SQL → JSON
- Paste one or more SQL INSERT statements into the left panel, or start from the loaded example.
- Read the JSON array of row objects generated on the right, one object per VALUES tuple.
- Check that column names line up correctly when the INSERT statement lists explicit columns.
- Copy the JSON, or send it to another tool such as the JSON formatter or JSON to CSV converter.
This is a best-effort parser tuned for INSERT ... VALUES syntax, not a full SQL engine: it handles quoted strings with doubled-quote escapes, integers, decimals, NULL, TRUE and FALSE, and treats any other bare token, such as a function call, as literal text.
When an INSERT statement omits its column list, rows fall back to generic keys like column1, column2 in tuple order, since there is no column name to read from the statement itself.
Frequently asked questions
- Does this handle multiple INSERT statements at once?
- Yes, every INSERT INTO ... VALUES statement found in the pasted text is parsed, and every row from every statement is added to the same output JSON array.
- What happens with multi-row VALUES like VALUES (1,'a'), (2,'b')?
- Each parenthesized tuple in the VALUES clause becomes its own row object in the JSON array, so a single INSERT with ten value tuples produces ten objects.
- Can it parse UPDATE or SELECT statements too?
- No, it only recognizes INSERT INTO ... VALUES statements. UPDATE, SELECT and other SQL statement types are ignored, and an input with no INSERT statements returns an error.
- Is this a full SQL parser?
- No, it is a best-effort tokenizer built for common INSERT syntax across dialects, not a validating SQL parser, so unusual expressions or vendor-specific literal syntax may not convert as expected.