Report

Help us improve this tool

JSON Schema Validator

Validate JSON documents against a JSON Schema in your browser. See every error with its JSON path, keyword, and message, with draft-07 keyword and format support.

O M T

What Is JSON Schema?

JSON Schema is a vocabulary for describing the shape of JSON data. Instead of hoping that an API response, configuration file, or message payload looks the way you expect, you write a schema that states the rules: which properties are required, what type each value must have, the allowed range for numbers, acceptable patterns for strings, and how arrays should be constrained. Schemas are themselves written in JSON, so they travel with your data and can be version controlled like any other file.

This validator checks a JSON document against a schema and reports every violation with its instance path, the keyword that failed, and a plain description of the problem. Validation runs entirely in the browser with the Ajv library, so proprietary API payloads and internal configuration never leave your machine.

What Gets Validated

The validator implements JSON Schema draft-07, the most widely deployed draft, and recognizes the keywords you will meet in everyday schemas:

  • Structure: type, properties, required, additionalProperties, minProperties, maxProperties.
  • Strings: minLength, maxLength, pattern, and formats such as email, date-time, uri, uuid, and ipv4.
  • Numbers: minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf.
  • Arrays: items, minItems, maxItems, uniqueItems, contains.
  • Values: enum, const.
  • Logic: allOf, anyOf, oneOf, not, and conditional if / then / else.

Keywords that the validator does not recognize are ignored rather than treated as errors, so schemas written for other drafts will still validate the parts they have in common.

Reading the Error Report

When validation fails, every problem is listed separately instead of stopping at the first one. Each row contains three pieces of information:

  • Instance path points at the exact location in your data using JSON Pointer notation. The root document is /, the second tag in an array is /tags/1, and a nested field is /shipping/city.
  • Keyword names the rule that failed, such as required, type, or format.
  • Message describes the failure in human terms, for example "must have required property 'email'" or "must be integer".

A document with several mistakes produces several rows, which makes fixing a batch of data faster than correcting one error at a time.

Common Use Cases

  • API contracts. Validate sample requests and responses against the schema that documents them, catching drift between the documentation and the implementation.
  • Configuration files. Check that deployment configuration, feature flags, or CI settings match the expected structure before anything reaches production.
  • Data pipelines. Verify that records produced by an export or transformation job conform to the schema consumers expect.
  • Form and code generation. Schemas feed generators for forms, TypeScript types, and validation libraries, and testing the schema first catches structural mistakes early.
  • Learning JSON Schema. Watch how each keyword reacts as you change the data, which is faster than reading the specification alone.

How to Use This Validator

  1. Paste the JSON document you want to check into the left panel. You can also upload a .json file.
  2. Paste the JSON Schema into the second panel. The built-in sample shows a typical object schema with required fields, an enum, an email format, and array constraints.
  3. Validation runs instantly as you edit either panel. Fix the schema or the data and the results update in place.
  4. Read the error table for paths and messages, then copy or download corrected data as needed.

Tips for Writing Schemas

  • Start by adding "required" for the fields that must always exist; most real world failures are missing properties.
  • Use "additionalProperties": false to catch typos in key names, but remove it when your consumers forward unknown fields.
  • Prefer enum over free strings for fields with a known set of values.
  • Add format constraints for emails, dates, and URIs so obviously wrong values fail before they reach application code.
  • Use anyOf or oneOf sparingly. Deep composition makes error messages harder to act on.

Privacy

Parsing, compilation, and validation all run locally in your browser. The document and schema are never uploaded or stored, which matters when you are checking internal API contracts or configuration that contains infrastructure details. The tool works offline after the page loads.

Frequently Asked Questions

Which JSON Schema drafts are supported?

The validator implements draft-07, which covers the keywords supported by the overwhelming majority of published schemas, including type, required, properties, items, enum, pattern, numeric ranges, string lengths, and combinators such as allOf, anyOf, oneOf, and if / then / else. Draft-specific keywords outside that set are ignored rather than reported as errors.

Which format values are validated?

Standard formats such as email, date, time, date-time, uri, uri-reference, hostname, ipv4, ipv6, uuid, regex, and json-pointer are validated using the official Ajv formats plugin. You can see them fail by changing the sample email to an invalid value.

Why do I see multiple errors for one problem?

Combinators such as anyOf and oneOf necessarily produce several candidate failures when none of the branches can match. The validator reports all of them, including the deepest failures, so you can decide which branch the data was meant to satisfy.

What does the instance path mean?

Instance paths use JSON Pointer notation and point into your data, not the schema. The root is /, an array element is addressed by index such as /tags/0, and nested objects use segments such as /shipping/city. Copy the path and search for it in your JSON to jump straight to the failing value.

Can the validator generate a schema from my JSON?

This tool validates only. To create a starting schema from sample data, use the JSON to JSON Schema Generator, then refine the generated schema here. For typed output in other languages, the JSON to Zod and JSON Schema to TypeScript tools are natural follow-ups.

Is my data uploaded anywhere?

No. Ajv compiles and runs the schema entirely in your browser. Nothing is transmitted, stored, or logged, and the tool continues to work without an internet connection once loaded.

Related Tools

Continue your JSON workflow with these tools: