SQL to JSONONLINE

Convert literal INSERT INTO statements into JSON records without executing SQL.

1 MiB per input · Ctrl / ⌘ + Enter to run

Supports INSERT INTO table (columns) VALUES (literals); with strings, numbers, NULL, TRUE, and FALSE. Queries, expressions, CREATE TABLE, and dialect-specific dumps are outside this parser.

Result
Ready. Paste input, then run the tool.
Your JSON stays in your browser. Core processing happens locally.
THE PRACTICAL GUIDE

Extract JSON records from literal SQL INSERT statements

SQL to JSON reads literal row values from INSERT INTO statements without connecting to a database. It helps recover small seed datasets as JSON records.

When should you use it?

  • Inspect rows in a SQL seed file.
  • Move literal INSERT data to a JSON fixture.
  • Share record data from a simple SQL export.
WORKED EXAMPLE

Example: read literal INSERT data

Only literal row data is parsed. The tool never executes SQL or evaluates expressions.

SQL statement
INSERT INTO "data" ("name", "score") VALUES ('Alex', 42);
JSON records
[{"name":"Alex","score":42}]

Keep the input within the supported INSERT form

This parser reads explicit column lists followed by literal VALUES rows. It can recover records from a simple seed-data export without connecting to a database. It does not run the SQL, evaluate expressions, or infer columns from CREATE TABLE. A dump containing functions, SELECT statements, or database-specific features needs processing with the database tools that understand that dialect.

Do not infer missing type information

A database literal 1 might represent a count, a boolean, or an enum value. A quoted string containing JSON is still SQL text. The converter cannot determine the intended application type from the statement alone. Review the resulting fields and convert them using the known schema. The SQL and JSON converters are therefore useful transformations, but not a universal lossless database backup format.

IN PRACTICE

How do I extract JSON rows from a SQL INSERT seed file?

Paste literal INSERT INTO statements with an explicit column list and VALUES tuples. The parser reads supported literals into JSON records without connecting to or executing a database. It is suited to small seed data, not a full SQL dump.

Literal SQL rows the parser accepts

sql
INSERT INTO "data" ("id", "name") VALUES
(1, 'Alex'),
(2, 'Sam');

The result is an array of two objects with id and name. SQL expressions such as NOW() are outside this parser.

No. The tool has no SQL engine or database connection. It reads the supported INSERT literal grammar only and reports unsupported syntax.

BEFORE YOU USE THE RESULT

What should you check before using the result?

The parser does not execute SQL, evaluate expressions, process SELECT or CREATE TABLE, or support every database dialect. Check numeric precision and row semantics after conversion.

Understand JSON syntax

Technical reference: SQLite INSERT statement reference

THE JSON FIELD GUIDE
All guides