Infer a JSON Schema (draft-07/2020-12) from sample JSON.
The JSON to Schema generator infers a JSON Schema from a sample JSON document. It works out types, nested properties, array item types and common string formats, and can mark keys that appear in every sample as required. Use it to bootstrap a schema for validation or API documentation, then refine it by hand.
JSON Schema is a vocabulary for describing the structure of JSON data: which properties an object has, which are required, and what type each value must be. Tools use schemas to validate incoming data, generate forms and document APIs. Writing a schema from scratch is tedious, so a common shortcut is to infer one from an example. The generator looks at the sample and records the type of every value (string, integer, number, boolean, null, object or array), the properties of nested objects, and the item type of arrays. When an array holds several objects, their shapes are merged: a key counts as required only if it appears in every object. A schema inferred from one sample describes only that sample, so it usually needs review.
It is a starting point. It describes only what appeared in your sample, so check types, required lists and formats, and add constraints such as enums or length limits yourself.
They are different versions of the JSON Schema specification. This tool sets the $schema URI for the chosen draft; the generated keywords (type, properties, required, items, format) are valid in both.
date-time (an ISO 8601 timestamp with a time zone), date (YYYY-MM-DD), email and uuid.
As a type list, for example ["string","null"]. If integers and decimals both occur, the type is number.
No. The schema is generated in the page and the sample is not sent anywhere.