JSON to SQL INSERT Generator
Paste JSON to generate SQL INSERT statements. Works with an array of objects or a single object, uses the union of keys as columns, and escapes strings safely so the output is ready to run.
How to convert JSON to SQL
- Paste or type your JSON. An array of objects works best.
- Set the table name the rows should be inserted into.
- Copy the INSERT statements or download them as a .sql file.
Examples
Array of objects
[{"name":"Ada","age":36},{"name":"Linus","age":54}]INSERT INTO users (name, age) VALUES ('Ada', 36);
INSERT INTO users (name, age) VALUES ('Linus', 54);Frequently asked questions
Is my data uploaded anywhere?
No. The conversion runs entirely in your browser, so your JSON and the generated SQL never leave your device.
What JSON shape works best?
An array of flat objects. Each object becomes one INSERT statement and each key becomes a column. A single object is also accepted and produces one INSERT.
How are strings and special characters handled?
Strings are wrapped in single quotes and any single quote inside the value is doubled, so a name like O'Brien becomes 'O''Brien'. That keeps the statement valid and avoids broken SQL.
How are null, booleans, numbers and nested values written?
null becomes a bare NULL, true and false become TRUE and FALSE, and numbers are written without quotes. Nested objects and arrays are serialized to JSON text and stored as a quoted string so no data is lost.
What if my objects have different keys?
The converter uses the union of all keys as the column list. Any row missing one of those keys gets NULL for that column, so every INSERT lines up.
Are table and column names made safe?
Yes. Table and column identifiers are sanitized to letters, digits and underscores, and a leading digit is prefixed with an underscore. This is a generator for trusted data, so always review the output before running it against a database.
Related tools
JSON to CSV
Convert JSON to CSV online. Paste an array of objects and get clean, spreadsheet-ready CSV with the right headers. Runs in your browser.
SQL Formatter
Format and beautify SQL online. Put clauses on their own lines, indent the column list and uppercase keywords. Fast and runs in your browser.
JSON Formatter
Format, validate and minify JSON online. Pretty-print with custom indentation, sort keys and catch syntax errors. Runs in your browser.
Binary to Decimal
Convert binary to decimal online. Paste any binary number, with or without spaces, and get the exact base-10 value instantly. Runs in your browser.
Binary to Hex
Convert binary to hexadecimal online. Paste a binary number and get exact hex, with optional uppercase. Handles huge values. Runs in your browser.
Celsius to Fahrenheit
Convert Celsius to Fahrenheit instantly. Type a temperature in C and get F, with the formula and a quick reference table. Runs in your browser.