Cette page n’est pas encore traduite en français : elle s’affiche en anglais.

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.

Mis à jour le
Open file (.xlsx, .csv, .json)
Input
Dialect
Statements

Input preview

Vos données ne quittent jamais votre ordinateur. Tout le traitement se fait localement dans votre navigateur.

Comment utiliser : 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.

Aussi recherché comme : 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.

Outils complémentaires : 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.

Questions fréquentes

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.
Puis-je installer JSON to SQL en tant qu’application web et l’utiliser hors ligne ?
Oui. JSON to SQL est une application web installable (PWA) : elle s’installe depuis votre navigateur, sans passer par une boutique d’applications. Cliquez sur « Installer l’application » en haut de cette page dans Chrome ou Edge (Windows, macOS, Linux, ChromeOS) ; sur Android, utilisez « Partager » → « Ajouter à l’écran d’accueil » sur iPhone et iPad ; ou « Fichier » → « Ajouter au Dock » dans Safari 17+ sur Mac. L’application s’ouvre alors dans sa propre fenêtre avec sa propre icône, et comme elle s’exécute entièrement dans votre navigateur, elle continue de fonctionner hors ligne. Firefox sur ordinateur de bureau ne permet pas d’installer d’applications web. Comment fonctionne l’installation.

Outils similaires