toolgarden.xyz
中文

JSON Schema Validator

Free online JSON Schema validator that checks JSON / JSONC / JSON5 data and shows error paths and reasons

JSON / JSONC / JSON5 Data

JSON Schema

Validation Result

Run validation to see results

About this tool

JSON Schema validation walks data against explicit rules and reports each failure with a `$`-based path. The current implementation covers common constraints including type, const, enum, allOf, anyOf, oneOf, string lengths and patterns, selected formats, numeric ranges, array counts and items, required properties, properties, and additionalProperties.

A passing result only means the instance satisfies this schema; it does not prove business meaning is correct. The schema itself needs versioning and tests, especially around oneOf exclusivity, format strictness, and whether extension fields are permitted.

How to use it

  1. Enter the JSON instance

    Put real data on the left. JSONC and JSON5 are parsed into a standard data structure first.

  2. Enter the schema

    Put an object-shaped JSON Schema on the right and check keyword spelling and nesting.

  3. Fix errors by path

    Review expected types, missing properties, and range failures, then validate again after editing.

Input and output example

Errors carry the field path, so you can go straight to what failed.

Schema and data
// schema
{ "type": "object",
  "required": ["id"],
  "properties": { "id": { "type": "integer" } } }

// data
{ "id": "7" }
Validation result
$.id  expected integer, received string

Supported range and limits

Input
A JSON Schema plus the JSON data to check against it
Output
Pass or fail, with the field path and reason for every error
Supported constraints
Types, required, enums, numeric ranges, string length and format, array length, nested objects
Common false pass
A schema that omits required accepts data with fields missing
additionalProperties
Extra fields are allowed by default; set it to false in the schema to reject undeclared ones
Pairs with
Draft with JSON Schema Generator, fill in the constraints, then regression-test several samples here

When you would use it

  • Checking an API request body

    Verify required fields, types, enums, and formats before a payload reaches the backend.

  • Validating a configuration migration

    Use one schema to find missing, unexpected, or out-of-range values after bulk edits.

  • Regression-testing the schema itself

    After changing a schema, run historical samples through it to confirm the new constraints do not reject data that was previously valid.

What to know before you start

  • This is not a complete JSON Schema engine. An unsupported advanced keyword must not be assumed to have been enforced.
  • Format checks include common email, date, date-time, and URI shapes, but a valid shape does not prove a resource exists.
  • oneOf requires exactly one matching branch; matching several branches is also an error.

Related concepts

instance
The actual JSON value being checked by a schema.
additionalProperties
Controls object keys not listed in properties; false is useful for catching misspelled keys.

Frequently asked questions

Can I see why validation failed?
Yes. The tool reports the path and reason for each error, so you can quickly tell whether it is a type mismatch, a missing required field or an out-of-range value.
Which JSON Schema spec is supported?
It supports common JSON Schema Draft versions, useful for validating API responses, config files and other data against an agreed structure.
Does validating upload my data?
No. Both the schema and the data are validated locally in your browser and nothing is uploaded.
Data is clearly missing fields; why did it pass?
Because the schema has no required. JSON Schema treats every property as optional by default, so not declaring required is the same as permitting absence. This is the most common form of "validated but wrong".
How do I reject unexpected fields?
Set `additionalProperties: false` on the object explicitly. Extra fields are allowed by default, so a misspelled key is silently accepted as a new property rather than reported as an error.