Skip to content
Mediawand

JSON to JSON Schema Generator

Start a JSON Schema from real data instead of a blank page. Paste an example and get a schema with every type, nested object and required key filled in, ready to refine.

How to generate a JSON Schema

  1. 1Paste a JSON example, ideally with several array items.
  2. 2Give the schema a title.
  3. 3Copy the schema or download schema.json.

How the types are worked out

Every item of an array is merged into one type, so a key that's missing from some items becomes optional and a value that's sometimes null becomes nullable. Whole numbers and decimals are told apart, nested objects get their own named types (an “items” array gets an “Item” type), and objects with the same shape share one type.

Schema specifics

The schema uses draft 2020-12. Keys present in every item are listed under required, whole numbers are integer, values of several simple types get a type list like ["string", "null"], and mixed shapes use anyOf.

Refine it

Add what an example can't show: formats like email or date-time, minimum and maximum values, patterns, enums and descriptions.

Frequently asked questions

Is my data uploaded?
No. Everything runs in your browser, so the JSON never leaves your device.
Can I use it in OpenAPI?
Yes. OpenAPI 3.1 uses JSON Schema 2020-12; copy the part after $schema into your components.
Are extra keys allowed?
Yes, by default. Add "additionalProperties": false to objects that must not have other keys.

Related tools

Loading tools…