SQL INSERT to JSON Converter
Parse SQL INSERT statements into clean
JSON arrays — perfect for debugging, migrations, and fixture cleanup. Runs entirely in your
browser.
Options
Tips
• Multi-row INSERTs are fully supported
• Handles backtick, "quoted" and [bracket] identifiers
• Escaped quotes ('' and \') are decoded
• Functions like NOW() are kept as strings
• Conversion is 100% client-side
About SQL INSERT to JSON Converter
The SQL INSERT to JSON Converter parses SQL INSERT statements and turns each row into
a JSON object, returning a clean JSON array you can use anywhere. It is a natural companion to
CSV, XML, and YAML conversions — ideal for quickly inspecting database dumps, building test
fixtures, migrating data between systems, or debugging what a query actually inserts.
The parser understands single and multi-row inserts, column lists, quoted identifiers
(`backticks`, "double quotes", and [brackets]), string escapes, NULLs,
numbers, and booleans across MySQL, PostgreSQL, SQLite, and SQL Server dialects. Everything
runs locally in your browser — no data is ever uploaded, so it is safe for sensitive dumps.
How to Use SQL INSERT to JSON Converter
- Paste your SQL INSERT statements into the input box, or click "Load example" to try a sample.
- The JSON updates instantly as you type — no button to press.
- Toggle "Infer types" to keep numbers and booleans as native JSON values, or turn it off to output everything as strings.
- Toggle "Pretty print" for indented, readable JSON, or off for compact minified output.
- Toggle "Group by table" to nest rows under their table name when your SQL targets more than one table.
- Copy or download the result as a
.jsonfile.
Conversion Examples
SQL Input
INSERT INTO users (id, name, active)
VALUES (1, 'Alice', TRUE),
(2, 'Bob', FALSE);JSON Output
[
{ "id": 1, "name": "Alice", "active": true },
{ "id": 2, "name": "Bob", "active": false }
]Frequently Asked Questions
Does it support multi-row INSERT statements?
Yes. A single INSERT ... VALUES (...), (...), (...) with many tuples becomes one JSON object per row. Multiple separate INSERT statements are also parsed and combined.
What happens if there are no column names?
If an INSERT omits the column list, generic keys like column_1, column_2 are used so no data is lost. Add a column list to your SQL for meaningful key names.
How are NULL, numbers and booleans handled?
With "Infer types" on (the default), NULL becomes JSON null, numeric literals become numbers, and TRUE/FALSE become booleans. Turn it off to keep every value as a string.
What about SQL functions like NOW() or UUID()?
Unquoted expressions and function calls cannot be evaluated client-side, so they are preserved verbatim as strings (for example "NOW()") so you can post-process them.
Which SQL dialects work?
The parser handles common MySQL, PostgreSQL, SQLite, and SQL Server syntax, including backtick, double-quote, and bracket identifier quoting, plus '' and backslash string escapes. INSERT IGNORE and INSERT OR REPLACE variants are recognized too.
Is my data safe?
Yes. All parsing happens locally in your browser. Nothing is sent to a server, so you can safely convert production dumps and sensitive data.
Need the reverse? Try the CSV to SQL Insert generator, or convert JSON further with JSON to CSV and JSON to XML.