JSON to SQL

Generate CREATE TABLE + INSERT statements from a JSON array. PostgreSQL, MySQL, SQLite, SQL Server. 100% in-browser.

TABLE
DIALECT
JSON INPUTarray of objects
SQL OUTPUT
-- SQL appears here

From JSON to your database in one paste

Bootstrapping a database with seed data, importing an API response into Postgres for analysis, or building a fixture file for tests — all the same pattern: a JSON array of records and a target table.

Column types are inferred from the values. Strings become VARCHAR or TEXT, integers become INTEGER, booleans become BOOLEAN (or TINYINT in MySQL), and ISO date strings are detected as DATE or TIMESTAMP. Nested objects fall through to a TEXT column with the JSON serialized as-is.

Dialect-aware

Identifiers are quoted with double quotes for Postgres and SQLite, backticks for MySQL, square brackets for SQL Server. String values use single-quote doubling, the SQL standard escape.

Privacy first

Generation happens locally. Your data never reaches any server, so production payloads stay private even when you are just exploring shapes.

Common questions

What does this tool generate?
A CREATE TABLE statement and a series of INSERT statements that reproduce your JSON array as rows in a SQL table. Column types are inferred from the first record's values, then refined by scanning the rest of the array.
Which SQL dialects are supported?
PostgreSQL, MySQL, SQLite, and SQL Server. The dialect affects type names (SERIAL vs AUTO_INCREMENT vs INTEGER PRIMARY KEY), identifier quoting (double quotes vs backticks vs square brackets), and string escaping rules.
How is the table name chosen?
The table name comes from the input field at the top of the editor — default is "imported_data". Change it to whatever fits your schema. Identifiers are quoted automatically using the dialect's convention.
What about nested objects and arrays?
Nested values are serialized as JSON strings inside a text column. PostgreSQL users should consider storing them in a JSONB column instead — convert the output by hand after generation. For relational data, normalize the structure before importing.
How are strings escaped?
Single quotes inside string values are doubled ('O''Hara') — the SQL standard escape. This handles 99% of cases. For binary data or LIKE-pattern characters, sanitise before importing.
Is my data private?
Yes. The JSON parser and the SQL generator both run locally in your browser. Nothing is uploaded. You can paste production data without leaving your tab.