JSON Schema Validator

Paste a schema and a JSON document to see whether it is valid and exactly where it fails. You can also create a starting schema from an example document.

  • Runs in your browser. Nothing is uploaded
  • Free, no sign-up
  • Works offline once opened
  1. /orderIdMust match the pattern ^ORD-\d{6}$.#/properties/orderId/pattern
  2. /customer/emailIs not a valid email.#/properties/customer/properties/email/format
  3. /items/1/qtyMust be at least 1.#/properties/items/items/$ref/properties/qty/minimum
  4. /couponProperty "coupon" is not allowed.#/additionalProperties

Paths are JSON Pointers: /items/1/qty means the qty field of the second item. References to other files or URLs are not fetched.

Your files stay here

  • JSON Schema Validator runs inside this browser tab.
  • Nothing is sent to a server, so there is nothing to delete later.
  • Close the tab and it is gone from DeskTray.

Often used next

Guide

JSON for Beginners: Read, Format, Validate and Convert It Read the guide

How to validate JSON against a schema

  1. Paste your JSON Schema on the left and the JSON data on the right.
  2. Pick the draft, or let the $schema keyword decide.
  3. Read the list of errors with their paths, or generate a schema from the data.

Features

  • Draft 2020-12, 2019-09 and draft-07
  • Every error with JSON path and the schema keyword
  • Formats: email, uri, date, date-time, uuid, ipv4 and more
  • $ref to #/$defs, #/definitions and anchors
  • Schema generator from sample JSON
  • Line numbers for JSON syntax errors

Reading the error list

Each error has three parts. The path is a JSON Pointer into your data: /items/1/qty is the qty field of the second item (counting starts at 0), and an empty path means the whole document. In a pointer, a slash inside a key is written ~1 and a tilde ~0. The message says what is wrong, and the grey text is the schema path of the rule that failed; for the qty error in the sample it ends in /properties/qty/minimum.

The sample shows four typical failures: the order number has five digits where the pattern asks for six, the email has no @, the second item has qty 0 against a minimum of 1, and coupon is rejected because the schema sets "additionalProperties": false. Fix the data, or relax the schema, until the result turns green.

Mistakes that make schemas let bad data through

  • properties only describes fields; it does not make them compulsory. List mandatory fields in required, or a missing field passes silently.
  • "additionalProperties": false sees only the properties declared next to it. Used together with allOf, fields defined in the other branches count as extra. In 2019-09 and 2020-12, use "unevaluatedProperties": false instead.
  • The drafts differ: draft-07 uses definitions and an array form of items for tuples, while 2020-12 uses $defs and prefixItems. Set $schema so every validator applies the same rules.
  • date-time needs a time zone. 2026-10-22T10:15:00+05:30 passes and 2026-10-22T10:15:00 fails. Python’s datetime.isoformat() leaves the offset out unless the datetime carries a time zone.
  • Store PIN codes, phone numbers and account numbers as strings with a pattern, such as ^[1-9][0-9]{5}$ for a PIN code or ^[A-Z]{4}0[A-Z0-9]{6}$ for an IFSC code. As numbers they lose leading zeros and can’t hold spaces or +91.

Guides

Frequently asked questions

Which keywords are supported?

type, enum, const, properties, required, additionalProperties, patternProperties, propertyNames, min/maxProperties, items, prefixItems, additionalItems, contains, min/maxContains, uniqueItems, min/maxItems, min/maxLength, pattern, format, minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, allOf, anyOf, oneOf, not, if/then/else, dependentRequired, dependentSchemas, dependencies, unevaluatedProperties/Items (basic), $ref and $defs/definitions.

Which formats are checked?

email, uri, uri-reference, date, time, date-time, duration, uuid, ipv4, ipv6, hostname and regex. Unknown formats are ignored, as the specification allows.

Can it follow $ref to other files or URLs?

No. References inside the same schema (#/$defs/…, #/definitions/…, JSON pointers and $anchor) work. Remote references are reported as errors because nothing is fetched from the internet.

How good is the generated schema?

It describes the types and keys in your sample and marks every key as required. Treat it as a starting point: relax required fields, add formats and limits that match your data.

Why does my API accept data that fails here?

This tool checks format by default, while many validators check it only when you enable it or add a plugin, such as ajv-formats for Ajv, because 2019-09 and later treat format as a note. Untick “Check formats” to see what such a validator would say. A different draft or a missing additionalProperties rule on the server are the other usual reasons.

How do I allow null for a field?

Give the field a list of types, such as "type": ["string", "null"], or use anyOf with {"type": "null"}. nullable: true comes from OpenAPI 3.0 and is not a JSON Schema keyword, so it is ignored here; OpenAPI 3.1 uses plain JSON Schema 2020-12.

More Developer tools

All 33 Developer Tools