JSON Schema Validator

Paste a JSON Schema and the JSON you want to check. Every mismatch is listed in plain words with its JSON Pointer, line and column, and nothing leaves your browser.

Checking…

Your schema and data are checked in your browser and never uploaded. References to other files ($ref to a URL) aren't downloaded.

How to use it

  1. Paste your schema in the first box and the JSON to check in the second, or open them as files.
  2. Leave the draft on “From $schema” or pick one by hand.
  3. Read the result: each error shows where it is (tap the line number to jump there in the box) and what the schema expected.

What it checks

  • Every validation keyword of drafts 04 to 2020-12: types, required and additional properties, enums and const, numbers and lengths, patterns, array items, uniqueness, if/then/else, allOf/anyOf/oneOf/not, $ref and $defs, and unevaluated properties and items.
  • The schema itself: a keyword with a wrong value, such as "type": "integr", and keywords the draft doesn't know, which are usually typos.
  • Syntax first: if either box isn't valid JSON, you see the line with a ^ under the mistake, as in our JSON formatter.

Example

The sign-up schema loaded above needs a name, an email and an age of at least 18. The data has "email": "asha.rao.example.com" and "age": 17, so the validator reports 2 errors: /email (line 3, column 12) isn't a valid email address, and /age (line 4, column 10) must be at least 18 but is 17. Change the email to [email protected] and the age to 18 and it says the data is valid.

Make a schema from your data

No schema yet? Paste a sample of your JSON and press “Make a schema from this data”. You get a draft 2020-12 schema with each value's type, the keys of each object marked required, arrays described by their items, and common formats (email, date, date-time, URI, UUID) spotted. Tighten it by hand: add limits, enums and "additionalProperties": false, and drop keys from required that may be missing.

Validation uses the open-source json-schema-library (MIT licence), which reads the schema step by step instead of generating code, so nothing you paste is ever run.

Frequently asked questions

Which JSON Schema draft should I use?

Use the one your other tools expect. Draft 2020-12 is the current version and the one OpenAPI 3.1 uses; many editors and older libraries still expect draft-07. The validator reads the $schema line of your schema and follows that draft. With no $schema it uses 2020-12, and you can pick any draft by hand.

Why does my schema let wrong data through?

The usual reasons: a keyword with a typo ("propertes", "requird") is ignored, so the validator lists keywords the draft doesn't know; extra keys are allowed unless you set "additionalProperties": false; and a property is optional unless it's listed in "required".

Are formats like email, date and URI checked?

Yes: date, time, date-time, duration, email, hostname, IPv4, IPv6, URI, URI reference, UUID, regex and JSON Pointer values are checked. Since draft 2019-09 the standard treats format as a note unless a validator chooses to check it, so another tool may let a bad email through where this one reports it.

Does it follow $ref to other files or URLs?

It follows references inside the schema you paste, such as #/$defs/address, including $anchor and $dynamicRef. It never downloads a URL: a $ref to another file is reported as unresolved. Copy that schema into $defs and point the $ref there instead.

Is my JSON uploaded?

No. The schema and data are checked by code running in your browser tab, so API responses, configs and test data stay on your device.

More text and developer tools

See all text and developer tools →

Can't find the tool you need? Tell us, and the most requested tools get built first.