Convert · Runs in your browser

JSON to SQL Converter

Generate CREATE TABLE and INSERT statements from a JSON array, for PostgreSQL, MySQL, SQLite or SQL Server.

JSON
Drop a file to load it
SQL
Waiting for input

How to use it

  1. Paste a JSON array of objects — each object becomes a row.
  2. Set the table name and SQL dialect, and choose whether to include CREATE TABLE.
  3. Copy the SQL or download it as a .sql file.

Column types

Types are inferred from all rows: whole numbers become INTEGER or BIGINT, decimals NUMERIC, true/false BOOLEAN (BIT on SQL Server), and everything else TEXT.

Safe escaping

Quotes in values are escaped and identifiers are quoted the way each dialect expects, so names like “order” or “user-id” work.

Nested values

Nested objects and arrays are stored as JSON text by default (JSONB on PostgreSQL). Turn on “Flatten nested” to get a column per nested field instead.