Menu
100% Client-Side • In-Browser Execution • Privacy Guaranteed

JSON to SQL Converter Online (CREATE TABLE & INSERT Statements)

Convert JSON arrays, objects, or NDJSON to SQL CREATE TABLE and batch INSERT statements online for SQLite, MySQL, PostgreSQL, SQL Server, and Oracle.

Convert API responses, JSON exports, or newline-delimited JSON (NDJSON) into relational database tables and batched INSERT statements in seconds. Paste your JSON payload or upload a .json / .ndjson file; the tool automatically inspects all records, infers SQL data types, flattens nested object structures or preserves native JSON/JSONB columns, and generates dialect-appropriate DDL and batched DML for SQLite, MySQL, PostgreSQL, SQL Server, and Oracle. All processing runs entirely within your browser—no data is sent to SQLiz or any external server.

The JSON to SQL converter requires JavaScript to run in your browser. Please enable JavaScript to use this tool.

How JSON to SQL conversion works

Relational databases like MySQL, PostgreSQL, SQLite, and SQL Server store data in structured tables with typed columns, whereas JSON organizes data as flexible key-value trees. Converting JSON to SQL requires three steps:

  1. Schema Discovery: The converter scans all objects in the JSON payload (not just the first row) to identify the complete set of keys, accounting for sparse attributes where some records omit specific properties.
  2. Type Inference: Values are evaluated across all records to determine the narrowest compatible SQL data type:
    • BOOLEAN: Columns containing boolean literals (true, false).
    • INTEGER / BIGINT: Whole numbers. Values exceeding 32-bit limits ($> 2,147,483,647$) automatically promote to BIGINT.
    • NUMERIC / DECIMAL: Floating-point numbers and fixed decimals.
    • DATE / TIMESTAMP: ISO 8601 strings such as 2024-03-15 or 2024-03-15T09:30:00Z map to dialect datetime types (TIMESTAMPTZ in Postgres, DATETIME in MySQL, DATETIME2 in SQL Server).
    • VARCHAR(n) / TEXT: Strings are sized with a safety buffer based on maximum observed character length.
  3. Dialect-Tailored DDL and Batched DML: Generates clean CREATE TABLE statements with proper identifier quoting, followed by multi-row INSERT INTO ... VALUES statements grouped into batches.

Handling nested JSON objects and arrays

When JSON contains nested objects (such as {"profile": {"city": "Berlin", "score": 98.5}}), you have two architectural choices:

Option 1: Flatten nested keys (Relational Normalization)

Flattening unrolls nested keys into separate columns using underscore delimiters:

  • profile.city becomes profile_city VARCHAR(32)
  • profile.score becomes profile_score DECIMAL(12, 4)

This approach is best when you want standard relational indexing, WHERE clauses, and aggregation without needing JSON query functions.

Option 2: Preserve as JSON / JSONB column (Document-Relational Hybrid)

Preserving nested objects serializes the child object into a string and assigns the target database’s native JSON type:

  • PostgreSQL: Assigned JSONB for binary indexing via GIN and operators like ->> or ?.
  • MySQL / MariaDB: Assigned JSON with automatic document validation. See our MySQL JSON function guides for query patterns.
  • SQLite: Stored as TEXT or JSONB (SQLite 3.45+). Can be queried using SQLite JSON and JSONB functions.
  • SQL Server: Stored as NVARCHAR(MAX) or native JSON (SQL Server 2025). Can be queried using JSON_VALUE() and OPENJSON().
  • Oracle: Stored as CLOB or JSON (Oracle 21c/23ai).

Database batch insert limits and dialect caveats

Database Multi-row VALUES Support Batch Row Constructor Ceiling Native JSON Column Type
SQLite Supported (3.7.11+) Up to 500 rows recommended (compound limit) TEXT / JSONB (SQLite 3.45+)
MySQL Supported Limited by max_allowed_packet JSON
PostgreSQL Supported Limited by 65,535 parameter ceiling if parameterized JSONB / JSON
SQL Server Supported Strict 1,000-row constructor limit (Error 10738) NVARCHAR(MAX) / JSON
Oracle Supported (Oracle 23ai) / INSERT ALL Limited by statement size CLOB / JSON

For a comprehensive breakdown of multi-row insert mechanics, parameters, and bulk load tools like COPY and LOAD DATA, consult our comparative guide on SQL Bulk and Batch Insert by Database.

Client-side privacy guarantee

All data parsing, schema analysis, and SQL generation occur entirely in your browser using client-side JavaScript. Your JSON payloads, spreadsheets, API keys, and database contents are never transmitted to SQLiz servers, logged, or shared with third parties.