JSON → SQL INSERT Generator

Paste a JSON object or an array of rows and get ready-to-run SQL INSERT statements — choose the dialect, literal or placeholder values, batch or per-row, optional CREATE TABLE. Runs entirely in your browser, no upload, no sign-up.

Try:
SQL

JSON to SQL INSERT generator

Paste a JSON object or an array of row objects and get SQL INSERT statements you can run against your database. Everything happens locally in WebAssembly — your data is never uploaded, so it's safe for real records.

How it works

Example

Input (Postgres, with CREATE TABLE and id as the primary key):

[{"id": 1, "email": "[email protected]", "active": true},
 {"id": 2, "email": "[email protected]", "active": false}]

Output:

CREATE TABLE "accounts" (
  "id" INTEGER,
  "email" TEXT,
  "active" BOOLEAN,
  PRIMARY KEY ("id")
);
INSERT INTO "accounts" ("id", "email", "active") VALUES
(1, '[email protected]', TRUE),
(2, '[email protected]', FALSE);

Limits & edge cases

FAQ

Is my data uploaded anywhere?

No. The generator is compiled to WebAssembly and runs entirely in your browser tab — the JSON never leaves your device.

How are strings and quotes escaped?

A single quote is doubled (O'Brien'O''Brien') for every dialect, which is the SQL-standard escape. For MySQL, a backslash is also doubled because MySQL treats \ as an escape character by default. Choose the matching dialect so the escaping fits your database.

What does placeholder / prepared-statement mode produce?

It replaces each value with a positional placeholder — ? for MySQL and SQLite, @p1, @p2… for SQL Server, and $1, $2… for PostgreSQL — and appends the bound values in order as a -- params: comment, so you can copy the statement and the parameters separately into your client library.

What happens when rows have different keys?

The column list is the union of all keys across the rows, in first-seen order. A row that's missing a column has that cell filled according to your Nulls setting (NULL by default), so every row still fits one shared column list and can be batched into a single INSERT.

Can it generate CREATE TABLE or UPDATE statements?

It can generate a CREATE TABLE (with inferred column types, an optional primary key, and an optional DROP TABLE IF EXISTS) alongside the inserts. It focuses on INSERT; UPDATE statements and schema normalization of nested JSON are out of scope.

Developer & Automation Access

Run it from the terminal

Same engine as this page, headless — via the gizza CLI:

gizza tool json-to-sql-insert '[{"id": 1, "name": "Alice"}, {"id": 2, "name": "Bob"}]'

New to the CLI? Get gizza →

Open it by URL

Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:

https://gizza.ai/tools/json-to-sql-insert/?json=%5B%7B%22id%22%3A%201%2C%20%22name%22%3A%20%22Alice%22%7D%2C%20%7B%22id%22%3A%202%2C%20%22name%22%3A%20%22Bob%22%7D%5D&table=users&dialect=mysql&values=literal&multi_row=true&create_table=true&drop_table=true&primary_key=id&quote_identifiers=true&null_handling=null&sort_columns=true

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.