IQ
PayloadIQ
PayloadIQ Utilities

JSON to SQL

Paste a JSON array and get a CREATE TABLE plus batched INSERT statements back — column types inferred, strings escaped. It all runs in your browser.

CREATE TABLE + INSERT statements appear here.

Runs in your browser. Your input is not uploaded to PayloadIQ.

JSON to SQL turns a JSON array into seed SQL you can paste into a migration or a psql/sqlite shell. It emits a CREATE TABLE IF NOT EXISTS with a column per key — types inferred as INTEGER, REAL, BOOLEAN or TEXT — followed by a single batched INSERT … VALUES with one row per object. String values are single-quoted and escaped, booleans become TRUE/FALSE, and nulls become NULL. Everything runs locally in your browser, so a real data export never leaves your machine.

From an export to seed data

Paste an array of objects for many rows, or a single object for one. Set the table name with the Table-name field. The keys of the first records define the columns, so use representative records — and review the inferred column types before running the SQL (money is usually better as NUMERIC, large ids as BIGINT).

Portable, reviewable SQL

The output uses portable syntax (quoted identifiers, TRUE/FALSE, NULL) that works across PostgreSQL, SQLite and MySQL for typical seed data. It is meant for SQL you review and run yourself — not for executing untrusted input. Need CSV instead, or types in another language? Try JSON to CSV or the PayloadIQ playground.

FAQ

Is my JSON uploaded?
No. The JSON is parsed and converted entirely in your browser with JavaScript — it never leaves your device. That makes it safe for real exports, fixtures, and anything internal.
What does it generate?
A CREATE TABLE IF NOT EXISTS with a column per key (types inferred from the values: INTEGER, REAL, BOOLEAN, TEXT) followed by a single batched INSERT … VALUES with one row per object. Paste an array of objects for multiple rows, or a single object for one row.
Are string values escaped?
Yes. String literals are single-quoted and any embedded apostrophe is doubled ('' ), booleans become TRUE/FALSE and nulls become NULL — so the output is valid SQL you can paste into a seed script or migration. It is for generating SQL you review, not for executing untrusted input.
Which SQL dialect is it?
Standard, portable SQL that works in PostgreSQL, SQLite and MySQL for typical seed data (quoted identifiers, TRUE/FALSE, NULL). Review the inferred types — for example, money is better stored as NUMERIC/DECIMAL than the inferred REAL, and very large integers may need BIGINT.

Related utilities

JSON to CSVJSON to TypeScriptJSON Formatter / ValidatorCSV to Markdown TableJSON VisualizerJSON MinifierJSON DiffJSON to YAML
Open PayloadIQ Playground