Skip to content
uxTools
Data & Formats

JSON to SQL Converter

Turn a JSON array of objects into a CREATE TABLE statement with inferred column types plus INSERT statements. Supports Postgres, MySQL, and SQLite — all in your browser.

Table name
SQL dialect
Examples

JSON input

2 rows

SQL output

CREATE TABLE "users" (
  "id" INTEGER NOT NULL,
  "name" TEXT NOT NULL,
  "email" TEXT NOT NULL,
  "active" BOOLEAN NOT NULL
);

INSERT INTO "users" ("id", "name", "email", "active") VALUES (1, 'Ada Lovelace', '[email protected]', TRUE);

INSERT INTO "users" ("id", "name", "email", "active") VALUES (2, 'Alan Turing', '[email protected]', FALSE);

How it works

Each column's type is inferred from every value seen for it: whole numbers become INTEGER, decimals REAL, true/false BOOLEAN, ISO dates TIMESTAMP, and conflicting types widen to TEXT. Columns that are null or missing in any row are treated as nullable. String values are escaped safely by doubling single quotes, and identifiers are quoted per dialect (" or `).