JSON to SQL Table (DDL)
Generate a SQL CREATE TABLE from JSON for PostgreSQL, MySQL or SQLite. Guesses column types, nullability and a primary key. Free and private.
JSON
Stays in your browserSQL
Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)
Next steps
Done here? Use the Send to… menu on the result to carry it on to SQL Formatter.
Free Online JSON to SQL Table (DDL)
Paste a JSON sample and get a table definition. Column types, which columns may be empty and the primary key are guessed from your data. It gives developers a quick browser-based way to solve a focused json to sql table (ddl) task before moving the result into a project.
How to use JSON to SQL Table (DDL)
Paste your data into the box on the left, or open a file, then press Convert. Use a list of objects: every key becomes a column. Nested objects become columns joined with underscores; lists become JSON columns.
Common mistakes
- Using one sample row: types and nullability are only as good as the data you show, so paste several rows.
- Treating the guess as a design: review lengths and indexes before running the SQL.