Go to Sign up
Note: Your files never leave your device. We don't upload, transfer, or store your data.
SQL (Structured Query Language) is the standard language for managing and manipulating relational databases. Defined by ISO/IEC 9075, SQL supports data definition (CREATE TABLE, DROP TABLE), data manipulation (INSERT, UPDATE, DELETE), and data querying (SELECT).
Common SQL statement types used in data migration:
| Statement | Purpose |
|---|---|
CREATE TABLE | Define a new table with columns, data types, and constraints |
INSERT INTO | Add rows of data into an existing table |
DROP TABLE | Delete a table and all its data |
DROP TABLE IF EXISTS | Delete a table only if it already exists (safe re-runs) |
JSON (JavaScript Object Notation) is a lightweight data-interchange format defined by RFC 8259. It represents structured data as arrays and key-value objects. REST APIs, NoSQL databases, configuration files, and data export tools commonly output JSON.
| Scenario | Benefit |
|---|---|
| Data migration | Move data from NoSQL/JSON-based systems into relational databases |
| API to database | Transform API JSON responses into SQL INSERT statements |
| Database seeding | Populate development or test databases from JSON fixtures |
| Data import | Load JSON exports (from MongoDB, Firebase, etc.) into MySQL or PostgreSQL |
| ETL pipelines | Convert JSON intermediate format into SQL for warehouse loading |
| Backup restoration | Reconstruct database tables from JSON backups |
Manually writing SQL INSERT statements from JSON data is error-prone, especially with many rows, nested structures, or database-specific quoting rules. This tool automates the conversion instantly.
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` INT,
`name` VARCHAR(255),
`email` VARCHAR(255),
PRIMARY KEY (`id`)
);
INSERT INTO `users` (`id`, `name`, `email`) VALUES (1, 'Alice', '[email protected]');
INSERT INTO `users` (`id`, `name`, `email`) VALUES (2, 'Bob', '[email protected]');
Uses backtick (`) quoting for identifiers
String values wrapped in single quotes (')
Supports DROP TABLE IF EXISTS
DROP TABLE IF EXISTS "users";
CREATE TABLE "users" (
"id" INTEGER,
"name" VARCHAR(255),
"email" VARCHAR(255),
PRIMARY KEY ("id")
);
INSERT INTO "users" ("id", "name", "email") VALUES (1, 'Alice', '[email protected]');
INSERT INTO "users" ("id", "name", "email") VALUES (2, 'Bob', '[email protected]');
Uses double-quote (") quoting for identifiers
INTEGER instead of INT
Supports DROP TABLE IF EXISTS
DROP TABLE IF EXISTS "users";
CREATE TABLE "users" (
"id" INTEGER,
"name" TEXT,
"email" TEXT,
PRIMARY KEY ("id")
);
INSERT INTO "users" ("id", "name", "email") VALUES (1, 'Alice', '[email protected]');
INSERT INTO "users" ("id", "name", "email") VALUES (2, 'Bob', '[email protected]');
Uses TEXT instead of VARCHAR(255) for string columns
Compatible with PostgreSQL quoting style
Supports DROP TABLE IF EXISTS
IF OBJECT_ID('users', 'U') IS NOT NULL DROP TABLE "users";
CREATE TABLE "users" (
"id" INT,
"name" NVARCHAR(255),
"email" NVARCHAR(255),
PRIMARY KEY ("id")
);
INSERT INTO "users" ("id", "name", "email") VALUES (1, N'Alice', N'[email protected]');
INSERT INTO "users" ("id", "name", "email") VALUES (2, N'Bob', N'[email protected]');
Uses NVARCHAR for Unicode string support
String values prefixed with N for Unicode literals
IF OBJECT_ID(...) IS NOT NULL DROP TABLE instead of DROP TABLE IF EXISTS
File Upload: Drag and drop or select a .json file.
Code Editor: Paste or type raw JSON with syntax highlighting and real-time validation.
Choose the target database to generate syntax-compatible SQL:
| Database | Identifier Quote | String Type | Unicode Prefix |
|---|---|---|---|
| MySQL | Backtick ` | VARCHAR(255) | No |
| PostgreSQL | Double quote " | VARCHAR(255) | No |
| SQLite | Double quote " | TEXT | No |
| SQL Server | Double quote " | NVARCHAR(255) | N'...' |
Specify a custom table name for all generated SQL statements. Defaults to my_table if left empty.
Enter a field name to designate as the primary key. The tool adds a PRIMARY KEY (column) constraint to the CREATE TABLE statement. The specified column must exist in your JSON data.
| Option | What It Does |
|---|---|
| Create Table | Generates a CREATE TABLE statement with column names inferred from JSON keys and data types inferred from JSON values |
| Batch Insert | Combines multiple INSERT INTO statements into a single INSERT INTO ... VALUES (...), (...), (...) statement |
| Drop Table (If Exists) | Prepends a DROP TABLE IF EXISTS (or equivalent) statement before CREATE TABLE for safe re-runs |
The tool inspects JSON values and maps them to appropriate SQL data types:
| JSON Value Type | SQL Data Type |
|---|---|
| String | VARCHAR(255) / TEXT / NVARCHAR(255) |
| Integer | INT / INTEGER |
| Float | FLOAT / REAL |
| Boolean | BOOLEAN / TINYINT(1) |
null | TEXT (generic fallback) |
All processing runs entirely in your browser. No data is uploaded to any server. The tool works offline after the initial page load.
Choose one of two input methods:
Upload a file: Click "Choose File" and select a .json file, or drag it into the upload area.
Paste data: Click "Enter Data" to switch to the code editor. Paste your JSON array. The editor validates syntax in real time.
Use the Properties panel on the right:
Database Type: Select MySQL, PostgreSQL, SQLite, or SQL Server.
Table Name: Enter your target table name (e.g., users, orders, products).
Primary Key: Enter the field name to use as primary key (e.g., id).
Output Options: Check/uncheck Create Table, Batch Insert, and Drop Table as needed.
Click Convert. The generated SQL appears in the "Output Data" panel.
Click Copy to Clipboard to paste the SQL into your database client or migration script.
Premium users can click Download File to save as a .sql file.
Input JSON:
[
{"id": 1, "name": "Alice", "email": "[email protected]", "active": true},
{"id": 2, "name": "Bob", "email": "[email protected]", "active": false},
{"id": 3, "name": "Carol", "email": "[email protected]", "active": true}
]
Configuration:
Database: MySQL
Table Name: users
Primary Key: id
Options: Create Table ✓, Batch Insert ✓, Drop Table ✓
Output:
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` INT, `name` VARCHAR(255),
`email` VARCHAR(255),
`active` TINYINT(1),
PRIMARY KEY (`id`)
);
INSERT INTO `users` (`id`, `name`, `email`, `active`) VALUES
(1, 'Alice', '[email protected]', 1),
(2, 'Bob', '[email protected]', 0),
(3, 'Carol', '[email protected]', 1);
Configuration:
Database: PostgreSQL
Table Name: users
Primary Key: id
Options: Create Table ✓, Batch Insert ✗, Drop Table ✓
Output:
DROP TABLE IF EXISTS "users";
CREATE TABLE "users" (
"id" INTEGER,
"name" VARCHAR(255),
"email" VARCHAR(255),
"active" BOOLEAN,
PRIMARY KEY ("id")
);
INSERT INTO "users" ("id", "name", "email", "active") VALUES (1, 'Alice', '[email protected]', true);
INSERT INTO "users" ("id", "name", "email", "active") VALUES (2, 'Bob', '[email protected]', false);
INSERT INTO "users" ("id", "name", "email", "active") VALUES (3, 'Carol', '[email protected]', true);
Configuration:
Database: SQLite
Table Name: users
Options: Create Table ✗, Batch Insert ✓, Drop Table ✗
Output:
INSERT INTO "users" ("id", "name", "email", "active") VALUES
(1, 'Alice', '[email protected]', 1),
(2, 'Bob', '[email protected]', 0),
(3, 'Carol', '[email protected]', 1);
JSON arrays of objects (most common): [{"key": "value"}, ...]
JSON arrays of arrays: [["val1", "val2"], ...]
Nested JSON objects: Flattened to dot-notation keys automatically
| JSON Type | SQL Type |
|---|---|
| String | VARCHAR(255) |
| Integer | INT |
| Float | FLOAT |
| Boolean | TINYINT(1) |
null | TEXT |
| JSON Type | SQL Type |
|---|---|
| String | VARCHAR(255) |
| Integer | INTEGER |
| Float | REAL |
| Boolean | BOOLEAN |
null | TEXT |
| JSON Type | SQL Type |
|---|---|
| String | TEXT |
| Integer | INTEGER |
| Float | REAL |
| Boolean | INTEGER |
null | TEXT |
| JSON Type | SQL Type |
|---|---|
| String | NVARCHAR(255) |
| Integer | INT |
| Float | FLOAT |
| Boolean | BIT |
null | NVARCHAR(255) |
No. All conversion happens locally in your browser using JavaScript. Your data never leaves your device.
MySQL, PostgreSQL, SQLite, and SQL Server (T-SQL). Select the target database to generate compatible SQL syntax.
Batch Insert combines all rows into a single INSERT INTO ... VALUES (...), (...), (...) statement. Individual inserts generate one INSERT INTO statement per row. Batch inserts are faster for large datasets. Individual inserts are easier to debug and partially execute.
It infers types from the JSON values in your data. Strings become VARCHAR(255) (or TEXT for SQLite), integers become INT, floats become FLOAT, booleans become TINYINT(1) (MySQL), BOOLEAN (PostgreSQL), or BIT (SQL Server).
Yes. Enter the field name in the "Primary Key" input. The tool adds a PRIMARY KEY (column) constraint to the CREATE TABLE statement.
It prepends a DROP TABLE IF EXISTS statement (or IF OBJECT_ID(...) IS NOT NULL DROP TABLE for SQL Server) before the CREATE TABLE. This makes the SQL script safe to re-run without errors.
Yes. Select "MySQL" as the database type. The tool generates MySQL-compatible syntax with backtick quoting and MySQL-specific data types.
Yes. Select "PostgreSQL" as the database type. The tool generates PostgreSQL-compatible syntax with double-quote identifiers, INTEGER types, and BOOLEAN support.
The tool processes data entirely in your browser. Files up to 10 MB typically convert without issues on modern hardware.
Yes. The tool is responsive and works on smartphones and tablets.