Browser-based data contract check
JSON Schema Validator: Check JSON Against a Schema
Use this JSON Schema validator online to validate JSON against a schema, check required fields, types, ranges, and supported formats. Each mismatch appears beside its data path.
This JSON Schema validator runs in your browser. Choose Draft-07 or Draft 2020-12, validate an example, then use the result to review the API response or configuration you are working on.
JSON Schema validator
Check a JSON value against a contract
Add JSON and a schema to begin.
Use one JSON schema document. Local references can resolve inside the supplied schema.
Objects, arrays, strings, numbers, booleans, and null can be checked when the schema allows them.
Validation result
How to Use an Online JSON Schema Validator
A JSON Schema describes the shape and rules of a JSON value. This validator checks the value you provide against that contract, then lists every problem the selected schema engine can report in one run. It does not rewrite your data or guess the intended schema.
- Choose the schema draft. Select Draft-07 or Draft 2020-12 to match the document. If your schema declares a
$schemaURI, choose the same draft. - Paste the schema. Add a JSON object or boolean schema to the left editor. The schema defines accepted types, fields, value ranges, and other constraints.
- Paste the data. Add the JSON value to the right editor. It can be an API response, a configuration object, a test fixture, or another JSON value.
- Run validation. Select Validate JSON. A valid result means the value passed the supplied schema checks. A failed result lists instance paths and the keyword that rejected each value.
- Fix and check again. Change the data or schema in the editors, run the check again, and verify the final payload in the application or test suite that will consume it.
Select Load example to see a schema with a required name, an email format, and a non-negative age. The matching data passes. Change the age to a negative number or remove the name, then run the validator again to see how the error path and message change.
JSON Syntax Validation vs. Schema Validation
Parsing and schema validation answer different questions. A document can be valid JSON but still violate the contract expected by an API. For example, {""age":"adult"} is valid JSON. It fails a schema that requires age to be a number with a minimum value of zero.
| Check | Question answered | Typical failure | Next step |
|---|---|---|---|
| JSON syntax | Can a JSON parser read the text? | Missing comma, invalid quote, or unmatched brace | Correct the text, then parse it again |
| JSON Schema | Does the parsed value meet a defined contract? | Missing field, wrong type, disallowed value, or range violation | Review the reported path and the schema rule |
| Application rules | Does the value make sense for this product or service? | A valid format with an unknown account or unavailable resource | Run the application's own tests or API checks |
The tool parses both editors as JSON before applying the schema. If either document has a syntax error, validation stops and reports which input needs correction. For formatting or syntax-only checks, use the JSON Formatter; for compact output, use the JSON Minifier. Neither page claims to validate required fields or business rules.
Supported JSON Schema Drafts and Keywords
Select the dialect used by the schema rather than assuming that every draft has identical keywords. Draft-07 is common in existing API contracts and tooling. Draft 2020-12 is a later specification with updated behavior for arrays and vocabulary. This page includes separate validator implementations for both choices.
| Schema group | Examples | What it can express |
|---|---|---|
| Types and values | type, enum, const | Allowed JSON kinds and exact permitted values |
| Objects | properties, required, additionalProperties, minProperties | Named fields, required keys, and object size or extra-key rules |
| Arrays | items, minItems, uniqueItems, prefixItems | Item schemas, length constraints, uniqueness, and tuple-style rules in 2020-12 |
| Numbers and strings | minimum, maximum, minLength, pattern, format | Numeric boundaries, text length, regular-expression patterns, and common formats |
| Composition and references | allOf, anyOf, oneOf, not, $ref | Reusable and combined constraints, including references resolved within the schema |
Format checks use the bundled Ajv formats package. A schema may still be accepted while expressing rules that your service does not implement, so compare the supported dialect and formats with the official JSON Schema documentation. This page does not download remote schemas: an external $ref cannot be fetched here.
How to Read JSON Schema Validation Errors
When a value fails, start with the instance path. A path such as /users/1/email points to the email property of the second item in a users array. The root path / means the overall value failed a rule. The keyword column names the kind of constraint, such as required, type, minimum, or format.
Each error also includes a short message and schema path. The schema path points to the rule that produced the result, which helps when the same data field is checked by several nested schemas. If a required property is missing, the instance path often points to its parent object because the absent property has no value of its own.
Validation output is diagnostic, not an automatic repair. A number type error should not be fixed by blindly converting every string to a number; the correct change depends on the API contract. Check whether the schema is accurate, whether the payload uses the right field name, and whether the selected draft matches the declared $schema.
Invalid JSON, Invalid Schema, and Invalid Data
The page separates three states. Invalid JSON means the schema or data text could not be parsed. Invalid schema means the schema engine could not compile the supplied schema, for example because a reference cannot be resolved or the selected draft conflicts with its declaration. Invalid data means the schema was usable but one or more rules did not match. A passing result only describes the supplied schema; it does not prove that the application will accept the value.
When to Test JSON Against a Schema
Review an API Response
Compare a response with the published contract before writing client-side code. A required field may be absent, a number may arrive as a string, or an array may contain a value the endpoint does not allow. The path-based result is useful when a response has several nested objects.
Check a Configuration or Fixture
Validate a small JSON configuration before a service reads it, or inspect a fixture used by a test. Schema rules can catch misspelled keys, invalid enum values, and values outside an expected range. Keep the original file under version control and run the project's own checks before replacing it.
Compare a Payload with a Shared Contract
Teams often share a JSON Schema between services, tests, and documentation. This online JSON Schema validator can check one value against a pasted copy of that contract. It does not discover which schema a service uses; confirm the contract version and draft in your repository or API documentation.
For a front-end example that needs to render a response rather than validate its shape, continue to the online HTML compiler. If the source is already valid JSON and only needs readable indentation, use the JSON formatter; if it needs compact whitespace, use the JSON minifier.
Privacy, Limits, and Validation Scope
The validator library is bundled with this page and runs on the device. It does not send either editor's contents to a validation endpoint. The site itself also loads analytics and advertising scripts, so this tool is not a promise of confidentiality or compliance. Do not paste passwords, access tokens, personal records, or regulated production data into any online tool unless your organization allows that use.
Each input is limited to 250,000 characters. Very large documents may make a browser tab slow because parsing and validation use memory on the current device. For large files, repeated checks, CI pipelines, or confidential fixtures, use a validator in your local development environment or build process.
The tool validates one schema and one JSON value at a time. It does not fetch files, make network requests for remote $ref values, validate OpenAPI documents as a whole, call an API, or enforce rules that only exist in application code. It also does not migrate a schema between drafts. When the schema declares its draft, choose the matching selector value and verify the result with the same library or tests used by the target service.
For implementation details and supported JSON Schema behavior, consult the Ajv documentation and the official JSON Schema guide. These sources describe the standard and validator engine; the page is a convenient check for pasted input.
JSON Schema Validator FAQ
What does a JSON Schema validator do?
It checks whether a JSON value matches a schema contract. The schema can describe types, required properties, allowed values, number limits, text patterns, array items, and other supported constraints.
How do I validate JSON against a schema online?
Choose the schema draft, paste the schema and data into their editors, then select Validate JSON. Review the instance paths and keywords in each reported error, correct the data or schema, and run the check again.
How can I test JSON Schema with sample data?
Paste the schema and a representative JSON value, choose the matching draft, and select Validate JSON. Test several values in your test suite so it covers both accepted data and common failure cases.
Which draft should I choose?
Use the draft declared by the schema's $schema URI or required by your project. Draft-07 and 2020-12 differ in some vocabulary and array behavior, so changing the selector does not convert the schema.
Does this online JSON Schema validator support remote references?
No. The page does not make network requests to retrieve external schema files. References that resolve within the supplied schema can work; remote references need to be bundled or checked in your own environment.
Is this the same as a JSON formatter or syntax validator?
No. A JSON parser checks whether the text is valid JSON. A schema validator checks whether a parsed value matches a contract. Use the JSON Formatter for indentation and syntax-only errors.
Is my data uploaded when I use this validator?
The validation code runs in the browser and does not post editor contents to a validation API. The site loads analytics and advertising scripts, however, so avoid secrets and sensitive records in online tools.
What happens when my JSON Schema is invalid?
The tool reports a schema or compilation error separately from a data mismatch. Check that the schema itself is valid JSON, that its references resolve locally, and that its declared draft agrees with the selector.
Validate the Contract, Then Test the Application
Use a JSON Schema validator to check structure and supported constraints before relying on a payload. A passing result is useful evidence for that schema, but application logic, authorization, API behavior, and production tests still need their own checks. For readable JSON source, continue to the JSON Formatter; for compact JSON text, open the JSON Minifier.