Convert JSON to SQL
MySQL · PostgreSQL
SQLite · SQL Server.
Generate CREATE TABLE and INSERT INTO statements from any JSON array. Types inferred automatically. Supports four SQL dialects. Runs entirely in your browser — no upload, no account.
How to convert JSON to SQL
Three steps — paste your JSON array and run the SQL directly.
Paste your JSON array
Paste a JSON array of objects — each object becomes a row in the SQL table. The converter scans all rows to infer the most accurate column types: a column that contains integers in all rows becomes INT, but if any row has a decimal it becomes FLOAT.
Choose dialect and options
Select your SQL dialect — MySQL, PostgreSQL, SQLite or SQL Server. Each uses the correct type names and quoting conventions. Set the table name, choose whether to flatten nested objects or store them as JSON columns, and pick single or batch INSERT mode.
Copy and run the SQL
Click Generate SQL and copy the output directly into your database client — MySQL Workbench, psql, DBeaver, TablePlus or any SQL editor. Download as a .sql file for version control or sharing with your team.
How JSON types map to SQL column types
The type inference rules applied across all rows in the JSON array.
| JSON type | MySQL | PostgreSQL | SQLite | SQL Server |
|---|---|---|---|---|
string |
VARCHAR(255) / TEXT | VARCHAR(255) / TEXT | TEXT | NVARCHAR(255) / NVARCHAR(MAX) |
integer |
INT | INTEGER | INTEGER | INT |
float |
FLOAT | FLOAT | REAL | FLOAT |
boolean |
TINYINT(1) | BOOLEAN | INTEGER | BIT |
null |
Column is nullable — NULL in INSERT statements | |||
object / array |
JSON | JSONB | TEXT | NVARCHAR(MAX) |
When do you need JSON to SQL?
Common workflows where JSON data needs to go into a relational database.
Seeding development databases
API responses and fixtures stored as JSON need to be loaded into a local or staging database for development. Converting to SQL INSERT statements lets you seed the database directly from the command line — no ORM setup, no migration script required.
Migrating from NoSQL to SQL
Documents from MongoDB, Firestore or DynamoDB exported as JSON need a schema and INSERT statements for migration to a relational database. Converting the JSON export to SQL is the first step — generating the CREATE TABLE from the document structure and INSERTs from the documents.
Importing API data
Third-party API responses — financial data, CRM exports, analytics feeds — arrive as JSON. Converting to SQL lets you load the data directly into your database without writing an ETL script or setting up a pipeline for a one-off import.
Prototyping database schemas
When designing a new feature, you often have a JSON structure before you have a database schema. Converting the JSON sample to SQL gives you a first-cut CREATE TABLE that you can refine — adding indexes, constraints and foreign keys — without writing the column definitions from scratch.
Related JSON tools
SQL generated in
your browser. No upload.
The entire SQL generation runs in JavaScript locally. Your JSON data is parsed and traversed entirely in your browser — it is never transmitted to any server. Close the tab and it's gone.
Type inference scans all rows before generating the CREATE TABLE — a column that has integers in most rows but a decimal in one becomes FLOAT, not INT. NULL values mark the column as nullable. The result is a schema that matches your actual data, not just the first row.
