JSON to SQL INSERT Converter
Convert a JSON array of objects to SQL INSERT statements with an optional CREATE TABLE for MySQL, PostgreSQL, SQLite, SQL Server or Oracle. Nested values too.
Keys that are missing from an object are inserted as NULL.
| Column | Type | Values seen | NULL / missing |
|---|---|---|---|
| id | INTEGER | whole numbers | 0 |
| name | VARCHAR(12) | text | 0 |
| active | BOOLEAN | true/false | 0 |
| balance | NUMERIC(6,2) | decimals | 1 |
| joined | DATE | dates | 0 |
| tags | JSONB | JSON | 1 |
| address | JSONB | JSON | 1 |
API responses, exports and fixtures often arrive as JSON, but the database wants SQL. Paste an array of objects and get INSERT statements — batched into multi-row statements — plus an optional CREATE TABLE whose column types are inferred from the values: integers, decimals with the right precision, booleans, dates, text and JSON. Objects that lack a key get NULL; nested objects and arrays are stored as JSON or flattened into dot-named columns. Identifiers, strings and booleans are written correctly for MySQL, PostgreSQL, SQLite, SQL Server or Oracle.
How to use this tool
- Paste a JSON array of objects (one object or {"data": […]} also works).
- Enter the table name and choose the database.
- Choose whether nested objects become JSON columns or flattened columns.
- Optionally include CREATE TABLE or DROP TABLE, or name a key for upserts.
- Copy the SQL.
Formula
columns = every key in any object (first-seen order) · one VALUES tuple per object · missing key → NULL
Types follow the values: whole numbers → INTEGER (BIGINT beyond ±2,147,483,647), other numbers → DECIMAL(p,s) from their digits, true/false → BOOLEAN (BIT, NUMBER(1) or 1/0 where there is no boolean type), ISO date strings → DATE or TIMESTAMP when every value is a valid date, other strings → VARCHAR(longest) or TEXT, objects and arrays → JSON, JSONB, NVARCHAR(MAX) or CLOB. A column whose values mix kinds becomes text. Strings double their single quotes, and MySQL also doubles backslashes.
Example
The sample three customers become CREATE TABLE "customers" with id INTEGER, name VARCHAR(12), active BOOLEAN, balance NUMERIC(6,2), joined DATE, tags JSONB and address JSONB, then one INSERT with three rows. O'Brien is written 'O''Brien', Lin's missing tags and address and null balance become NULL, and Ada's address is stored as '{"city":"London"}'.
Frequently asked questions
What if objects have different keys?
Every key that appears anywhere becomes a column, in the order first seen. Objects without that key get NULL.
Flatten or JSON column?
Flatten when the nested fields are things you will filter or join on (address.city); keep JSON when the structure varies or you only need to store it. Arrays are always stored as JSON.
Are big numbers safe?
Integers up to 9,007,199,254,740,991 are exact. Larger IDs lose digits in any JavaScript-based tool, so quote them in the JSON to keep them as text.
Is my data uploaded?
No. The SQL is generated in your browser.
Sources
Last updated:
Page address with these inputs: https://kakao.mobile/tools/json-to-sql-insert-tool/
Cite or embed this tool
kakaoCalc. (2026, November 8). JSON to SQL INSERT Converter. https://kakao.mobile/tools/json-to-sql-insert-tool/
“JSON to SQL INSERT Converter.” kakaoCalc, 8 Nov. 2026, kakao.mobile/tools/json-to-sql-insert-tool/.
Paste this code into your page. The widget runs in your visitors' browsers, shows no ads and keeps a link back to this page. Embedding terms