JSON Schema Validator & Generator

Validate JSON against draft 2020-12 or draft-07 schemas, or generate a schema from samples.

Runs locally · nothing uploaded
JSON Schema
JSON data

What it does

Validate checks a JSON document against a JSON Schema as you type, using Ajv 8, a widely used JSON Schema validator. Generate schema goes the other way: paste sample JSON and get a starting schema you can refine.

Features

  • Draft 2020-12 and draft-07. The draft is taken from $schema; without one it is guessed from the keywords used ($defs, prefixItems or definitions, tuple items). You can override it.
  • Every error points to its line. Errors list the instance path, the failing keyword, a readable message with the offending value, and the schema path. Click a path to select that line in the JSON or in the schema.
  • Schema problems first. An invalid schema is checked against its meta-schema and reported with clickable paths; unknown keywords (typos like requird) and unresolvable $refs are flagged.
  • Formats such as date-time, date, time, email, uri, uuid, ipv4, ipv6, hostname and duration are validated; switch it off to treat formats as annotations.
  • Strict JSON errors with line and column: trailing commas, comments, single quotes, leading zeros. Duplicate keys are reported too.
  • Generator merges all items of an array, marks properties present in every sample as required, uses type unions for nulls and mixed values, and detects common formats. Optional additionalProperties: false and examples.

How to use it

Paste a schema on the left and your JSON on the right, or drop .json files onto either side. In generate mode, paste an object or an array of samples, then use Validate with it to test the result immediately.

Privacy

Everything runs in your browser. Your schema and JSON are never uploaded, and external $ref URLs are not fetched. The last inputs are kept in your browser’s local storage.