Guide
Validating JSON against a schema, and generating sample data from one
JSON Schema is a vocabulary for saying what a JSON document must look like: which properties exist, what types they have, which values are allowed. Teams use it to validate API payloads, configuration files and form data, and to generate documentation and types. This page takes a schema and a piece of data, lists every rule the data breaks, and can invent valid data when you only have the schema.
How to use it
Paste the schema on the left and the data on the right, or press Sample on each. The result appears at once: valid, or a table of errors. Each row gives the path of the failing value, the keyword that failed and a plain message. The errors are not limited to the first, so you can fix them all in one pass. If either side is not valid JSON, the parser’s message appears with the position.
Reading the errors
A path such as /tags identifies the property tags; /items/0 is the first element of items; an empty path in the table is shown as “(whole document)”. The keyword column names the rule, for example minimum, enum, format, pattern, uniqueItems or additionalProperties. Messages include the limits involved, so “Must have at least 2 character(s); has 1” tells you both the rule and the value’s size.
Formats and unsupported keywords
The format keyword is annotation-only by default in recent drafts, so the page offers a switch. With it on, common formats such as email, date-time, date, uri, uuid, ipv4 and ipv6 are checked, but the checks are not a complete implementation of every standard. Keywords introduced after draft 2019-09 that need special evaluation, such as unevaluatedProperties and dependentSchemas, are not checked; the page lists them under the table so you know the result is partial.
Why no ready-made library
The best-known validators compile each schema into JavaScript source and run it with eval or the Function constructor. The content security policy of this site forbids that, and for good reason, since it is the way injected code would run. The validator here walks the schema directly, which is slower for huge data but safe, and which means the page keeps working under the strict policy.
Generating sample data
The button “Make example data from the schema” produces a document that satisfies the schema: required properties always, optional ones if the checkbox is on, strings of the right length and pattern, numbers inside their limits, enum values and format-shaped strings such as an email address. It is useful for tests and for checking that a schema is not impossible to satisfy. The result is a starting point, not realistic data.
A worked example
The Sample button loads a schema for a user with an id, an email, a role, a name, tags and a zip code, with extra properties forbidden, and a record that breaks several rules. Seven errors are reported: /id is below the minimum of 1; /email is not a valid email; /role is not one of admin, editor or viewer; /name has 1 character where 2 are needed; /tags contains two identical items; /zip does not match the pattern ^[0-9]{5}$; and the root has the property “extra”, which additionalProperties forbids.
Limits
Draft-07 up to 2020-12 keywords are covered as described, and remote references are never fetched. The page does not convert between schema drafts, generate types, or lint the schema’s own correctness beyond reporting problems it meets while validating.
Related tools
- OpenAPI to Markdown documents the schemas of an API specification.
- JSON to TypeScript generates types from example JSON.
- JSON Formatter fixes and formats the JSON you paste.
- JSONPath Tester finds values inside a document.
Checked against the current version of the JSON Schema Validator on .

