Paste one example JSON document and get a starting JSON Schema you can refine. Useful for API contracts, structured-output prompts and validation. It runs locally in your browser.
How to use
- Paste an example object or array into Example JSON.
- Click Generate schema. Parse errors are shown with the browser’s message.
- Copy the schema from the output box and edit it.
How types are inferred
- Strings, booleans and
nullmap tostring,booleanandnull. - Whole numbers become
integer; numbers with decimals becomenumber. - Objects list every key under
properties, mark all of themrequired, and setadditionalProperties: false. - Arrays take their
itemsschema from the first element only.
Limits
One example cannot show which fields are optional, which values are enums, or string formats such as dates and emails, so review those by hand. No $schema keyword is added; add the JSON Schema version (for example 2020-12) your validator expects. If later array elements differ from the first one, widen items yourself.
Related
JSON formatter · JSON to CSV · JSONL validator
How we check
Checked against the tool’s unit tests and a manual run in a desktop browser on 2026-11-13 (Asia/Colombo). Corrections: [email protected].