jsontoolskit.org
JSON and JSON Schema utilities, in the browser
Say hi →

JSON to SQL INSERT

array of objects → INSERT statements · Postgres / MySQL / SQLite · updated 28 July 2026

Paste a JSON array and get ready-to-run INSERT statements. Column names are derived from the keys, values are escaped for the dialect you pick, and nested objects either flatten into dotted columns or stay as one JSON column. Nothing leaves your browser.

Paste input to start.

How to convert JSON to SQL INSERT statements

  1. Paste a JSON array of objects, or drop a .json file onto the input pane.
  2. Pick your Dialect — it decides identifier quoting ("col" vs `col`) and how booleans are written.
  3. Set the Table name and choose how column names are cased. snake_case turns userName into user_name.
  4. Raise Rows per statement to batch many rows into one multi-VALUES insert — far faster than one statement per row.
  5. Tick Add upsert clause if the rows may already exist. Postgres and SQLite get ON CONFLICT … DO UPDATE; MySQL gets ON DUPLICATE KEY UPDATE.
  6. Copy the SQL, or download it as a .sql file you can pipe into psql / mysql / sqlite3.

How values are escaped

Getting the table first

You need a table before you can insert into it. JSON → CREATE TABLE reads the same input and infers column types from the actual values — integers, doubles, booleans, timestamps, and jsonb for nested data. Run that first, then come back here for the rows.

Privacy

Nothing is uploaded. The conversion runs in this tab using your own browser's JavaScript engine — no server sees your data, and the page keeps working with the network disconnected.

FAQ

Why is my array column a single JSON string?

Because that is almost always what you want in a relational table. Set Arrays to Comma-joined for a plain text list, or One column per index if you genuinely want tags_0, tags_1 columns — though that makes the column set depend on the longest array in your data.

Can it handle a JSON object instead of an array?

Yes — a single object becomes a single-row insert. An object wrapping exactly one array (the common {"items": […]} API envelope) is unwrapped automatically.

Are the statements safe to run against production?

Read them first. The tool escapes string literals correctly, but it cannot know about your constraints, triggers, or column types. Run inside a transaction so you can roll back.

Does it work offline?

Yes. Everything is plain JavaScript in this page — no library downloads, no network calls.