JSON to SQL Schema — Generate CREATE TABLE DDL from JSON
Free JSON to SQL converter: paste a JSON object or array and instantly generate CREATE TABLE DDL with inferred column types for PostgreSQL, MySQL or SQLite. Runs entirely in your browser.
For developers and data engineers turning JSON payloads into tables.
-- Generated from 8 column(s). Inferred types — review before production use.
CREATE TABLE "users" (
"id" INTEGER PRIMARY KEY,
"email" VARCHAR(32) NOT NULL,
"full_name" VARCHAR(32) NOT NULL,
"is_active" BOOLEAN NOT NULL,
"credit_balance" NUMERIC NOT NULL,
"signup_date" DATE NOT NULL,
"last_seen_at" TIMESTAMP NOT NULL,
"preferences" JSONB
);8 columns · 2 record(s) sampled
Runs entirely in your browser — your JSON never leaves the page
Inferred DDL is a starting point — production schemas need more.
Real pipelines need constraints, indexes, partitioning, idempotent loads and migrations. That is the everyday work in my data-engineering case studies — from messy source JSON to analytics-ready warehouses.
How to convert JSON to a SQL table
Paste a JSON object or an array of objects and this JSON to SQL converterreads every key, samples the values, and infers each column's type and nullability — then emits a ready-to-run CREATE TABLE statement. It supports PostgreSQL, MySQL and SQLite, mapping types to each dialect (for example nested objects become JSONB in Postgres, JSON in MySQL and TEXT in SQLite).
How column types are inferred
true/false→BOOLEAN- whole numbers →
INTEGER(orBIGINTwhen large) - decimals →
NUMERIC/DECIMAL - ISO dates and timestamps →
DATE/TIMESTAMP - UUID strings →
UUID(Postgres) orCHAR(36) - nested objects & arrays → JSON column
- everything else →
VARCHAR/TEXT
When you pass an array, every record is sampled together: a column is marked NOT NULL only if it is present and non-null in all of them, and an id column is promoted to PRIMARY KEY when its type allows. Parsing runs entirely in your browser, so the tool is safe for internal or sensitive payloads — nothing is uploaded.
From inferred schema to production pipeline
Generated DDL is a fast starting point, but production tables need constraints, indexes, partitioning, idempotent loads and migrations. That is the day-to-day of the work in my data engineering case studies — turning messy source data into analytics-ready warehouses. Need it built properly? Let's scope it.
Frequently asked questions
How do I convert JSON to a SQL table?
Paste a JSON object or an array of objects and the tool reads every key, infers each column’s type (integer, numeric, boolean, timestamp, text or JSON) and nullability from the values, and emits a ready-to-run CREATE TABLE statement for your chosen database.
Which databases are supported?
PostgreSQL, MySQL and SQLite. Type mapping follows each dialect — for example nested objects and arrays become JSONB in PostgreSQL, JSON in MySQL and TEXT in SQLite.
Is my data sent to a server?
No. Parsing and DDL generation run entirely in your browser. Your JSON never leaves the page, so it is safe to use on internal or sensitive payloads.
How are column types inferred?
From the actual values: booleans map to BOOLEAN, whole numbers to INTEGER/BIGINT, decimals to NUMERIC, ISO date strings to DATE/TIMESTAMP, nested objects and arrays to JSON, and everything else to TEXT/VARCHAR. A column is marked NOT NULL only when it is present and non-null across every sampled record.