INSERT INTO "my_table" ("id", "name", "active") VALUES (1, 'Ada', TRUE);
INSERT INTO "my_table" ("id", "name", "active") VALUES (2, 'Linus', FALSE);About JSON to SQL — INSERT & CREATE TABLE Generator
This free JSON to SQL converter turns a JSON array of objects into ready-to-run SQL INSERT statements, with an optional CREATE TABLE whose column types are inferred from your data. It's built for developers seeding a database, fixing up a migration, or moving a quick API response into a real table without hand-writing every row.
The generator handles the fiddly parts for you: strings are wrapped in single quotes with embedded quotes safely doubled, null becomes NULL, and numbers and booleans are emitted bare so the database stores them with the right type. Missing keys across rows are filled with NULL so every statement shares one consistent column list.
Everything runs entirely in your browser. Your JSON is never uploaded, which makes this safe to use even for production data and internal schemas.
Features
- JSON array of objects to one INSERT per row with a shared column list
- Optional CREATE TABLE with column types inferred from your data
- Proper SQL escaping: single-quote doubling, NULL, bare numbers and booleans
- Pick a table name and SQL dialect; works completely offline
How to use
- Paste a JSON array of objects into the input pane.
- Enter the target table name in the toolbar.
- Toggle CREATE TABLE on if you also want the schema inferred.
- Copy the generated SQL from the output pane.
Frequently asked questions
What JSON shape does it expect?
A top-level JSON array whose elements are flat objects, for example [{"id":1,"name":"Ada"}]. The union of all keys becomes the column list, and any object missing a key gets NULL for that column.
How are string values escaped?
Strings are wrapped in single quotes and any embedded single quote is doubled (O'Brien becomes 'O''Brien'), which is the standard ANSI SQL way to escape literals. This prevents broken statements and keeps the output safe to paste.
How does CREATE TABLE infer types?
Each column is scanned across every row: all-integer columns become INTEGER, columns with any decimal become REAL, true/false becomes BOOLEAN, and anything else (including mixed or nested values) becomes TEXT. Nested objects and arrays are serialized to JSON text.
Which SQL dialects are supported?
Pick a dialect from the toolbar and the generated INSERT and CREATE TABLE statements follow its conventions (such as identifier quoting and inferred column types). Switch dialects to match the database you are seeding before copying the output.
Is my data sent to a server?
No. The conversion runs locally in your browser using a hand-written generator. Your JSON never leaves your device, so it is safe to use with private or production data.
Related tools
Everything runs locally in your browser — your input is never uploaded.