JSON to SQL INSERT Generator

Turn a JSON array of objects into SQL INSERT statements.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

Convert JSON to SQL INSERT statements

Need to load a JSON export into a database? This tool turns a JSON array of objects into one SQL INSERT statement per row, ready to paste into psql, the MySQL client or SQL Server, with the escaping and identifier quoting handled for you.

How it works

The generator collects the column list from the union of all object keys, so a key missing from some rows still gets a column. For each object it emits one INSERT INTO table (cols) VALUES (...) line, choosing literals by type:

JSON valueSQL literal
string'text' (single quotes doubled)
numberunquoted, e.g. 42
booleanTRUE / FALSE
null or missing keyNULL

Picking a dialect changes how identifiers are quoted when quoting is enabled: PostgreSQL and SQL Server style differ from MySQL.

DialectIdentifier quoting
PostgreSQL"name"
MySQL`name`
SQL Server[name]

Example

This JSON:

[ { "id": 1, "name": "O'Hara", "active": true } ]

with table users generates:

INSERT INTO users (id, name, active) VALUES (1, 'O''Hara', TRUE);

The apostrophe in O'Hara was escaped by doubling it, the number stays unquoted, and the boolean became TRUE.

Everything runs locally in your browser — nothing is uploaded, which makes it safe for confidential data and exports.

Ad placeholder (rectangle)