1. Home
  2. Developer tools
  3. JSON Schema Validator

JSON Schema Validator

Paste a schema and some data and see which rules the data breaks, each with the path to the value. If you only have the schema, generate example data that satisfies it.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use JSON Schema Validator

  1. Paste the schema and the data.
  2. Read the list of errors, or the confirmation that it is valid.
  3. Optionally generate sample data from the schema.

Features

  • Types, required, enum, const, limits, patterns and uniqueness
  • allOf, anyOf, oneOf, not and if/then/else
  • Local $ref and $defs references
  • Format checks for common formats, switchable
  • Sample data that satisfies patterns and limits
  • Lists keywords it does not check

Supported formats

You can open

  • JSON Schema
  • JSON

You get

  • Error list
  • Sample JSON

Private by design

Your files are opened and processed by your browser on this device. They are never uploaded to openWorkstand or anyone else, so the JSON Schema Validator is safe for contracts, IDs, photos and work documents. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • Keywords added after draft 2019-09, such as unevaluatedProperties, are listed as not checked.
  • Remote $ref references are not fetched.

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.

Checked against the current version of the JSON Schema Validator on .

Troubleshooting

The file does not open

Check that it is one of the supported formats above and opens in another app. Damaged files and password-protected PDFs cannot be read until they are repaired or unlocked.

It is slow or stops on a very large file

Everything runs on your device, so speed depends on its memory. Close other tabs, use a computer rather than a phone, or split the file into smaller parts first.

The download did not start

Look for your browser’s download bar or icon. Some browsers ask once before a site may download files; allow it and click the button again.

Frequently asked questions

What do the paths such as /tags or /address/zip mean?

They are JSON Pointers to the value that failed, starting from the root of the data. /tags is the property named tags, and /items/2 would be the third element of an array called items. A single slash with nothing after it means the document as a whole.

Why does a schema with additionalProperties set to false reject my extra field?

Because the keyword closes the object: any property not listed under properties or matched by patternProperties is an error. Remove the keyword, or add the field to the schema, if extra fields should be allowed.

Which schema versions work?

The common keywords of draft-07 through 2020-12. Keywords added later, such as unevaluatedProperties, are listed as not checked rather than ignored silently.

Why not use a standard validator library?

Popular ones compile schemas with eval, which the strict Content-Security-Policy of this site forbids. This page uses its own interpreter.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.