Paste a JSON object or array and get ready-to-run SQL — INSERT statements with column types inferred from your data, plus an optional CREATE TABLE. Pick MySQL, PostgreSQL, or SQLite and the identifiers and value formatting adjust to match.
The converter accepts either a single JSON object (one row) or an array of objects (one row per element). Every unique key across all objects becomes a column, in the order it first appears.
Input JSON:
[
{ "id": 1, "name": "Alice", "active": true },
{ "id": 2, "name": "Bob", "active": false }
]
Generated SQL (MySQL):
CREATE TABLE IF NOT EXISTS `my_table` (
`id` INT,
`name` VARCHAR(255),
`active` TINYINT(1)
);
INSERT INTO `my_table` (`id`, `name`, `active`) VALUES (1, 'Alice', TRUE);
INSERT INTO `my_table` (`id`, `name`, `active`) VALUES (2, 'Bob', FALSE);
Missing keys and null values become SQL NULL. Nested objects and arrays are stored as escaped JSON strings, since plain SQL columns can't hold structured values directly.
Switching the dialect changes identifier quoting, boolean literals, and inferred column types:
column), booleans as TRUE/FALSE, floats as DECIMAL(10,2)"column"), a native BOOLEAN type, floats as NUMERIC(10,2)0/1 (SQLite has no boolean type), floats as REALColumn type inference looks at every value in a column across all rows: all-integer columns become INTEGER/INT, columns with any decimal become the dialect's numeric type, all-boolean columns get a boolean type, and strings longer than 255 characters become TEXT instead of VARCHAR(255).
The CREATE TABLE toggle prepends a CREATE TABLE IF NOT EXISTS statement with inferred column types — useful when loading into an empty database, or turn it off if the table already exists.
The Batch INSERT toggle switches between one INSERT statement per row (easier to read and to run partially) and a single INSERT ... VALUES statement with one tuple per row (fewer statements, faster to execute in bulk). Both produce identical data.
The table name field sanitizes automatically — spaces and symbols become underscores, and a name starting with a digit gets a leading underscore, so the output is always a valid identifier.
Yes. A single object is treated as one row and produces one INSERT statement. An array of objects produces one row per element.
The tool looks at every value in a column across all rows. All-integer columns become INTEGER/INT, any decimal value makes it a numeric type, all-boolean columns get a boolean type, and long strings (over 255 characters) become TEXT instead of VARCHAR(255).
They're serialized to a JSON string and inserted as a quoted text value, since standard SQL columns don't hold structured data. PostgreSQL users can manually change the column type to JSONB afterward if needed.
A key that's missing from a row, or explicitly null, is inserted as SQL NULL.
No — invalid characters are automatically replaced with underscores, and a name starting with a digit gets a leading underscore added, so the output is always a valid identifier.
No. The entire conversion runs in your browser with no network requests. Nothing is transmitted.
More Tools