JSON Schema Generator
Infer a schema from a sample document.
Writing a JSON Schema by hand is tedious. Paste a sample document and this generator infers a schema from it: the type of every value, the properties of each object, which properties are required, and the shape of array items.
The result is a starting point. A sample cannot express constraints such as string formats, enums, minimum values or which fields are truly optional, so review the schema and tighten it before relying on it.
How to use it
- Paste a representative JSON sample into the left editor.
- Review the inferred schema on the right.
- Copy it, then test it against real data with the Validate panel.
Questions
How is the required list decided?
Every key of a single object is listed as required. Inside arrays, only keys present in every element are required.
How are numbers typed?
A field is typed integer when every sample value is a whole number, and number otherwise.
Can I use the schema for LLM structured outputs?
Yes. For that use case choose one of the tool definition targets, which produce a strict schema with additionalProperties disabled.
All tools
- JSON Formatter
- JSON Validator
- JSON Minifier
- JSON Repair
- JSON Diff
- JSON Schema Validator
- JSON to YAML
- YAML to JSON
- JSON to CSV
- CSV to JSON
- JSON to XML
- XML to JSON
- YAML Formatter
- XML Formatter
- JSONL Validator
- JSON to TOON
- LLM Token Counter
- LLM Token Optimizer
- JSON to TypeScript
- JSON Schema Generator
- LLM Tool Schema Generator