JSON arrays vs objects
A single object becomes one SQL row. An array of objects becomes multiple rows, with columns inferred from the union of object keys.
Paste JSON and generate clean SQL INSERT statements locally for seed data, imports, scripts, and database testing.
Paste JSON or load a sample to begin.
Convert one JSON object or an array of objects into SQL INSERT text without uploading data.
Generated SQL text only. Review it carefully before running it in a database.
Paste JSON on the left, set the table name and dialect, then generate SQL text.
JSON to SQL guide
This converter turns JSON objects and arrays into SQL text for seed data, local imports, examples, and database tests. It generates statements only and never connects to a database.
A single object becomes one SQL row. An array of objects becomes multiple rows, with columns inferred from the union of object keys.
Original JSON key names are preserved by default. Enable identifier quoting when keys include spaces, hyphens, reserved words, or mixed casing.
Nested objects and arrays are kept as JSON strings by default. Flatten mode expands nested object keys with underscores when that is more practical.
Boolean literals and identifier quoting vary by dialect. PostgreSQL, MySQL, SQL Server, SQLite, and generic SQL each have different conventions.
Strings are wrapped in single quotes and embedded single quotes are doubled. Numbers, booleans, and NULL values are emitted as SQL literals.
The optional CREATE TABLE statement infers basic types only. Review the schema for primary keys, indexes, constraints, lengths, and database-specific types.
No. It only generates SQL text locally in your browser. It does not connect to a database or validate statements against a live schema.
Date-looking JSON strings stay quoted as strings by default. Convert them to database-native date types manually if your schema requires it.
The converter uses the union of keys across every object. Missing values in a row become NULL for that generated column.
Use it for SQL scripts, seed data, and reviewed imports. For very large production imports, database-native bulk load tools are usually better.