JSON to SQL INSERT
Turn JSON records into ready-to-run INSERT statements, with correct quoting for your database. Add a CREATE TABLE if you like. Your data is processed in your browser.
- Use it as often as you like
- Private by design
- PostgreSQL, MySQL, SQL Server
- Optional CREATE TABLE
- Runs on your device. Files are never uploaded.
- Free and unlimited. No sign-up, no watermark.
JSON to SQL INSERT in three steps
No account, no email, no waiting for an upload.
- STEP 01
Drop in your JSON
Use a list of objects, where each key is a column.
- STEP 02
Set the table and database
Enter the table name, choose PostgreSQL/SQLite/standard, MySQL/MariaDB or SQL Server, and set how many rows go in each INSERT.
- STEP 03
Copy the SQL
Tick 'Add CREATE TABLE' if you want a starting table definition at the top.
What JSON to SQL INSERT does, and what it doesn't
We'd rather tell you up front than surprise you after the download.
What you get
- Database-aware quotingColumn names are quoted with double quotes, backticks or square brackets to suit the database you choose.
- Safe string valuesSingle quotes are doubled, and for MySQL backslashes are escaped. SQL Server strings with non-ASCII text get the N prefix.
- Multi-row insertsRows are grouped into INSERT statements of the size you choose, which is much faster than one statement per row.
- CREATE TABLE draftColumn types are guessed: INTEGER or BIGINT, floating point, BOOLEAN or BIT, and TEXT or NVARCHAR(MAX) for the rest.
- Nulls and booleans handledNull becomes NULL, and true and false become TRUE and FALSE (or 1 and 0 on SQL Server).
Good to know
- A starting point for the schemaCREATE TABLE has no keys, indexes or constraints. Adjust types and add a primary key yourself.
- Nested valuesNested objects become dotted columns such as address.city, and lists are stored as JSON text in one column. Check column names before running the SQL.
- Review before runningGenerated SQL should be tested on a copy first, especially with real data.
Your data never leave your device
The tool runs inside your browser instead of on our servers, so there is nothing to upload, store or delete afterwards.
Typical online tool upload
Your file travels over the internet, sits on someone else's computer for a while, and you wait for the upload and the download.
Mediaextractr no upload
The tool loads into your browser once, then works on your file locally. Nothing is sent, so nothing can leak.
When people use JSON to SQL INSERT
Seed a development database
Turn fixture JSON into SQL for your local database.
Load an API export
Insert records into a staging table.
Migrate a small dataset
Move data from a document store to a relational one.
Practice SQL
Create sample tables from JSON examples.
Mediaextractr vs typical upload tools
| MediaextractrPrivate | Typical upload tools | |
|---|---|---|
| Your file is uploaded | Never | Yes |
| Sign-up needed | No | Often, after a few files |
| Daily file limit | None | Often 1–2 free files |
| Watermark | Never | Sometimes |
| Wait for upload & download | No | Yes |
| Speed on very large files | Depends on your device | Depends on their servers |
How records become rows
Every key found in any record becomes a column, and a record that lacks a key gets NULL there. Records are then grouped into INSERT statements with several rows each. SQL Server allows at most 1,000 rows in one INSERT, and the tool respects that.
Table names can include a schema, such as public.users, and each part is quoted separately.
Before you run it
A short checklist avoids surprises:
- Pick the right database option so quoting and booleans match.
- Review the CREATE TABLE types, especially for IDs and dates, which are stored as text.
- Wrap the script in a transaction when loading a lot of rows.
- Prefer CSV to SQL INSERT when you start from a spreadsheet.
- Tidy the SQL afterwards with the SQL formatter.
Loading the script: JSON to SQL INSERT
For PostgreSQL, run the file with psql or paste it into your SQL client. For MySQL, make sure the connection uses UTF-8. For SQL Server, execute it in SSMS or sqlcmd. Wrap large scripts in a transaction so a failure leaves nothing half-loaded, and try them on a development database first.
Questions, answered
How do I convert JSON to SQL INSERT statements?
Paste your JSON array, set the table name and database, and copy the SQL.
Does my JSON data go to a server when SQL is generated?
No. The statements are written by script in this tab, so customer records stay on your device.
Does it work with PostgreSQL, MySQL and SQL Server?
Yes. Choose the database so quoting, booleans and string escaping match.
Can it create the table too?
Yes. Tick 'Add CREATE TABLE' for a basic definition with guessed column types.
How are single quotes in values handled?
They are doubled, which is the standard SQL way to escape them.
Can I generate SQL on a mobile browser?
Yes, in current browsers, though a computer is handier for running the result.