JSON to SQL DDL Schema Generator
Convert JSON sample payloads into production-ready CREATE TABLE relational schemas for PostgreSQL, MySQL, and SQLite with automatic type inference, primary keys, and timestamps.
CREATE TABLE users (
user_id SERIAL PRIMARY KEY,
user_uuid UUID NOT NULL,
username VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL,
account_balance NUMERIC(12, 2) NOT NULL,
is_verified BOOLEAN NOT NULL,
preferences JSONB NOT NULL,
last_login_at TIMESTAMPTZ NOT NULL,
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP NOT NULL,
updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP NOT NULL
);How to use this tool
Paste a JSON object or array of objects representing your database entity.
Select PostgreSQL (UUID, TIMESTAMPTZ, JSONB), MySQL (DATETIME, AUTO_INCREMENT), or SQLite.
Copy your typed schema with automatically configured primary keys and snake_case column names.
Frequently Asked Questions
How are column types inferred from JSON values?
Whole numbers map to INTEGER or BIGINT, decimal numbers to NUMERIC/DECIMAL, booleans to BOOLEAN, ISO date strings to TIMESTAMPTZ/DATETIME, UUID strings to UUID, and nested objects/arrays to JSONB/JSON.
How is the primary key column detected?
Fields named 'id', '_id', or ending in 'Id' (e.g. userId) are automatically recognized as primary key candidates and configured with SERIAL, BIGSERIAL, or AUTO_INCREMENT.
Can I automatically convert camelCase JSON keys to snake_case?
Yes. Toggle the 'snake_case columns' option to transform properties like 'customerAddress' into idiomatic SQL column names like 'customer_address'.
Does it support adding audit timestamps?
Yes. Enabling the 'created_at / updated_at' checkbox automatically adds standard audit timestamp columns with CURRENT_TIMESTAMP defaults.
Deepen your architecture knowledge with practical, production-tested guides:
Client-Side Privacy Guarantee
This tool never transmits your payloads to any server. Open DevTools (F12) → Network tab to verify that zero HTTP requests are sent while using this page.