Skip to main content
Back to Tools
Web Tools

JSON to SQL DDL

Convert JSON data to SQL CREATE TABLE statements. Supports PostgreSQL, MySQL, and SQLite dialects with automatic type inference, primary keys, nullable columns, and camelCase to snake_case conversion. Runs entirely in your browser — your data never leaves your machine.

json sql ddl create-table converter database postgresql mysql sqlite

Published May 29, 2026

All interactive tools run entirely in your browser. Your data never leaves your device.

How It Works

Paste a JSON object or array of objects and instantly generate SQL CREATE TABLE statements. The tool infers column types from values (VARCHAR, INTEGER, BOOLEAN, TIMESTAMP, etc.) and supports PostgreSQL, MySQL, and SQLite dialects. Arrays of objects in nested properties generate separate tables.

Features

  • 3 SQL dialects: PostgreSQL, MySQL, SQLite with dialect-specific types and quoting
  • Automatic type inference: VARCHAR, INTEGER, BIGINT, DOUBLE, BOOLEAN, TIMESTAMP, DATE, TEXT, JSONB/JSON
  • camelCase to snake_case: automatically converts property names
  • Auto primary key: optional auto-incrementing ID column (SERIAL, AUTO_INCREMENT, AUTOINCREMENT)
  • Nullable columns: detects missing/null keys across array rows
  • IF NOT EXISTS: optional safety clause
  • Nested objects: stored as JSONB/JSON columns
  • Nested arrays of objects: generate separate tables
  • 5 examples: simple object, array of records, user profile, e-commerce, nested data
  • Private: runs entirely in the browser — no data transmitted

Use Cases

  • Quickly scaffolding database schemas from JSON API responses
  • Prototyping table structures from sample data
  • Converting JSON fixtures to SQL migration scripts
  • Learning SQL DDL syntax across different databases