JSON to SQL
Convert a JSON array of objects into SQL INSERT statements for MySQL, PostgreSQL, SQLite or SQL Server, with optional CREATE TABLE, inferred column types and JSON string columns for nested objects — fully in your browser.
How to Use JSON to SQL
This tool turns a JSON array of objects into ready-to-run SQL INSERT statements for MySQL, PostgreSQL, SQLite or SQL Server, with an optional CREATE TABLE whose column types are inferred from the data. Nested objects and arrays are serialized as JSON strings, nulls become NULL, and everything is generated locally in your browser.
- Paste a JSON array of objects into the input area, for example [{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}].
- Set the table name and pick the SQL dialect — MySQL, PostgreSQL, SQLite or SQL Server.
- Choose how many rows each INSERT should batch (100, 500 or 1000); the output refreshes in real time as you edit.
- Tick Generate CREATE TABLE if you also want the DDL, with column types inferred from the values (INT/FLOAT/BOOLEAN/TEXT).
- Copy the SQL or download it as a .sql file, then run it in your database client or via the mysql, psql, sqlite3 or sqlcmd command line.
Every distinct key across all objects becomes a column, so objects may have different shapes. Nested objects and arrays become JSON string columns, and missing keys or null values insert NULL. Large inputs over 1 MB are built in a background worker, so the page never freezes.
Related Tools
- JSON to CSV Free online JSON to CSV converter. Flatten nested objects with dot notation, choose custom delimiters, and download instantly. 100% browser-based, no upload needed.
- SQL to JSON Convert SQL INSERT statements to JSON arrays or objects instantly. Supports multi-row VALUES, NULL handling, auto type detection, and pretty print. 100% client-side, no upload.
- JSON to XML Convert JSON to XML format with customizable indentation and optional XML declaration. Runs entirely in your browser.
- Chmod Calculator Free online chmod calculator to visualize and calculate Linux file permissions with checkboxes. Instantly convert between numeric (755, 644) and symbolic notation (rwxr-xr-x). Supports special permissions like setuid, setgid, sticky bit.
- ASCII Table Complete ASCII character encoding reference with decimal, hexadecimal, octal, binary codes, HTML entities, and character descriptions. Search and filter instantly.
- HTTP Request Tester Test REST APIs directly in your browser. Send GET, POST, PUT, DELETE requests with custom headers, body, and query parameters. View response status, headers, and JSON body instantly.
- .htaccess Generator Generate Apache .htaccess rules for redirects, rewrites, security headers, caching, compression, and more.
- Robots.txt Generator Free online robots.txt generator. Create and customize robots.txt files to control search engine crawling, manage crawler access, and optimize your site's SEO with an easy visual editor.