JSON to SQL
Paste JSON. Get INSERT statements in your browser. Nothing is uploaded.
Paste JSON, then convert.
What this tool does
Paste an array of objects, a single object, or an object that wraps rows. Column names are the union of keys in first-seen order. Nested objects and arrays become JSON text. Conversion is local JavaScript, not a server job.
FAQ
Does this JSON to SQL converter upload my data?
No. Parsing and SQL generation run in your browser. The JSON never leaves this page. No account, no upload, no install.
What SQL dialects are supported?
MySQL, PostgreSQL, and SQLite. Identifier quoting changes with the dialect. Numbers stay unquoted. Booleans are true or false. Nested objects and arrays become JSON text inside a SQL string.
Does JSON have to be an array of objects?
An array of objects is the primary input. A single object is treated as one row. If the root is an object that wraps rows (for example {"table": [...]}), the first array of objects is used.
What happens to nested objects and arrays?
They are stored as JSON text in a SQL string. Nothing is flattened, so nested data is not lost. In CREATE TABLE those columns are TEXT.
Can I get a CREATE TABLE statement too?
Yes. Check CREATE TABLE. Column types are guessed from values: INTEGER, REAL, or TEXT. Nested objects and arrays are TEXT. No account is required.