JSON to SQL Converter

Turn a JSON array of objects into CREATE TABLE and INSERT statements.

  • 100% client-side · your data never leaves your browser
  • Instant, no rate limits
  • Free, no sign-up
Input JSON
SQL

Your result appears here

Paste JSON into the panel on the left — everything runs privately in your browser.

Overview

JSON to SQL Converter — CREATE TABLE & INSERT

Turn a JSON array of objects into ready-to-run SQL: a CREATE TABLE statement with inferred column types, followed by batched INSERT rows. JsonDrift scans your data to pick INTEGER, REAL, BOOLEAN, or TEXT for each column, quotes identifiers, escapes string values, and stores nested objects and arrays as JSON text. Everything runs in your browser — no database and no upload.

No uploadsNo sign-upOpen source
  1. Why convert JSON to SQL?

    APIs, exports, and logs arrive as JSON, but loading that data into a relational database means writing table definitions and insert statements by hand. Generating them from a real sample gets you a working schema and seed data in seconds — ideal for prototyping, migrations, seeding test databases, and bulk-loading API responses.

  2. How column types are inferred

    For each column the converter inspects the values across every row. Columns with only whole numbers become INTEGER, mixed or fractional numbers become REAL, true/false values become BOOLEAN, and everything else — strings, dates, mixed types — becomes TEXT. Nested objects and arrays are serialized to JSON and stored in a TEXT column so no data is lost.

    • INTEGER, REAL, BOOLEAN, TEXT chosen per column
    • Union of keys across all rows becomes the column set
    • String values are escaped (single quotes doubled)
    • Nested objects/arrays stored as JSON text
  3. Portable across dialects

    The output uses ANSI-style quoting and types that work with SQLite, PostgreSQL, and MySQL with little or no change. For MySQL you may prefer backtick identifiers and TINYINT(1) for booleans; for Postgres you can switch TEXT columns storing JSON to the jsonb type. Treat the generated SQL as a correct starting point you tune for your engine.

  4. Review before running

    Generated SQL reflects one sample, so confirm the table name, add a primary key or constraints, and widen types if production data can differ (an id that is sometimes a large integer, or a field that is occasionally null). Always run generated DDL against a scratch database first.

FAQ

Frequently asked questions

How do I convert JSON to SQL?

Paste a JSON array of objects and JsonDrift generates a CREATE TABLE statement with inferred types plus INSERT statements for every row.

Which SQL dialect does it target?

It emits portable ANSI-style SQL that works with SQLite, PostgreSQL, and MySQL with minor tweaks (identifier quoting and boolean types vary by engine).

How are nested objects handled?

Nested objects and arrays are serialized to JSON and stored in a TEXT column, so the structure is preserved. In Postgres you can switch that column to jsonb.

Is my JSON uploaded to a server?

No. Conversion runs entirely in your browser, so your data never leaves your machine.

Continue with a related tool

All tools

Learn more in our guides

All guides