JSON to SQL Schema
Paste JSON and get a matching CREATE TABLE statement, with column types inferred and a MySQL, PostgreSQL, or SQLite dialect picker.
Use the JSON to SQL Schema
Input JSON
Dialect
SQL Output
Paste JSON and click Generate
Copied!
Summary
JSON to SQL Schema reads a pasted JSON object or array of objects and generates a matching CREATE TABLE statement. When the input is an array, the tool scans every item to infer each column type and marks a column nullable if it is missing from some entries or holds a null value. Column types, quoting, and the primary key clause adjust to the selected SQL dialect: MySQL, PostgreSQL, or SQLite.
How it works
- Paste a JSON object or an array of JSON objects into the input panel, or load a sample.
- Set a table name and pick a SQL dialect: MySQL, PostgreSQL, or SQLite.
- Click Generate to scan the JSON and infer a type for every column.
- Columns missing from some array items, or holding null, are generated as nullable.
- Review the generated CREATE TABLE statement in the output panel.
- Click Copy or Download to save the SQL.
Use cases
- Turn a sample API response into a starting database table.
- Scaffold a table for a new project from a JSON fixture.
- Check which fields in a JSON export are sometimes missing before writing a migration.
- Convert a JSON config or seed file into an equivalent SQL table.
- Draft a schema for MySQL, PostgreSQL, or SQLite from the same JSON source.
- Document the shape of a JSON payload as a SQL table for a teammate.
Frequently Asked Questions
Last updated: 2026-07-14 · Reviewed by Nham Vu