format · validate · convert · runs locally

JSON to SQL

Convert a JSON array of objects into SQL: a CREATE TABLE with column types inferred from your data (INTEGER, REAL, BOOLEAN, TEXT) plus one INSERT statement per row, with strings safely quoted. Copy it or download the .sql. Runs in your browser.

Frequently asked questions

What JSON shape does it expect?

An array of objects, e.g. [{"id":1,"name":"a"}, …]. The union of all keys becomes the table columns; each object becomes one INSERT row.

How are column types inferred?

Whole numbers become INTEGER, decimals REAL, true/false BOOLEAN, and everything else TEXT. Columns with mixed types fall back to TEXT.

Is the SQL safe to run?

String values are single-quote-escaped and nulls become NULL. Identifiers are double-quoted, which works in PostgreSQL and SQLite; adjust quoting for MySQL if needed.