JSON to SQL INSERT
Turn JSON objects into batched INSERT statements. Merge columns, choose missing/null handling and preserve exact numeric digits with local MySQL, PostgreSQL or SQLite output.
Local INSERT builder for three dialects
Paste a JSON array of objects and generate MySQL, PostgreSQL or SQLite INSERT statements. Choose the table and optional schema, rows per batch, missing-column policy (NULL, empty string or reject), explicit null handling, exact numeric literals or quoted numeric text, and reject nested values or serialize them as JSON text. Columns merge in first-seen order; all batches use the same quoted identifiers.
Original sample and SQLite output
[
{"id": 1, "name": "O'Brien", "note": "C:\\drafts", "enabled": true},
{"id": 2, "name": "林", "amount": 12.50, "note": null},
{"id": 9007199254740993, "name": "A; DROP TABLE contacts; --", "enabled": false}
]-- sqlite; 3 rows; 5 columns; 1 batches.
-- Existing table required. Missing=null; null=null; numbers=literal; nested=reject.
INSERT INTO "contacts" ("id", "name", "note", "enabled", "amount") VALUES
(1, 'O''Brien', 'C:\drafts', 1, NULL),
(2, '林', NULL, NULL, 12.50),
(9007199254740993, 'A; DROP TABLE contacts; --', NULL, 0, NULL);
Sample data is original CC0. Large numeric tokens retain source digits without floating-point rounding. Strings stay text, and apostrophes are doubled.
Escaping, limits and destination types
PostgreSQL uses E strings with escaped backslashes; SQLite keeps backslashes literal. MySQL requires your selected backslash SQL mode and a UTF-8 connection; the output does not change server mode. NUL and unpaired Unicode surrogates are rejected. Table and schema are separately quoted; dots inside their fields are literal name characters.
Input limit 500,000 characters; 10,000 objects, 256 columns, 100,000 expanded cells, 32 nesting levels and 4,000,000 output characters. Identifier limit 63 UTF-8 bytes. Cancel stops the local worker; editing input or options discards stale output. No upload, storage, database connection or SQL execution occurs. The target table must exist. Review destination types, precision, encoding and constraints; this converter does not create schemas, infer dates or guarantee your table accepts the values.
Syntax references reviewed October 18, 2026: MySQL 8.4 strings and SQL modes · MySQL quoted identifiers · PostgreSQL lexical rules · SQLite literals.