Skip to main content
HandyWeb

JSON to SQL Converter

Turn a JSON array into INSERT and CREATE TABLE statements for MySQL, PostgreSQL, SQLite, or SQL Server. Keys become columns and nested data becomes JSON.

0 characters0 bytes
0 characters0 bytes

The column types are guessed from the data. Nested objects and arrays become JSON text. Read the CREATE TABLE before you run it.

How to Use It

  1. Choose the database and the table name.
  2. Paste the JSON array.
  3. Read the SQL, and copy or download it.

Questions and Answers

What about a key that some objects lack?

Its column allows NULL, and those rows get NULL.

Good to Know

Each key becomes a column. Nested objects and arrays become JSON text (JSONB or JSON in PostgreSQL and MySQL). A column with mixed types becomes text. The SQL is not run.

Source code of this tool (opens in a new tab)Report a problem on GitHub (opens in a new tab)