Calculates on this device. File exports run online.
Data Schema Generator
Paste or open CSV data and choose the kind of schema. The page reads every column, finds its type, and writes a JSON Schema, a Table Schema or an SQL table. It can also check CSV data against a schema and list every problem with its row.
Enter your values
Check these values
Your values are worked out in this browser. They are not sent to a server.
Your result will show here
Fill in the values, then choose the button below them.
Your result
How it was worked out
How to make a schema from CSV
- Paste the data, or open a CSV file. The first row must hold the names of the columns.
- Choose JSON Schema, Table Schema or SQL CREATE TABLE (and the database), and type the name of the table.
- Press Make the schema. Copy or download the schema, and read the table of columns: type, empty cells, smallest and largest value.
- For large files, choose them in the box below: the server reads every row with the same rules.
How a column gets its type
- true/false: every filled cell is true, True, TRUE, false, False or FALSE. 1 and 0 stay numbers.
- Integer: whole numbers such as 42 or -7, without leading zeros. A code such as 007 or 01234 stays text, so its zeros are kept.
- Number: numbers written as in JSON, such as 3.5, -0.25 or 6.02e23. A column of integers and decimals is a number column.
- Date: YYYY-MM-DD and a real day (2024-02-29 is a date, 2023-02-29 is not). Date and time: as in RFC 3339, such as 2026-11-04T10:30:00Z or 2026-11-04T16:00:00+05:30. A time without Z or an offset stays text.
- Text: everything else. A text column gets the format uuid, email or uri when every value looks like one (uri: addresses that start with http:// or https://).
- An empty cell is a missing value. A column without empty cells is required.
What each schema holds
- JSON Schema 2020-12: an array of rows; each row is an object with one property for each column. A column with empty cells may be null or left out. Unknown columns are not allowed (additionalProperties: false).
- Table Schema (Frictionless Data): a list of fields with their types, formats and constraints, missingValues [""] and, when you name one, the primary key. Dates and times with offsets other than Z get format any.
- SQL: integers as INTEGER (INT in MySQL) or BIGINT by their size, decimals as exact NUMERIC(p,s) or DECIMAL(p,s) with the digits found in the data, dates as DATE, dates and times as TIMESTAMP WITH TIME ZONE (PostgreSQL) or DATETIME (MySQL), true/false as BOOLEAN. SQLite gets INTEGER, REAL and TEXT, with dates as ISO 8601 text.
- Limits copied from the data (smallest, largest, longest) and lists of allowed values are added only when you ask for them under More options: a sample seldom holds every value the column may ever hold.
Checking data against a schema
- Paste a JSON Schema or a Table Schema, or open one. Press Check the data: every problem is listed with its row (row 1 is the first row under the names), column and value.
- For a JSON Schema each row is checked as an object: a cell of a number column is read as a number, true/false of a boolean column as true or false, and an empty cell is left out. The page checks type, required, properties, additionalProperties, enum, const, the number limits, the text lengths, pattern and the formats date, date-time, email, uri and uuid; the box below checks every keyword with the Python jsonschema library.
- A JSON Schema pattern is not anchored (it may match a part of the text); a Table Schema pattern must match the whole value.
Limits you should know
- The page reads up to 20,000 rows; the server box reads up to 20 million rows in files of up to 200 MB.
- Only the first row can hold the names, and the files must be UTF-8 text.
- The schema describes the data you give. It cannot know the meaning of a column, relations between tables or values that do not appear in the data.
- JSON, XML and YAML documents are handled by the Data Schema Generator & Validator.