Type inference
INTEGER/BIGINT, DOUBLE, BOOLEAN, DATE, TIMESTAMP, VARCHAR(n) or TEXT are chosen from the values in each column.
Infer a table definition with column types and constraints from example JSON records.
Generate a CREATE TABLE statement from sample JSON. Column types, NOT NULL and the primary key are detected for MySQL, PostgreSQL, SQLite and SQL Server.
[{"id":1,"name":"Aarav","joined":"2026-01-19","score":9.5},{"id":2,"name":"Sara","joined":"2026-02-07","score":null}]CREATE TABLE IF NOT EXISTS "members" (
"id" INTEGER PRIMARY KEY,
"name" VARCHAR(50) NOT NULL,
"joined" DATE NOT NULL,
"score" DOUBLE PRECISION
);Tip: Use JSON to SQL afterwards with the same table name to generate the matching INSERT statements.
INTEGER/BIGINT, DOUBLE, BOOLEAN, DATE, TIMESTAMP, VARCHAR(n) or TEXT are chosen from the values in each column.
Columns with a value in every record get NOT NULL; an integer id column with unique values becomes the PRIMARY KEY.
Nested objects and arrays map to JSON (MySQL), JSONB (PostgreSQL) or text columns.
The same data produces DATETIME2 and NVARCHAR on SQL Server, TIMESTAMP and JSONB on PostgreSQL.
Several. With more examples the types and NOT NULL constraints are more accurate, because a single record cannot show which fields are optional.
From the longest value seen, rounded up to 50, 100 or 255; longer text becomes TEXT (NVARCHAR(MAX) on SQL Server).
Yes, untick "id as PRIMARY KEY".
Treat it as a strong first draft. Add indexes, foreign keys and exact lengths based on what you know about the data.