๐ 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.
0 characters
SQL
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
Paste data
Use a JSON array of objects, or switch to CSV with column names in the first row.
- 2
Name the table
Use schema.table if needed (public.users).
- 3
Choose a database
Quoting, booleans and escaping follow the database you pick.
- 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.
More from JSON Tools
Free tools that run in your browser โ no signup, nothing uploaded.
JSON Auto-Fixer & Formatter
Repair, validate, and beautify broken JSON (missing quotes, trailing commas).
JSON Validator & Linter
Check JSON syntax and see the exact line and column of every error.
JSON Viewer (Tree)
Explore JSON as a collapsible tree with search and click-to-copy paths.
JSON Editor
Edit JSON with live validation, a tree view, formatting and key sorting.
JSON Beautifier
Pretty-print and indent JSON for easy reading and debugging.
JSON Compare & Diff Tool
Find the difference between two JSON objects visually and quickly.
JSON Sorter (Sort Keys)
Sort JSON object keys alphabetically, including nested objects.
JSONPath Tester
Evaluate JSONPath expressions with filters and recursive queries.
JSON Schema Generator
Generate a JSON Schema from any sample JSON document.
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.
