JSON Schema from sample
Infer a reusable schema from representative JSON.
Your input stays on this device. Nothing is uploaded or saved.
About JSON Schema from sample
Infer a reusable JSON Schema from a sample, merging array item shapes and preserving mixed or nullable types.
When to use it
Start a schema for unfamiliar JSON, then refine its contract.
Mixed object rows → shared required fields and nullable property typesHow to use it
- Paste a representative JSON sample.
- Generate a draft 2020-12 schema.
- Review required properties and constraints before using the schema in production.
Start with evidence, then refine the contract
Inference combines every array item instead of assuming the first row is representative. Object keys become required only when present in every observed object of that shape. Mixed values become alternatives, and integer and decimal samples are combined into a number type. Empty arrays leave their item schema open.
The resulting draft 2020-12 schema is a starting point. A sample cannot reveal a missing optional field, a business range or a future enum value. Review required properties and add those rules deliberately. Object keys remain open so an observed sample does not silently become a ban on every additional property.
Limits & privacy
64 KiB input, 64 nesting levels. Inference describes the supplied sample; it cannot know business rules, optional fields absent from every row, or allowed future values. It does not invent ranges or lock objects to their sample keys. Numbers that would lose precision are rejected.
Use this tool from the API reference or connect through the SDK, CLI, SSH, or MCP. Hosted calls share your plan allowances.