← All Tools

JSON To SQL Schema Converter🔒 100% local

Convert JSON to CREATE TABLE. Privacy-first, no server uploads, no tracking.

Related Tools

Base ConverterByte Storage ConverterCamel Snake Converter

Infers a CREATE TABLE statement from one JSON object or an array of objects. Every key seen across the records becomes a column, values decide the type (INTEGER, REAL, BOOLEAN, or TEXT for strings and for anything nested), a column is NOT NULL unless some record carried null, and a key named id, ending in _id or named uuid becomes the primary key. The table is always called my_table.

How to use it

  1. Paste a JSON object, or an array of objects that share a shape.
  2. Run the tool to infer the schema.
  3. Copy the DDL and rename the table - the generated comment gives the sed command.

Worked example

{"id":1,"name":"Widget","price":4.5}becomes-- Inferred schema from 1 record CREATE TABLE my_table ( id INTEGER NOT NULL, name TEXT NOT NULL, price REAL NOT NULL, PRIMARY KEY (id) ); -- Notes: -- • Mixed-type columns resolved to a common supertype (TEXT absorbs all). -- • INTEGER/REAL inference from sample values — verify before migrating real data. -- • Nested objects/arrays mapped to TEXT (store as JSON). -- • Rename the table: sed 's/my_table/your_name/'

Column names are padded so the types line up, and the primary key clause is added because a column is named id. The notes block is emitted verbatim by the tool, bullet points and all.

When to use it

What it does not do