Tools / JSON to SQL
JSON to SQL
Paste a JSON array of objects and get CREATE TABLE plus INSERT statements. Types are inferred across rows, nested objects can stay as JSON or flatten into columns, and you can override the schema before download.
From a JSON array to a table
Paste an array of objects (or one object). Keys become columns. Types are inferred across every row: integers, floats, booleans, ISO timestamps, and nested objects or arrays as JSON. A column is NULL when any row omits the key or sets it to null; otherwise it is NOT NULL.
[
{ "id": 1, "name": "Ada", "active": true },
{ "id": 2, "name": "Bob", "active": false }
]CREATE TABLE "users" (
"id" INTEGER NOT NULL,
"name" TEXT NOT NULL,
"active" BOOLEAN NOT NULL
);
INSERT INTO "users" ("id", "name", "active") VALUES
(1, 'Ada', TRUE),
(2, 'Bob', FALSE);PostgreSQL, MySQL, and SQLite
Switch the dialect for identifier quoting and type names. PostgreSQL uses double quotes and JSONB. MySQL uses backticks, TINYINT(1) for booleans, and JSON. SQLite stores booleans as 0/1 and JSON as TEXT. String escaping follows each dialect so quotes and backslashes in your data do not break the script.
Nested objects, overrides, and batch inserts
Nested objects can stay in one JSON column or flatten to dotted-style keys joined with underscores (user_id, user_name). Use the schema table to override an inferred type before you copy. Batch size splits large inserts into multiple INSERT statements so clients with statement size limits stay happy.
FAQ
Is my JSON uploaded?
No. Parsing and SQL generation run in your browser. Seed data and private records never leave your device.
Which databases are supported?
PostgreSQL, MySQL, and SQLite. Identifier quoting, boolean literals, and JSON column types follow each dialect.
Can I change inferred column types?
Yes. The schema table above the panes lets you override each column type before you copy or download the SQL.