Skip to content
JSON Tidy

JSON Schema validator

Check whether JSON matches a JSON Schema. Each problem is explained in plain English and linked to its line, so you can find it quickly. You can also generate a starting schema from sample data. Everything runs in your browser.

JSON Schema

JSON data

How to use it

  1. Paste your schema on the left and the JSON you want to check on the right, or open them from files.
  2. Choose Validate. You’ll either see that the data is valid, or get a list of problems in the order they appear.
  3. Choose a problem’s line number to jump to it in the data.

Don’t have a schema yet? Paste some sample data and choose Generate schema from data. To see how errors are reported, choose Example. It loads a sign-up request with six deliberate mistakes, and a link to a corrected version that passes.

Reading the results

Each problem shows the line, the location as a JSON Pointer, and what’s wrong. A pointer lists the path from the top of the document: /tags/1 is the second item in tags, because array positions start at 0, and (root) means the whole document.

One value can produce several problems. When a schema offers choices with anyOf or oneOf, you’ll see why each choice failed, followed by a summary line. Usually one of those explanations points to the real mistake.

If the schema itself is broken, for example a misspelled type such as "integr", the tool reports that instead and doesn’t check the data. Invalid JSON in either box is reported with the parser’s message. For help with those, see JSON parse errors.

Supported drafts and formats

The draft is taken from the schema’s $schema value. Draft 2020-12, draft 2019-09, and draft-07 are supported, and draft-06 schemas are checked with draft-07 rules. Without a $schema, draft 2020-12 is used. Draft-04 isn’t supported.

The format keyword is enforced for date-time, date, time, duration, email, hostname, ipv4, ipv6, uri, uri-reference, uuid, regex, json-pointer, and a few others. The JSON Schema specification lets validators treat format as a description only, so another validator might accept a value that this one rejects.

$ref works for definitions inside the same schema, such as #/$defs/address. References to other files or URLs aren’t loaded, so copy those definitions into $defs. Keywords the validator doesn’t recognize are ignored, as the specification recommends.

Generating a schema from JSON

The generator writes a draft 2020-12 schema that accepts your sample. It records each value’s type, and marks a property as required when it appears in every object of that kind. Strings that look like dates, times, email addresses, URLs, or UUIDs get a matching format. Arrays with mixed contents get a combined item type.

Use the result as a starting point. A sample can’t show every rule, so add constraints such as minLength, minimum, and enum yourself. You should also decide whether extra properties are allowed; the generated schema allows them.

Privacy and limits

The schema and data are checked in your browser with Ajv, a widely used open-source JSON Schema validator. Neither is uploaded. Share links store both documents after the # in the URL, which browsers don’t send to servers, but anyone you give the link to can read them. Each box accepts up to 2 MB.

Learn how to write JSON Schema, with examples of each keyword