How to use the JSON to SQL Converter
- Paste a JSON object or an array of objects.
- Choose the table name and database.
- Copy or download the SQL.
What does this tool do?
Each object becomes a row and each key a column. Column types are inferred from the values: integers, decimals, booleans, dates, timestamps, text, and JSON for nested objects.
Values are escaped (single quotes doubled), identifiers are quoted the way each database expects, and inserts are batched in groups of 100 rows. Everything runs in your browser; nothing you paste is uploaded.
Why use it?
- Four SQL dialects.
- Type inference.
- Safe escaping.
Use cases
- Import API data into a database.
- Seed development databases from fixtures.
- Move data between tools that speak JSON and SQL.
JSON in, SQL out
[{ "id": 1, "name": "O'Brien", "active": true }]
gives a CREATE TABLE with an integer id, text name and boolean active, then INSERT … VALUES (1, 'O''Brien', TRUE) — the apostrophe is escaped by doubling it.
Common mistakes
- Running generated SQL on production without reviewing it.
- Accepting inferred types without checking, such as IDs that should be text.
- Choosing the wrong database dialect, which changes quoting and types.
Accuracy and limits
- Always review inferred types — for example, IDs with leading zeros should stay as text.
Privacy
The calculation happens instantly in your browser. The numbers you enter are not sent to our servers or saved. There's no account to create and nothing to install.
Frequently asked questions
How are nested objects stored?
As JSON columns.
Why batches of 100?
Big single inserts can hit database limits; batches are safer and faster.
Which databases are supported?
PostgreSQL, MySQL, SQLite and SQL Server.
Content last updated . See how M2Toolkit works.