How This SQL Schema Generator Works
Paste a JSON object, a JSON array of objects, or a CSV sample, pick a dialect, and this sql schema generator produces a ready-to-run CREATE TABLE statement. It works as a genuine json to sql schema tool, reading the keys and value types across every sampled row rather than just the first one, and it doubles as a csv to sql schema converter when your sample data comes from a spreadsheet export instead. As a create table generator online and a database schema generator online, it needs no signup and nothing is installed, paste your sample and the DDL updates immediately.
Type Inference and Column Nullability
This tool works to infer sql schema from json by checking every value of a given field across all sampled rows, not just the first one, so a field that's a number in most rows but a string in one still gets a sane fallback type. Integers, decimals, booleans, ISO 8601 dates (YYYY-MM-DD) and timestamps (YYYY-MM-DDTHH:MM:SS) are each detected by pattern and mapped to the dialect-appropriate type, everything else falls back to text. Nullability is inferred the same way, if any sampled row is missing a field or has it set to null, the generated column is nullable, otherwise it's NOT NULL, and a toggle lets you force every column nullable regardless of what the sample shows.
Dialect Differences: PostgreSQL, MySQL, SQLite
Used to generate create table from json, the output differs by dialect in ways that matter: PostgreSQL and SQLite quote identifiers with double quotes, MySQL uses backticks. A primary key becomes SERIAL PRIMARY KEY in PostgreSQL, INT NOT NULL AUTO_INCREMENT PRIMARY KEY in MySQL, and INTEGER PRIMARY KEY AUTOINCREMENT in SQLite. Timestamp defaults differ too, NOW() in PostgreSQL, CURRENT_TIMESTAMP with an ON UPDATE CURRENT_TIMESTAMP clause in MySQL, and datetime('now') in SQLite. As a sql table generator free of these dialect quirks to memorize, you just pick a dialect from a dropdown and the correct syntax comes out.
Auto Columns, Limitations, and Common Uses
Two auto-column toggles round out this json to create table statement workflow: "Add id column" prepends a primary key, and "Add timestamps" appends created_at and updated_at columns with dialect-correct defaults. If your own sample data already has a field named id, created_at, or updated_at, the auto-generated column wins that name and the sample's own field is dropped from the rest of the table rather than producing an invalid duplicate-column CREATE TABLE. As a way to generate sql ddl from json, it's ideal for sketching a schema from a JSON API response or a CSV export during prototyping, it isn't a substitute for a full migration tool or ORM when you need indexes, foreign keys, or a rollback-safe change history in production.