Esta página aún no está traducida al español, así que la mostramos en inglés.

JSON to SQL Converter

Paste a JSON array and get SQL that creates the table and inserts every object as a row — nested objects become columns or JSON values, and every string is escaped for your dialect.

Actualizado el
Open file (.xlsx, .csv, .json)
Input
Dialect
Statements

Input preview

Tus datos nunca salen de tu ordenador. Todo se procesa localmente en tu navegador.

Cómo usar: JSON to SQL

  1. Paste a JSON array of objects or open a .json file.
  2. Choose whether nested objects are flattened into columns (dimensions_width) or stored as one JSON column.
  3. Select the SQL dialect, table name and the statements to include.
  4. Copy the SQL or download it as a .sql file.

What does JSON to SQL conversion do?

It maps a JSON array onto a relational table: every object becomes a row, every key a column. The converter scans all objects to collect the full set of columns (objects with missing keys get NULL), infers a SQL type for each column, and writes CREATE TABLE plus batched INSERT statements.

[{ "id": 1, "sku": "KB-001", "price": 89.99, "in_stock": true }]

becomes, for PostgreSQL:

CREATE TABLE "products" (
  "id" INTEGER,
  "sku" VARCHAR(16),
  "price" NUMERIC(10,2),
  "in_stock" BOOLEAN
);
INSERT INTO "products" ("id", "sku", "price", "in_stock") VALUES (1, 'KB-001', 89.99, TRUE);

Handling nested objects

OptionResultUse when
Flatten to columnsdimensions.width → column dimensions_widthYou want to filter and index the nested fields
Keep as JSON valueOne dimensions column of type JSON / JSONBThe structure varies or you query it with JSON functions

Arrays are always stored as JSON text. In PostgreSQL the JSON column type is JSONB, in MySQL JSON; SQLite, SQL Server and Oracle store it as text.

JSON types vs SQL types

  • Numbers: integers become INT (or BIGINT above 2,147,483,647); decimals become DECIMAL with enough precision for the largest value.
  • Booleans: TRUE/FALSE in MySQL and PostgreSQL, 1/0 in SQLite, SQL Server (BIT) and Oracle.
  • Strings that look like dates (2026-02-14 or ISO timestamps) become DATE or DATETIME/TIMESTAMP columns.
  • null always becomes NULL.

Before you run it

Check the generated VARCHAR lengths and add indexes or foreign keys your schema needs — or design the table yourself with the CREATE TABLE generator and generate only the inserts. If the JSON fails to parse, the JSON Formatter shows exactly where. Spreadsheet data? Use CSV & Excel to SQL.

También se busca como: json to sql insert, json to mysql, json to postgresql, convert json to sql, json to sqlite, json to sql server, json to insert statement.

Herramientas que combinan con: JSON to SQL

  • SQL to JSON, CSV & Excel — Paste a SQL dump or a few INSERT statements and get the rows back as JSON, CSV or an Excel workbook with one sheet per table.
  • JSON to Excel — Turn a JSON array into a real Excel workbook.
  • Excel to JSON — Open an .xlsx workbook or paste cells straight from Excel or Google Sheets and get clean JSON.
  • CSV & Excel to HTML Table — Paste spreadsheet cells, CSV or JSON and get semantic, escaped HTML table markup — with an optional ready-made style and a live preview.

Preguntas frecuentes

What JSON shape does the converter need?
An array of objects works best. A single object becomes one row, and a root object that wraps an array (like {"items": [...]}) is unwrapped automatically.
How are nested arrays stored?
Arrays are written as JSON text in one column. To get a separate child table, convert that array on its own and add a foreign key column.
Can I use the output with MariaDB?
Yes. Choose the MySQL dialect — MariaDB accepts the same syntax, backtick quoting and multi-row inserts.
Does it work offline and privately?
Yes. The JSON is parsed and converted in your browser; nothing is uploaded.
¿Puedo instalar JSON to SQL como aplicación web y utilizarla sin conexión?
Sí. JSON to SQL es una aplicación web instalable (PWA): se instala desde el navegador, no se descarga desde una tienda de aplicaciones. Haz clic en «Instalar aplicación» en la parte superior de esta página en Chrome o Edge (Windows, macOS, Linux, ChromeOS) o, en Android, utiliza «Compartir» → «Añadir a la pantalla de inicio» en iPhone y iPad, o «Archivo» → «Añadir al Dock» en Safari 17+ en un Mac. A continuación, se abrirá en su propia ventana con su propio icono y, como se ejecuta íntegramente en tu navegador, seguirá funcionando sin conexión. Firefox en el ordenador de sobremesa no permite instalar aplicaciones web. Cómo funciona la instalación.

Herramientas relacionadas