Free JSON to SQL — CREATE TABLE + INSERT INTO

Convert JSON to SQL
MySQL · PostgreSQL
SQLite · SQL Server.

Generate CREATE TABLE and INSERT INTO statements from any JSON array. Types inferred automatically. Supports four SQL dialects. Runs entirely in your browser — no upload, no account.

Your data never leaves your browser
CREATE TABLE + INSERT INTO
4 SQL dialects
Nested objects flattened
Always free
JSON to SQL Converter   100% client-side
Paste a JSON array of objects. Each object becomes a row. Keys become column names. Types are inferred from values across all rows.
JSON input
  SQL ready

      
How to convert JSON to SQL

Three steps — paste your JSON array and run the SQL directly.

1
Paste your JSON array

Paste a JSON array of objects — each object becomes a row in the SQL table. The converter scans all rows to infer the most accurate column types: a column that contains integers in all rows becomes INT, but if any row has a decimal it becomes FLOAT.

2
Choose dialect and options

Select your SQL dialect — MySQL, PostgreSQL, SQLite or SQL Server. Each uses the correct type names and quoting conventions. Set the table name, choose whether to flatten nested objects or store them as JSON columns, and pick single or batch INSERT mode.

3
Copy and run the SQL

Click Generate SQL and copy the output directly into your database client — MySQL Workbench, psql, DBeaver, TablePlus or any SQL editor. Download as a .sql file for version control or sharing with your team.

How JSON types map to SQL column types

The type inference rules applied across all rows in the JSON array.

JSON typeMySQLPostgreSQLSQLiteSQL Server
string VARCHAR(255) / TEXT VARCHAR(255) / TEXT TEXT NVARCHAR(255) / NVARCHAR(MAX)
integer INT INTEGER INTEGER INT
float FLOAT FLOAT REAL FLOAT
boolean TINYINT(1) BOOLEAN INTEGER BIT
null Column is nullable — NULL in INSERT statements
object / array JSON JSONB TEXT NVARCHAR(MAX)
When do you need JSON to SQL?

Common workflows where JSON data needs to go into a relational database.

Seeding development databases

API responses and fixtures stored as JSON need to be loaded into a local or staging database for development. Converting to SQL INSERT statements lets you seed the database directly from the command line — no ORM setup, no migration script required.

Migrating from NoSQL to SQL

Documents from MongoDB, Firestore or DynamoDB exported as JSON need a schema and INSERT statements for migration to a relational database. Converting the JSON export to SQL is the first step — generating the CREATE TABLE from the document structure and INSERTs from the documents.

Importing API data

Third-party API responses — financial data, CRM exports, analytics feeds — arrive as JSON. Converting to SQL lets you load the data directly into your database without writing an ETL script or setting up a pipeline for a one-off import.

Prototyping database schemas

When designing a new feature, you often have a JSON structure before you have a database schema. Converting the JSON sample to SQL gives you a first-cut CREATE TABLE that you can refine — adding indexes, constraints and foreign keys — without writing the column definitions from scratch.

Related JSON tools
Popular searches
json to sql converter json to sql insert convert json to sql json to sql table json to mysql json to postgresql json to sqlite json to sql server json array to sql insert json to sql create table json to sql online free convert json to sql query json to sql insert statement

SQL generated in
your browser. No upload.

The entire SQL generation runs in JavaScript locally. Your JSON data is parsed and traversed entirely in your browser — it is never transmitted to any server. Close the tab and it's gone.

Type inference scans all rows before generating the CREATE TABLE — a column that has integers in most rows but a decimal in one becomes FLOAT, not INT. NULL values mark the column as nullable. The result is a schema that matches your actual data, not just the first row.

Multi-row type inference
Types are inferred by scanning all rows — not just the first. A column with mixed integer and float values correctly becomes FLOAT.
4 SQL dialects
MySQL, PostgreSQL, SQLite and SQL Server — each with correct type names, quoting conventions and dialect-specific syntax.
Batch INSERT
Single batch INSERT with multiple value rows — faster import than individual INSERT statements, compatible with all four dialects.
47 tools, always free
No row limits, no watermarks, no account. Funded by non-intrusive display advertising only.
Frequently asked questions
Common questions about converting JSON to SQL.
How do I convert JSON to SQL?
Paste your JSON array into the converter above, choose your SQL dialect, set the table name, and click Generate. The tool outputs a CREATE TABLE statement with inferred column types and INSERT INTO statements for every row in the JSON array.
What SQL dialects are supported?
MySQL (backtick quoting, TINYINT for boolean), PostgreSQL (double-quote identifiers, BOOLEAN type, JSONB), SQLite (double quotes, flexible typing), and SQL Server T-SQL (square bracket quoting, NVARCHAR, BIT for boolean). Each dialect uses the correct type names and quoting conventions.
How are JSON types mapped to SQL column types?
Strings become VARCHAR(255) or TEXT. Integers become INT. Floats become FLOAT. Booleans become BOOLEAN (or TINYINT(1) for MySQL, BIT for SQL Server). Null values make the column nullable. Types are inferred across all rows — a column with mixed integer and float values becomes FLOAT.
How are nested JSON objects handled?
Nested objects are flattened with dot-notation column names by default — address.city becomes a separate column. Choose the JSON column option to store the entire nested object as a JSON/JSONB column instead — useful when the nested structure is complex or variable.
What is batch INSERT and when should I use it?
Batch INSERT produces a single INSERT INTO statement with multiple value rows — INSERT INTO table VALUES (...), (...), (...). This is significantly faster than individual INSERT statements for large datasets because it reduces round-trips to the database. Use it when importing more than a few dozen rows.
Go up