JSON Schema Generator
A validated contract, inferred from real data.
Paste a sample document and Jsonviewpro infers a JSON Schema: types for every property, required fields, merged array item schemas and detected string formats such as date-time, email and uuid.
Input JSON
JSON Schema
What is JSON Schema?
JSON Schema is a vocabulary for describing the shape of JSON data: which properties exist, what types they hold, which are required, and what constraints apply. It is a machine-checkable contract, used for API request validation, configuration validation, form generation and documentation.
How to generate a schema
- Paste a representative document — ideally one with populated arrays and every optional field present.
- Pick a draft. 2020-12 is current; draft-07 is still the most widely supported by tooling.
- Choose whether every property should be required, or only those present in every sample.
- Copy or download the schema, then refine it by hand.
What gets inferred
- Types for every property, with integer distinguished from number.
- Required arrays, derived either from all properties or from the intersection across array items.
- Merged array item schemas, so a heterogeneous array produces one items schema that accepts each shape seen.
- String formats: date-time, date, time, email, uuid, uri and ipv4.
Treat the output as a first draft
Inference can only describe the sample it was given. It cannot know that a status field takes one of four values, that an age must be at least 18, or that an array must not be empty. Add enum, minimum, maxLength, pattern and description by hand — that is where a schema earns its keep.
Once you have refined it, paste it into the JSON Validator to check real documents against it.
Frequently asked questions
Which drafts are supported?
How are required fields decided?
Can I validate a document against the generated schema?
Will the schema include enums or ranges?
Related JSON tools
- JSON ValidatorCheck syntax with precise line, column and cause.
- JSON to TypeScriptGenerate interfaces and models for nine languages.
- JSON AnalyzerProfile structure and surface data-quality problems.
- JSON ViewerExplore JSON as a collapsible tree with search and copyable paths.
- JSON FormatterPretty-print messy JSON with your choice of indentation.