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
- Paste a JSON array of objects.
- Set the table name and database.
- Optionally add CREATE TABLE or a transaction wrapper.
- 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.