Xerobit

Validator JSON Schema: Check Data Against Rules

Paste your JSON data and a JSON Schema to see every validation error listed with its exact JSON pointer path. This validator json schema tool supports the common draft-07 and 2020-12 keywords including type, properties, required, items, enum, const, minimum, pattern, format, oneOf, anyOf, allOf, if/then/else and local $ref. It runs entirely in your browser, so nothing is uploaded.

The JSON document to check.

A JSON Schema (draft-07, 2019-09 or 2020-12 keywords). Local $ref only.

Result

/: Missing required property 'email'
/age: Value -5 is less than the minimum 0
/tags: Items 0 and 1 are equal but uniqueItems is true
  • Result
    Invalid
  • Errors
    3

How to use the json schema validator

  1. Paste your JSON data into the JSON Data field.
  2. Paste your JSON Schema into the JSON Schema field.
  3. Review the output below for a list of errors with their JSON pointer paths, or a success message if the data is valid.
  4. Fix any reported issues in your data or schema and watch the results update live.

How this validator json schema tool works

A validator json schema tool compares a JSON instance against a set of rules defined in a JSON Schema document. The schema uses keywords like type, properties, required and minimum to describe what valid data looks like. When you paste both documents above, the engine walks the JSON tree recursively.

For example, given the schema {"type":"object","properties":{"age":{"type":"integer","minimum":0}},"required":["age"]} and the data {"age":-5}, the tool visits the root object, confirms it is an object, checks that the required key age exists, then evaluates the value -5 against the nested schema. It finds that -5 is less than the minimum of 0 and reports the error at JSON pointer /age.

Supported JSON Schema keywords

This json validator schema implementation covers the keywords most developers use day to day from draft-07, 2019-09 and 2020-12. It is not a full specification suite. Schemas that use unevaluatedProperties, unevaluatedItems, $dynamicRef, $anchor or references to other files stop with a clear error instead of being validated wrongly.

CategoryKeywords
Type checkingtype (string, number, integer, boolean, array, object, null), enum, const
Numeric limitsminimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf
String limitsminLength, maxLength, pattern, format (email, date, time, date-time, uuid, ipv4, uri, hostname; other formats are not checked)
Object structureproperties, patternProperties, additionalProperties, required, propertyNames, minProperties, maxProperties, dependencies, dependentRequired, dependentSchemas
Array structureitems, prefixItems, additionalItems, contains, minContains, maxContains, minItems, maxItems, uniqueItems
CompositionallOf, anyOf, oneOf, not, if, then, else
References$ref (local pointers only, such as #/$defs/Address or #/definitions/Address)

Using a json validator with schema in practice

When building APIs or configuration files, a json validator with schema saves time by catching structural mistakes before they reach production. Instead of writing manual checks for every field, you define the contract once in a schema and run incoming payloads through it.

Common use cases include validating user-submitted forms serialized as JSON, checking configuration files loaded at application startup, and verifying API responses during integration testing. Because the tool processes everything locally in your browser, it is safe to use with sensitive payloads that should never leave your machine.

Differences from library-based validators

Many teams use established libraries like Ajv in JavaScript or networknt in Java for automated testing pipelines. A browser-based json schema validator java developers might reference conceptually serves a different purpose: quick, interactive debugging without setting up a project or installing dependencies.

Library validators support advanced features like custom formats, asynchronous loading of remote schemas and code generation for maximum throughput. This page intentionally focuses on the core keyword subset so you can paste two text blocks and get immediate feedback. For CI/CD pipelines or high-throughput server validation, integrate a dedicated library instead.

Two limits are worth knowing. The pattern keyword runs your regular expression in the browser, so a badly written pattern with nested repetition can make the tab slow on long strings. Decimal values are compared as decimals, so 0.3 is a multiple of 0.1 here, while some libraries that use floating point division report it as invalid.

Understanding JSON pointer error paths

Every error reported by this tool includes a JSON pointer, which is a standardized path string defined in RFC 6901. The root of the document is shown as /. Nested object keys are appended with a slash, such as /address/street. Array indices use numbers, like /users/0/name.

If the pointer contains ~1, it represents a literal forward slash in the key name. If it contains ~0, it represents a literal tilde. These escape sequences ensure that any valid JSON key can be referenced unambiguously, making it straightforward to locate and fix the exact field that failed validation.

Worked examples

ExampleInputResult
Valid objectJSON Data: {"name":"Ada","age":36}; JSON Schema: {"type":"object","properties":{"name":{"type":"string"},"age":{"type":"integer","minimum":0}},"required":["name"]}Result: Valid; Errors: 0
Missing required fieldJSON Data: {"age":36}; JSON Schema: {"type":"object","properties":{"name":{"type":"string"},"age":{"type":"integer"}},"required":["name"]}Result: Invalid; Errors: 1
Array with invalid itemJSON Data: [1,"two",3]; JSON Schema: {"type":"array","items":{"type":"integer"}}Result: Invalid; Errors: 1
Enum mismatchJSON Data: "red"; JSON Schema: {"enum":["green","blue"]}Result: Invalid; Errors: 1

FAQ

What is a validator json schema?

A validator json schema is a tool that checks whether a JSON document conforms to the rules defined in a JSON Schema. It inspects types, required fields, numeric bounds, string patterns and composition keywords to report any mismatches.

Which JSON Schema drafts are supported?

This tool supports the common keywords shared by draft-07, 2019-09 and 2020-12, including type, properties, required, items, prefixItems, enum, const, numeric and string constraints, allOf, anyOf, oneOf, not, if/then/else and local $ref resolution. Add a $schema line with 2019-09 or 2020-12 to use prefixItems with items.

Is my data sent to a server?

No. The json validator schema logic runs entirely inside your browser. Neither the JSON data nor the schema is uploaded anywhere.

Can I use this as a json validator with schema for API testing?

Yes, for quick manual checks. Paste a sample API response and your expected schema to verify the structure. For automated test suites, use a programmatic library such as Ajv.

How do I reference definitions within the same schema?

Use the $ref keyword with a local JSON pointer. For example, "$ref": "#/$defs/Address" points to a definition stored under the "$defs" key at the root of the schema.

Does this replace a json schema validator java library?

It serves a different purpose. A json schema validator java library runs inside your backend for automated, high-throughput validation. This browser tool is designed for fast, interactive debugging without any setup.

What happens if my JSON is malformed?

If either the data or the schema cannot be parsed as valid JSON, the tool stops and displays a parse error. You can use a dedicated JSON formatter to fix syntax issues first.