JSON → SQL INSERT
Pastes a JSON array (or a single object) and emits a ready-to-run SQL insert. Columns are the union of all keys; rows missing a column get NULL. Strings are single-quote escaped, numbers and booleans become literals, nested objects / arrays get serialized to JSON. Optional `ON CONFLICT` (Postgres / SQLite) or `ON DUPLICATE KEY UPDATE` (MySQL) so you can drop the output straight into a sync job.
INSERT INTO "users" ("id", "name", "email", "verified", "joined")
VALUES
(1, 'Alice', 'alice@example.com', TRUE, '2024-01-15'),
(2, 'Bob', 'bob@example.com', FALSE, '2024-03-22'),
(3, 'Carol', NULL, TRUE, '2024-06-01');Strings are escaped by doubling single quotes — safe for all four dialects.
How to use
- Paste a JSON array of objects (or a single object).
- Set the table name and SQL dialect.
- Toggle multi-row VALUES for a single statement, or off for one INSERT per row. Toggle upsert if you want ON CONFLICT / ON DUPLICATE KEY UPDATE.
Frequently asked questions
- How are nested objects handled?
- Serialized to JSON and inserted as a quoted string. PostgreSQL and MySQL columns of type `JSON` / `JSONB` accept these directly; for SQLite they go in as TEXT.
- What's the difference between multi-row and one INSERT per row?
- Multi-row produces a single `INSERT INTO ... VALUES (…), (…), (…);` which runs much faster on bulk loads. Per-row produces N statements — handier when you want to comment out individual rows or expect failures to be partial.
Related tools
Mock Data Generator
Generate realistic fake records for testing — names, emails, dates, IDs, lorem — exported as JSON, CSV, or SQL INSERTs.
CSV → SQL INSERT Generator
Convert CSV / TSV rows into SQL INSERT statements with table name, dialect quoting, type inference, and multi-row mode.
String Escape Converter
Escape a string for 10 contexts at once — JavaScript, JSON, HTML entities, URL, SQL, regex, Bash (single/double quote), C string, Unicode \u escapes. Copy whichever you need.
JSON ↔ YAML Converter
Convert JSON to YAML or YAML to JSON — pick the indent and copy the result.
CSV → HTML / Markdown / JSON Table
Convert CSV to an HTML `<table>`, a Markdown table, or a JSON array of objects — auto-detects the delimiter.
INI ↔ JSON Converter
Round-trip between INI-style config files and JSON — supports sections, dotted nesting, comments, and value type inference.