About the JSON → SQL playground

JSON → SQL turns a JSON array of objects into ready-to-run SQL INSERT statements. Each object becomes one row, object keys become column names, and values are mapped to SQL literals — strings quoted, numbers left bare, booleans and null handled appropriately. It's ideal for seeding a database from an API response, a config dump, or scraped data without hand-writing tedious INSERT syntax.

JSON (JavaScript Object Notation) is a lightweight, language-independent data format built from objects, arrays, strings, numbers, booleans, and null. SQL (Structured Query Language) is the standard language for relational databases, and the INSERT statement adds rows to a table. This converter bridges the two so a flat JSON dataset becomes portable, replayable SQL you can run against MySQL, PostgreSQL, SQLite, or SQL Server.

HostedJSON → SQL runtime
mainentry file
single fileworkspace
stdinprogram input

How it works

1

Write

The main file is the entry point for each run.

2

Give it input

Use the Input panel to pipe standard input to your program when it needs data.

3

Run

Run sends your code to a fresh hosted runtime and streams the result into the output panel.

4

Keep or share

Your draft stays in this browser, and Share creates a separate snapshot link.

External resources

  • json.org— Format reference

Input (JSON)

[
  { "id": 1, "name": "Ada", "active": true },
  { "id": 2, "name": "Linus", "active": false }
]

Output (SQL)

INSERT INTO users (id, name, active) VALUES (1, 'Ada', true);
INSERT INTO users (id, name, active) VALUES (2, 'Linus', false);

Input (JSON with null)

[
  { "sku": "A100", "price": 9.99, "note": null }
]

Output (SQL)

INSERT INTO products (sku, price, note) VALUES ('A100', 9.99, NULL);

Input (JSON with quote in string)

[
  { "id": 3, "name": "O'Brien" }
]

Output (SQL, escaped quote)

INSERT INTO users (id, name) VALUES (3, 'O''Brien');

Input (JSON, multiple rows)

[
  { "id": 1, "city": "Paris" },
  { "id": 2, "city": "Berlin" }
]

Output (SQL, multi-row)

INSERT INTO places (id, city) VALUES (1, 'Paris'), (2, 'Berlin');

Input (JSON, mixed types)

[
  { "id": 10, "rate": 0.5, "label": "x", "ok": true }
]

Output (SQL)

INSERT INTO items (id, rate, label, ok) VALUES (10, 0.5, 'x', true);

Input (JSON, empty string)

[
  { "id": 4, "name": "", "score": 0 }
]

Output (SQL)

INSERT INTO users (id, name, score) VALUES (4, '', 0);

Input (JSON, single object)

[
  { "id": 5, "email": "[email protected]", "verified": false }
]

Output (SQL)

INSERT INTO users (id, email, verified) VALUES (5, '[email protected]', false);

How it works

The editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.

What it does

Paste a JSON array of objects and get ready-to-run SQL INSERT statements.

Each object becomes one row; object keys become column names.

One INSERT is produced per record from the array.

Value and table handling

Strings are quoted, numbers left bare, booleans and null mapped to SQL literals.

Set a target table name so the INSERTs reference the right table.

Output is portable across MySQL, PostgreSQL, SQLite, and SQL Server.

When to use it

Seeding a database from an API response, config dump, or scraped data.

Generating replayable INSERTs without hand-writing the syntax.

Privacy

INSERT generation runs in your browser — your data never hits a server.

Safe for datasets containing private records.

Every shortcut, searchable:

Editing

Undo
Ctrl+Z
Redo
Ctrl+⇧+Z
Select next occurrence
Ctrl+D
Delete line
Ctrl+⇧+K
Move line up / down
Alt+↑ / ↓
Copy line up / down
Alt+⇧+↑ / ↓
Toggle comment
Ctrl+/
Indent line
Ctrl+]
Outdent line
Ctrl+[

Navigation

Find
Ctrl+F
Find & replace
Ctrl+H
Go to line
Ctrl+G
Go to symbol
Ctrl+⇧+O

Selection

Select all
Ctrl+A
Select line
Ctrl+L
Select all occurrences
Ctrl+⇧+L
Shortcuts follow your OS — ⌘ becomes Ctrl on Windows and Linux.
It reads a JSON array of objects and generates one SQL INSERT statement per object, using the keys as column names and quoting values according to their type.
No. The conversion runs entirely in your browser using JavaScript. Your JSON never leaves your device and nothing is sent to a server.
Yes, completely free with no sign-up, account, or usage limits.
Use the table name field (or edit the generated output). The same column order from your first object is applied to every INSERT statement.
Single quotes in string values are escaped by doubling them (' becomes ''), which is the standard SQL way to keep the statement valid.
json
sql

Output

SQL INSERT statements

>_compilebytes

A fast place to write code and run it in isolated hosted runtimes. Free, forever.

Playgrounds

Python compilerC compilerJavaScript compilerC++ compilerTypeScript compilerGo compilerJava compilerRust compiler
All playgrounds →

Tools

JSON formatterRegex testerBase64 encoderJWT decoder
JSON formatterBase64 encoder & decoderRegex testerJWT decoder
All tools →

Company

TermsPrivacy[email protected]
© 2026 compilebytes115 runtimes · no signup115 runtimes · isolated sandboxes · no signup