Free Online JSON Schema Generator and Validator, Draft 07
Paste a JSON sample and get a draft-07 schema inferred from it, with control over required properties, enums, format hints and mixed arrays. Or paste a schema and a document and get every failure listed with its JSON pointer path, the rule that failed and the value that failed it.
Enjoying WizTools123? Help keep our server infrastructure 100% free and open for everyone.
How to Use JSON Schema Generator and Validator
Step by step, start to finish.
Generate infers a schema from a sample document. Validate checks a document against a schema you paste in.
The sample, or the document to check. In Validate, the schema goes in the box under the options.
Generating: required properties, enums, format hints and how mixed arrays are handled. Validating: whether format is checked too.
A schema you can copy, or a table of failures with the JSON pointer path, the rule and the offending value.
Key Features
What this tool does, and what it does not do.
A draft-07 schema inferred from real JSON, with the choices in your hands.
Each one carries a JSON pointer, the rule that failed and the value.
Repeated short strings become an enum; dates, emails and uuids are spotted.
allOf, anyOf, oneOf and not, plus $ref inside the same document.
The checked keywords are listed on the page, and a warning names any other keyword your schema uses.
References resolve inside your schema and no document leaves your browser.
About JSON Schema Generator and Validator
JSON Schema is how you write down what a JSON document is allowed to look like, and it earns its keep the moment more than one system exchanges data. The awkward part is starting: writing a schema by hand from an example is tedious, and the first schema anyone writes is usually wrong in a way that only shows up when a real document arrives.
This page covers both ends of that loop. Generate takes a sample document and infers a draft-07 schema, letting you decide whether every property is required, whether short repeated string sets become enums, whether format hints are added and how an array of mixed types is handled. Validate takes a schema and a document and lists every failure with its JSON pointer path, the rule that failed and the value that failed it, which is far more useful than a single yes or no.
Which keywords does the validator check?
The validator is written from scratch and checks the core of draft-07: type, required, properties, additionalProperties, items, minItems, maxItems, uniqueItems, enum, const, the four number bounds, multipleOf, minLength, maxLength, pattern, format, the composition keywords allOf, anyOf, oneOf and not, and local $ref. The full list sits in the notes on the page. If your schema uses a keyword outside it, such as patternProperties or if/then/else, a warning above the result names that keyword, so you always know which rules a clean result covers.
How are formats handled?
In draft-07, format is an annotation, and validators are free to treat it as advice. Here it is checked when you switch Check format on and reported as advisory, covering date-time, date, time, email, uri, uuid, ipv4 and hostname. On the generating side, Add format hints recognises uuids, dates, times, emails, IPv4 addresses and URIs in your sample and writes the matching format into the schema.
Where do references resolve?
Every check runs in your browser and the page makes no network requests. A pointer such as #/definitions/address resolves inside the schema you pasted, and a reference to a URL or another file gets a clear message instead of a download. To validate against a schema split across files, paste the referenced parts under definitions and point at them locally.
A generated schema describes the sample you gave it, so treat it as a strong first draft: run a few more real documents through Validate mode, adjust the required list, and it is ready to share.
Frequently Asked Questions
Common questions about this tool.
More JSON Tools
Other tools from the same hub, free and in your browser.
Feedback
No feedback on this tool yet. Yours would be the first.