JSON to SQL

Convert a JSON array into a MySQL, PostgreSQL or SQLite CREATE TABLE statement and INSERT rows.

Runs in your browser. Your data never leaves your device.

How to use the JSON to SQL

  1. Paste a JSON array of objects.
  2. Choose the database and table name.
  3. Copy or download the SQL.

About this tool

Load JSON data into a database without writing the SQL by hand. The converter reads every object in the array, picks a column type for each key, writes a CREATE TABLE statement and INSERT statements with safely escaped values, for MySQL, PostgreSQL or SQLite.

Frequently asked questions

Are values escaped?

Yes. Quotes are doubled and every value is written as a literal, so the SQL is safe to run.

More json tools

JSON and code models

All 31 free tools →
JSON tool · Runs in your browser

JSON Formatter

Format JSON online: beautify messy JSON with 2 or 4 spaces or tabs, sort keys, minify it to one line and find errors. Free, runs in your browser.

Free · No sign-upOpen tool
JSON tool · Runs in your browser

JSON Validator

Check if JSON is valid and see the exact line and column of any error, with a hint on how to fix it. A free online JSON validator in your browser.

Free · No sign-upOpen tool
JSON tool · Runs in your browser

JSON to Kotlin Data Class

Paste JSON and get Kotlin data classes for Android, with kotlinx.serialization, Gson or Moshi names, nullable fields and defaults. Free, in your browser.

Free · No sign-upOpen tool
JSON tool · Runs in your browser

JSON to Dart (Flutter)

Convert JSON to null-safe Dart model classes for Flutter, with fromJson, toJson and an optional copyWith. Free, no sign-up, runs in your browser.

Free · No sign-upOpen tool