SQL to JSON Converter – INSERT Statements to JSON

Paste SQL INSERT statements and get a clean JSON array, with numbers, NULL and true/false converted to real JSON values.

SQL Input

Ln 1, Col 1Empty

JSON Result

Your result will appear here.
No result yet

What Is a SQL to JSON Converter?

A SQL to JSON converter reads INSERT statements, like the ones in a database dump, and turns every row into a JSON object. This is handy for moving data into an API, a NoSQL database, test fixtures or a JavaScript app.

How to Convert SQL to JSON

  1. Paste your INSERT statements, or drop a .sql file on the box.
  2. Click Convert to JSON, or press Ctrl + Enter.
  3. Copy the JSON or download it as data.json.

Features

  • Reads single-row and multi-row INSERT statements.
  • Uses the column names from the INSERT, or column1, column2 … when there are none.
  • Handles quotes like O''Neil, NULL, TRUE/FALSE and numbers.
  • Several tables in one file become one JSON object with a list per table.
  • Runs in your browser. Your data is never uploaded.

Example

SQL
INSERT INTO users (id, name, active, manager) VALUES
  (1, 'Emily O''Neil', TRUE, NULL),
  (2, 'James Smith', FALSE, 1);
JSON
[
  { "id": 1, "name": "Emily O'Neil", "active": true, "manager": null },
  { "id": 2, "name": "James Smith", "active": false, "manager": 1 }
]

The doubled quote in O''Neil (how SQL writes an apostrophe) becomes a normal ', NULL becomes null, and TRUE/FALSE become JSON booleans.

When This Is Useful

  • Database dumps: turn a mysqldump or pg_dump INSERT section into JSON test data or seed files.
  • Moving data to a NoSQL database such as MongoDB or Firestore, which import JSON.
  • Mock APIs: use real rows as sample responses in front-end development.

This tool reads INSERT statements; it does not run SQL or read SELECT queries. To export query results as JSON, most databases can do it directly, for example json_agg in PostgreSQL or JSON_ARRAYAGG in MySQL. Going the other way? Use JSON to SQL, or see How to Import JSON into a Database.

Frequently Asked Questions

Which SQL can it read?

INSERT INTO statements with one or many rows, with or without a column list, from MySQL, PostgreSQL, SQLite or SQL Server dumps. Other statements, like CREATE TABLE, are skipped.

How are values converted?

Numbers become JSON numbers, NULL becomes null, TRUE/FALSE become true/false, and quoted text becomes strings. Function calls like NOW() are kept as text.

What if there are several tables?

The result is a JSON object with one array per table name.

Is my SQL uploaded?

No. Everything runs in your browser.

Related Tools