Skip to content
TabKiwiTabKiwi

JSON to SQL

Convert an array of JSON objects into INSERT statements, with nested values stored as JSON text.

DeveloperRuns in your browser. Your files never leave this device.
Loading tool…

About this tool

Paste an API response or a fixtures file and get INSERT statements with one column per key. Keys that appear only in some objects still get a column, filled with NULL where missing, and nested objects or arrays are written as JSON strings so they fit a JSON or JSONB column. A wrapper object such as {"data": [...]} is unwrapped automatically. Conversion runs locally.

How to use JSON to SQL

  1. Paste a JSON array of objects.
  2. Set the table name and database.
  3. Optionally add CREATE TABLE or a transaction wrapper.
  4. Copy or download the generated SQL.

Frequently asked questions

How are booleans written?

PostgreSQL and MySQL get TRUE and FALSE. SQLite and SQL Server get 1 and 0, since they store booleans as integers or BIT.

What if my JSON has a top-level object?

If it contains exactly one array, that array is used. Otherwise the object is treated as a single row.

More Developer tools

View all 91 →