JSON to SQL INSERT
This tool converts a JSON array of objects into SQL INSERT statements. Column names are taken from the union of the fields across all records, and missing values are written as NULL so no column is dropped. You can target the standard, MySQL or Postgres dialect, and choose between a single multi-row VALUES clause or one INSERT per record. The conversion runs entirely in your browser — nothing is uploaded.
How to use it
- 1
Paste a JSON array
Provide an array of objects, one object per row, or pick a local .json file.
- 2
Set the table name and dialect
Enter a table name (data by default) and choose standard, MySQL or Postgres.
- 3
Adjust the options
Decide whether to merge the rows into one INSERT and whether identifiers should be quoted.
- 4
Copy the statements
Take the executable SQL and paste it into your database client.
Key features
Columns from the union of fields
When records have different fields, the columns are merged automatically and missing values become NULL, so nothing is silently dropped.
Multiple dialects
Switch between standard double quotes, MySQL backticks and Postgres double quotes as needed.
One statement or many
Combine the rows into a multi-row VALUES clause for speed, or emit one INSERT per record.
Safe string escaping
Single quotes inside strings are escaped as two single quotes so they cannot truncate the SQL.
Ready to run
The output is valid SQL you can execute directly against a matching table.
Local and private
The structural conversion runs in a Web Worker in your browser; nothing is uploaded.
Common errors & troubleshooting
- ! The input must be an array of objects or a single object; arrays of scalars or mixed arrays report a semantic error.
- ! Single quotes inside strings are escaped as two single quotes, so executing the statement will not truncate your data.
- ! The statements only insert data — they do not create the table, so make sure the target table and column names match.
- ! For very large arrays that produce an enormous statement, turn off multi-row VALUES to get one INSERT per record, which is easier to run in batches.
Frequently asked questions
Are nested objects supported?
Nested objects and arrays are serialised into the column as a string value. To split them into separate columns, flatten the JSON first and then convert.
Will a large array produce one giant statement?
It can. If the statement gets too long, turn off multi-row VALUES so you get one INSERT per record and can run them in batches.
Which dialects are available?
Standard SQL, MySQL and Postgres. The dialect mainly affects how identifiers are quoted and how values are escaped.
Is my data uploaded?
No. The conversion runs locally in your browser; nothing leaves your device.
Related tools
JSON to CSV
Convert an array of objects into CSV you can open in Excel or WPS. Columns are the union of all keys, nested objects flatten to dot-separated names, and comma, semicolon, pipe or tab delimiters are supported.
JSON to Markdown Table
Turn a JSON array of objects into a GitHub-flavoured Markdown table, with fields becoming headers and numbers optionally right-aligned.
JSON Flatten
Flatten nested JSON into a single-level object with path keys such as user.name, user.tags[0] and server.port. Configurable delimiter and array notation. Runs locally in your browser.