CleanedWeb

Free tool

JSON Schema generator

Paste sample records and get a JSON Schema (draft 2020-12), TypeScript interfaces and Pydantic models. Every record counts: fields missing from some records are optional, null values make a field nullable, and dates, URLs and emails get their format. Your data stays in your browser.

How the schema is inferred

Required or optional

A field is required only when every record has it. Give the generator several records, not one, so optional fields show up as optional.

Types and nulls

Whole numbers are integer until a decimal appears. A field that is sometimes null allows null; a field with mixed types lists each one.

Formats

When every value of a text field is a date, date-time, URL, email or UUID, the schema adds that format, and Pydantic uses date or datetime.

Nested data

Nested objects become their own TypeScript interfaces and Pydantic models, named after their field. Lists use the merged type of all their items.

Questions

Which JSON Schema version does it write?

Draft 2020-12, the version OpenAPI 3.1 uses. Validators such as Ajv and Python's jsonschema read it directly.

Is my data uploaded?

No. Inference runs in this page; nothing is sent to a server.

Can I validate records against the schema?

Yes: load the JSON Schema into any 2020-12 validator, or use the Pydantic models to parse records in Python. CleanedWeb APIs publish a versioned schema like this for every API, so a change to the records is a new version rather than a surprise.

More free tools

All free tools

Need the data itself, on a schedule?

CleanedWeb turns a website into a maintained REST API that returns structured records, with a versioned schema and repairs when the site changes.