๐Ÿ”’ Runs in your browser โ€” nothing is uploadedโœ“ Free, no signup

JSON to SQL INSERT Converter

Paste a JSON array of objects or a CSV file to get ready-to-run INSERT statements โ€” with correct quoting for MySQL, PostgreSQL, SQLite or SQL Server.

Loading...

0 characters

SQL

Loading...

When should you use the JSON to SQL?

  • Seeding a database from an API response or a JSON fixture
  • Importing a spreadsheet exported as CSV into a SQL table
  • Creating test data for local development

How to use the JSON to SQL

  1. 1

    Paste data

    Use a JSON array of objects, or switch to CSV with column names in the first row.

  2. 2

    Name the table

    Use schema.table if needed (public.users).

  3. 3

    Choose a database

    Quoting, booleans and escaping follow the database you pick.

  4. 4

    Batch and copy

    Group rows into multi-row INSERTs, add CREATE TABLE if you like, then copy or download.

Examples

PostgreSQL

JSON

[{ "id": 1, "name": "Ada", "active": true },
 { "id": 2, "name": "O'Brien", "active": false }]

SQL

INSERT INTO "users" ("id", "name", "active") VALUES
  (1, 'Ada', TRUE),
  (2, 'O''Brien', FALSE);

Common errors and how to fix them

Each row must be an object
Paste an array of objects like [{"id": 1}]. A wrapper like {"data": [...]} also works โ€” the first array is used.
Columns are missing in some rows
Every column found in any row is included. Missing values are inserted as NULL.
Related tools:ย SQL Formatter ยท CSV to JSON Converter ยท Mock JSON Generator

More from JSON Tools

Free tools that run in your browser โ€” no signup, nothing uploaded.

JSON to SQL FAQ

MySQL and MariaDB (backtick quoting), PostgreSQL and SQLite (double quotes) and SQL Server (square brackets, N'' strings).

Single quotes are doubled (O'Brien โ†’ 'O''Brien'), and MySQL also escapes backslashes, so values can't break the statement.

They're stored as JSON text. CREATE TABLE gives these columns a JSON (MySQL) or JSONB (PostgreSQL) type.

One INSERT with many rows is much faster than many single-row INSERTs. 100โ€“1000 rows per statement is a good range.

From the values: whole numbers become BIGINT, decimals DOUBLE, true/false BOOLEAN, and text VARCHAR or TEXT. Review the types before using it in production.

No. Everything runs in your browser, so your data never leaves your device.