JSON Schema Generator Online
Sample JSON → valid schema.
At a glance
- Processing:
- Runs locally in your browser
- Privacy:
- Nothing you type is sent to a server
Last updated: 2026-10-07
Common use cases
- Drafting API contracts from sample responses for review
- Documenting config files for new team members
- Adding checks to form payloads before deploy
- Sharing data shapes for a client integration
About this tool
Paste sample JSON and get a clean draft 2020-12 schema: inferred types, required fields, nested objects and array item merging — ready to validate with.
How to use it
- Paste sample JSON.
- Review the inferred schema.
- Copy it into your validator.
Practical tips
- Paste valid JSON first, then press Infer schema. Output waits for the click. The button sits under the input.
- Include varied array items so the merge sees each shape. Two examples per variant is enough.
- Review required fields before enforcing. All present keys start as required. Delete lines you want optional.
- Start from a real API response rather than one field: a full sample object with nested objects produces a complete schema in one pass.
Common mistakes
- Pasting trailing commas and seeing a syntax error. Fix the JSON first, perhaps with the validator. The error names no line, so check commas first.
- Showing one array item and expecting all shapes. Add examples of each variant. Mixed arrays merge into anyOf.
- Trusting email or URI hints blindly. The tool guesses from patterns, so confirm edge cases. Plain strings stay unformatted.
How this compares
Server schema tools upload samples for inference, which exposes private payloads. This tool infers draft 2020-12 types in your tab and never sends the JSON out. You give up shared workspaces and cloud version logs. You keep local drafts with copy-ready output. There is no sample store to purge.
Good to know
- Required lists mirror the sample. Missing keys cannot be guessed.
- Empty arrays yield open items with no detail.
- Output targets draft 2020-12 with additionalProperties true.
Frequently asked questions
Is my JSON uploaded?
No. Inference runs entirely in your browser — samples never leave your device.
How are types detected?
Objects, arrays (merged from all items), strings (with format hints for date-time/email/uri), numbers, booleans and nulls map to draft 2020-12 types with required fields inferred from presence.
Which JSON Schema draft does it target?
Draft 2020-12, the current standard — accepted by modern validators including Ajv. Required fields are inferred from the sample, so review them before enforcing.
Can it infer from a JSON array at the top level?
Yes. Paste an array and the tool returns an array schema with merged item types. Object samples return object schemas the same way. Dedupe keeps the anyOf list short when items repeat.
What does a sample input and output look like?
An object with a name, an age and a list of tags yields an object schema with a string property, an integer property and a string-array property, with the present keys listed as required. Paste it into the tool to see the full draft 2020-12 output with types, required lists and nested merging spelled out.

