How to use JSON to SQL Inserts
Turn JSON records into a basic SQL script with column names and row inserts. Use it to prepare data for a database you control.
- Select or paste the record array, set SQL table name and convert.
- Inspect columns and literal types before executing the result anywhere.
- Select Convert and review the result.
Example input
[{"sku":"00104","item":"Notebook"},{"sku":"00105","item":"Pencil"}]Example use
Create a small reference table from a JSON fixture in a local database, then add constraints that match the destination schema.
Output and compatibility
Top-level record keys define columns. Nested objects and arrays are serialized as JSON text. Numbers and booleans use SQL literals, while text is quoted. Complex data types and dialect rules require editing.
Troubleshooting
If your source is wrapped in a top-level envelope, paste the list of records. Check column definitions against the intended database dialect before importing.
Use SQL to JSON to inspect the records from a compatible local SQLite script.
Frequently asked questions
Can it create a primary key from an ID?
The generated script is basic. Add any primary key or indexes required by your schema.
Does this run SQL against a remote database?
It creates text in your browser for you to review.