Convert JSON arrays to SQL CREATE TABLE and INSERT statements.
Free online JSON to SQL converter. Paste a JSON array or object and instantly generate SQL CREATE TABLE DDL with auto-inferred column types (VARCHAR, BIGINT, BOOLEAN, TEXT) plus batched INSERT statements. Supports PostgreSQL, MySQL, SQLite, and SQL Server dialects. Options for upsert mode, null handling, and batch size. No data is ever sent to a server — runs entirely in your browser.
Keywords: json to sql, json to sql converter, json to sql online, json to insert statement, json to create table, json to sql server, json to mysql, json to postgresql, json to sqlite, convert json to sql, json array to sql, json to ddl, json to database, generate sql from json, json to sql insert, json to sql table
Tags: json, sql, converter, ddl, insert, postgresql, mysql, sqlite
Paste or type your JSON object or array into the input panel on the left.
Select your target SQL dialect from the dropdown — PostgreSQL, MySQL, SQLite, or SQL Server.
Configure options such as table name, batch insert size, and whether to generate UPSERT statements.
Click "Convert" or press ⌘↵ to generate the SQL DDL and INSERT statements.
Copy the output with ⌘⇧C or download it as a .sql file for use in your database client.
Supports four major SQL dialects: PostgreSQL, MySQL, SQLite, and SQL Server with dialect-specific syntax
Automatically infers column types from JSON values — INTEGER, BIGINT, NUMERIC, BOOLEAN, TEXT, and TIMESTAMP
Generates CREATE TABLE DDL with appropriate constraints and column definitions
Produces batched INSERT statements configurable by row count for optimal import performance
Optional UPSERT mode (INSERT … ON CONFLICT / INSERT … ON DUPLICATE KEY UPDATE) for idempotent imports
Handles nested JSON objects by flattening them into dot-separated column names
Detects JSON arrays and maps them to TEXT columns with JSON serialization
Proper NULL handling — JSON null values map to SQL NULL, respecting NOT NULL constraints
Processes arrays of objects to derive a unified schema from all rows
Runs entirely in your browser — your data is never uploaded to any server
Keyboard shortcut ⌘↵ to convert instantly, ⌘⇧C to copy output
Shareable URLs encode your input and options for easy collaboration
AI-powered explanations help you understand generated SQL and type inference decisions
The JSON to SQL Converter supports 4 SQL dialects. Select the right dialect for accurate formatting and keyword recognition.