JSON to SQL Converter
Turn a JSON array into INSERT and CREATE TABLE statements for MySQL, PostgreSQL, SQLite, or SQL Server. Keys become columns and nested data becomes JSON.
0 characters0 bytes
0 characters0 bytes
The column types are guessed from the data. Nested objects and arrays become JSON text. Read the CREATE TABLE before you run it.
How to Use It
- Choose the database and the table name.
- Paste the JSON array.
- Read the SQL, and copy or download it.
Questions and Answers
What about a key that some objects lack?
Its column allows NULL, and those rows get NULL.
Good to Know
Each key becomes a column. Nested objects and arrays become JSON text (JSONB or JSON in PostgreSQL and MySQL). A column with mixed types becomes text. The SQL is not run.
Related Tools
- JSON and CSV ConverterConvert a JSON array to CSV for Excel, with Persian shown correctly, or a CSV file to JSON.
- SQL FormatterFormat SQL queries with readable indentation, for standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, and SQL Server.
- JSON Formatter and ValidatorPretty-print or minify JSON, or find its errors with the line and column.
Source code of this tool (opens in a new tab)Report a problem on GitHub (opens in a new tab)