{ } JSON Workbench0 network requests. Check DevTools

"SQL to JSON":{ }

Paste INSERT statements (from a dump, migration, or seed file) and get a clean JSON array of objects. Multi-row VALUES, doubled-quote escapes, NULL and TRUE/FALSE are all handled. It's a parser, not a database: nothing is executed, and nothing leaves your browser.

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 colN keys.
  • Dialect-specific literals (dates, x'FF' blobs, casts) come through as strings.
  • Numeric strings stay strings only when quoted: '42'"42", 4242.
  • INSERT ... SELECT has no literal values to parse and is skipped.

Value mapping reference

SQL literalJSON value
'it''s'"it's"
42 / -2.542 / -2.5
NULLnull
TRUE / FALSEtrue / false
'2026-07-03'"2026-07-03" (string)

How to use

  1. Paste SQL INSERT statements into the Input pane (a dump excerpt works).
  2. Every INSERT is parsed: multi-row VALUES (...), (...) and multiple statements are combined.
  3. Column names come from the INSERT's column list; values map to JSON types.
  4. Quoted strings (with '' escapes), numbers, NULL, and TRUE/FALSE are all recognized.
  5. Copy the JSON array or download it.

Examples

Multi-row INSERT → JSON array

Input
INSERT INTO users (id, name) VALUES
  (1, 'Ann'),
  (2, 'Bob');
Output
[
  { "id": 1, "name": "Ann" },
  { "id": 2, "name": "Bob" }
]

Escaped quotes, NULL and booleans

Input
INSERT INTO t (note, score, active) VALUES ('it''s fine', NULL, TRUE);
Output
[
  { "note": "it's fine", "score": null, "active": true }
]

Multiple statements → one array

Input
INSERT INTO t (id) VALUES (1);
INSERT INTO t (id) VALUES (2);
Output
[
  { "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, NULLnull, 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.

Related tools