What is a SQL to JSON converter?
Sometimes the only copy of the data you need is a SQL dump: a migration file, a seed script, a backup excerpt. This tool parses INSERT statements directly into a JSON array of objects, so you can inspect the rows, diff two dumps semantically, or feed the data to an API, without spinning up a database just to SELECT it back out.
Edge cases & gotchas
- Doubled single quotes (
'') are the standard escape and are unescaped to'; MySQL's non-standard\'backslash escape is not interpreted. - Rows in one statement can't have different column counts. Extra values get positional
colNkeys. - Dialect-specific literals (dates,
x'FF'blobs, casts) come through as strings. - Numeric strings stay strings only when quoted:
'42'→"42",42→42. INSERT ... SELECThas no literal values to parse and is skipped.
Value mapping reference
| SQL literal | JSON value |
|---|---|
'it''s' | "it's" |
42 / -2.5 | 42 / -2.5 |
NULL | null |
TRUE / FALSE | true / false |
'2026-07-03' | "2026-07-03" (string) |
How to use
- Paste SQL
INSERTstatements into the Input pane (a dump excerpt works). - Every INSERT is parsed: multi-row
VALUES (...), (...)and multiple statements are combined. - Column names come from the INSERT's column list; values map to JSON types.
- Quoted strings (with
''escapes), numbers, NULL, and TRUE/FALSE are all recognized. - Copy the JSON array or download it.
Examples
Multi-row INSERT → JSON array
INSERT INTO users (id, name) VALUES (1, 'Ann'), (2, 'Bob');
[
{ "id": 1, "name": "Ann" },
{ "id": 2, "name": "Bob" }
]Escaped quotes, NULL and booleans
INSERT INTO t (note, score, active) VALUES ('it''s fine', NULL, TRUE);[
{ "note": "it's fine", "score": null, "active": true }
]Multiple statements → one array
INSERT INTO t (id) VALUES (1); INSERT INTO t (id) VALUES (2);
[
{ "id": 1 },
{ "id": 2 }
]FAQ
What SQL syntax is supported?
INSERT INTO table (columns) VALUES (...): single- or multi-row, multiple statements, -- comments, and quoted identifiers (single, double, or backtick).
How are SQL values mapped to JSON?
Quoted strings become JSON strings (with '' unescaped), numbers stay numbers, NULL → null, TRUE/FALSE → booleans.
Can I paste a whole database dump?
Yes. Non-INSERT statements (CREATE TABLE, SET, comments) are skipped and every INSERT's rows are collected into one array.
What if the INSERT has no column list?
Columns are named col1, col2, … since the table definition isn't available. Include the column list for named keys.
Does this run my SQL?
No. It's a parser, not a database. Nothing is executed and nothing leaves your browser.
Can I go the other way?
Yes, JSON to SQL generates CREATE TABLE + INSERT statements from a JSON array.