JSON Schema Validator & Generator
Validate JSON against a schema, or infer a schema from sample data
About this tool
Two directions of the same discipline: paste sample JSON and get a draft-07 schema inferred from it, or paste data plus a schema and see every violation listed with its JSON path. Validation runs on Ajv — the same engine most Node services use — so what passes here passes in CI.
Inference is production-minded: object keys become typed properties and required entries, arrays merge the shapes of all their members, integers are distinguished from floats, and keys that appear in only some array members are correctly left out of required. The result is a starting point you tighten with formats, ranges and patterns.
API responses and config files are exactly the data you least want on a third-party server. Both inference and validation run entirely in your browser.
Frequently asked questions
- Which JSON Schema draft is supported?
- Inference emits draft-07, the most widely supported draft across editors and validators. Validation accepts draft-07 and the earlier drafts Ajv understands in non-strict mode; 2019-09/2020-12 keywords mostly work too since unknown keywords are ignored rather than fatal.
- What does the $ in violation paths mean?
- It is the root of the document, JSONPath-style: $.age means the top-level age property, $.items.2.name the name of the third array element. An empty path ($) means the violation is about the document root itself — wrong type, or a missing required property.
- Why is the inferred schema stricter or looser than I expected?
- It describes exactly the sample you gave: fields present everywhere become required, and only observed types are allowed. Feed it a more varied sample (an array of representative objects) for a more general schema, then adjust by hand — inference cannot know intent.
- Does validation support format, pattern and other constraint keywords?
- Structural keywords (type, required, properties, items, enum, minimum, pattern…) are fully enforced. Format strings like "email" or "date-time" are not asserted — that mirrors the JSON Schema spec, where format is annotation by default, and avoids false confidence.