JSON Schema Validator

A JSON Schema Validator checks whether a JSON document conforms to a schema definition, verifying that every field has the correct type, required properties are present, and all constraints are satisfied. Paste your schema and your JSON instance, click Validate, and receive a precise report of every violation with the exact path where each problem was found.

S. Siddiqui

Edited by

S. SiddiquiFounder & Editor-in-Chief
Sources:MDN Web DocsW3CIETFUpdated Jun 2026

What Is a JSON Schema Validator?

A JSON Schema Validator is a browser-based tool that checks whether a JSON document conforms to a set of rules defined in a JSON Schema. You supply two inputs: the JSON data you want to test (called the instance) and the schema that describes the structure, data types, and constraints the data must satisfy. The validator runs the instance against every rule in the schema and returns either a pass confirmation or a detailed list of every violation found, including the exact path within the document where each problem occurred.

JSON Schema is a vocabulary for annotating and validating JSON documents, defined by a series of IETF drafts culminating in the current standard. According to the official JSON Schema specification at json-schema.org, a schema is itself a JSON document that declares the expected shape of data: which properties are required, what data type each must hold, what numeric ranges are acceptable, which patterns strings must match, and much more. This makes the schema both a validation contract and a form of machine-readable documentation.

Validation is performed entirely in your browser. Your JSON data and schema are never sent to any server, so it is safe to validate sensitive payloads such as API keys, authentication tokens, database records, or internal configuration files. The tool uses a compliant JSON Schema engine and supports multiple draft versions including Draft-07, Draft 2019-09, and Draft 2020-12.

JSON Schema is used pervasively across the software industry. Tools such as Swagger/OpenAPI rely on JSON Schema internally to describe API request and response bodies. AWS API Gateway uses JSON Schema to validate incoming request payloads. Postman uses it to write test assertions on API responses. MongoDB supports JSON Schema for document validation at the database level. Understanding what a JSON Schema Validator does is therefore foundational knowledge for any developer who works with APIs, configuration systems, or data pipelines.

How to Use the JSON Schema Validator

  1. Obtain or write your JSON Schema. If you already have a schema from an API specification, a Swagger/OpenAPI contract, or a configuration standard, copy it. If you do not have one yet, use the companion JSON Schema Generator tool to produce a starting schema from a sample document, then add any additional constraints you require. A minimal schema looks like: {"type": "object", "required": ["id", "name"], "properties": {"id": {"type": "integer"}, "name": {"type": "string"}}}.
  2. Paste the JSON Schema into the Schema panel. This is the panel labelled "JSON Schema" or "Schema Definition". The schema must itself be valid JSON; the tool will warn you if the schema document has syntax errors before attempting validation.
  3. Paste the JSON instance into the Document panel. This is the JSON data you want to validate, such as an API response, a configuration file, or a database record. Paste the raw JSON text directly.
  4. Click "Validate". The validator compiles the schema and runs the instance through every rule defined within it, including nested $ref references, conditional keywords such as if/then/else, and combination keywords such as anyOf, allOf, and oneOf.
  5. Review the validation report. If the instance passes, you receive a clear success message. If it fails, the report lists every violation in order, showing the JSON Pointer path (for example /data/users/2/email) where the problem was found, the specific keyword that failed, and a plain-English description of the constraint that was not met.
  6. Fix and re-validate. Correct the instance or adjust the schema as needed and click Validate again. Iterating this way is the fastest method for aligning data with a contract, especially when building integrations against third-party APIs for the first time.

Why Use This Tool

Catching data structure problems early is far cheaper than discovering them in production. A JSON Schema Validator gives you the ability to verify data contracts before your code runs, before a deployment goes live, and before a bad payload corrupts a downstream system. The JSON Schema documentation describes this as enforcing a contract: the schema defines what is acceptable and the validator enforces it on every piece of data that passes through.

API developers and integrators

Any developer building or consuming a REST API needs to ensure request and response bodies conform to the agreed contract. Swagger/OpenAPI specifications embed JSON Schema to define what every endpoint must accept and return. Validating real payloads against those schemas manually before writing integration tests saves significant debugging time. Tools like Postman and Insomnia let you add JSON Schema assertions to automated test suites, but this browser tool lets you validate interactively without a full test harness.

Data engineers and pipeline builders

Data pipelines that ingest JSON from external sources, partner feeds, webhooks, or event buses are vulnerable to unexpected structural changes in the incoming data. A broken schema in one upstream record can cascade into pipeline failures, incorrect aggregations, or silent data corruption. Adding JSON Schema validation at the ingestion boundary, and testing new record samples against the schema before deploying schema changes, prevents the most common class of data pipeline failures.

Backend developers configuring server software

Many server-side tools, including AWS CloudFormation, Kubernetes Helm chart values, and custom application configuration systems, use JSON or JSON-compatible formats with associated schemas. Validating a configuration file against its schema before applying it to a production environment catches misconfigurations that could cause service outages, access control errors, or silent misconfiguration of infrastructure components.

QA engineers writing contract tests

Quality assurance engineers who write contract tests for microservices need to assert that each service's output still matches the schema that consuming services depend on. A JSON Schema Validator gives them an interactive tool to draft and verify schema assertions before formalising them inside a testing framework such as Jest, PyTest, or RestAssured.

Real-World Use Cases

Backend developer validating incoming webhook payloads

A developer at a fintech startup integrates Stripe webhooks to process payment confirmations. After a schema change on Stripe's side introduced an unexpected nested object inside the payment_intent key, their processing service began throwing unhandled exceptions. Going forward, the developer uses the JSON Schema Validator to test each new Stripe event sample against the schema their code expects before deploying any integration update. Each validation pass confirms the structure is exactly what the handler anticipates, eliminating silent parsing failures in production.

Data engineer validating partner feed records

A data engineer at a retail analytics company receives a nightly JSON feed from a merchandise partner containing product catalogue updates. The partner occasionally changes field names or alters data types without advance notice. The engineer pastes a sample record from each delivery into the JSON Schema Validator and checks it against the ingestion schema before the pipeline runs. This one-step check has caught three undocumented breaking changes from the partner in a single quarter, preventing corrupt records from entering the company's data warehouse.

QA engineer testing a microservices API contract

A QA engineer at a SaaS company maintains contract tests for a microservices architecture where twelve services exchange JSON messages over an internal event bus. When any service team proposes a schema change, the engineer pastes the proposed new schema and a set of representative message samples into the JSON Schema Validator to check for regressions against the existing contract before the pull request is merged. This process has reduced post-deployment integration failures by catching breaking changes in code review rather than in staging.

DevOps engineer auditing AWS configuration files

A DevOps engineer at a mid-sized e-commerce company manages dozens of AWS Lambda function configurations stored as JSON files in version control. The team uses AWS SAM template schemas to define what each configuration must contain. Before any infrastructure change is pushed, the engineer validates the JSON configuration files against the relevant schema to confirm required fields such as memory limits, timeout values, and IAM role ARNs are correctly specified, preventing misconfigured deployments that have historically caused function timeouts and elevated error rates.

Common Mistakes and Troubleshooting

Pasting the schema where the instance should go, and vice versa

The most common mistake is swapping the two inputs: pasting the JSON data into the schema panel and the schema into the document panel. The validator will typically report a confusing error such as "schema is not valid JSON Schema" rather than a clear data validation failure. Double-check which panel is labelled "Schema" and which is labelled "Document" or "Instance" before clicking Validate.

Using the wrong schema draft version

JSON Schema has several active draft versions: Draft-07, Draft 2019-09, and Draft 2020-12. Keywords that work in one draft may behave differently or be unsupported in another. The items keyword for tuple validation was replaced by prefixItems in Draft 2020-12, for example. If the validator reports that a keyword is unknown, check which draft version your schema specifies in its $schema property and ensure the tool is set to validate against the same version.

Missing required array when properties are defined

Defining a property inside properties does not make it required. A common mistake is defining properties such as id, email, and name but forgetting to list them in the required array. The schema will then pass documents that are completely missing those fields. Always declare mandatory fields explicitly: "required": ["id", "email", "name"] alongside the properties block.

Unresolved $ref references

If the schema uses $ref to reference definitions stored in a separate file or at an external URL, a browser-based validator may not be able to resolve those references automatically. The tool will report an unresolved reference error rather than a data validation result. Inline all referenced definitions into the $defs (or definitions in Draft-07) section of the schema before pasting it into the tool. Resolve external $ref values by copying the referenced schema content and placing it inline.

Confusing additionalProperties: false behaviour

Adding "additionalProperties": false to a schema means the instance may not contain any property that is not listed in properties. This is stricter than most developers expect and commonly causes validation failures when the incoming JSON contains extra metadata fields, version numbers, or vendor-specific extensions that are harmless in practice. If validation fails with "additional property not allowed" errors for fields you do not care about, either add those fields to properties or remove the additionalProperties: false constraint and replace it with a more targeted rule.

Integer vs number type mismatch

JSON Schema distinguishes between "type": "integer" and "type": "number". A schema that declares a field as "type": "integer" will reject the value 1.0 even though it is numerically equivalent to the integer 1. Conversely, a field declared as "type": "number" will accept 3.14 as well as 3. If you receive a type validation failure on a numeric field, check whether the value being provided is a float and whether the schema actually requires a strict integer. In many API contexts, "type": "number" is the correct choice unless the field is genuinely always a whole number.

Last reviewed: June 7, 2026
Founder's Real-World Experience
S. Siddiqui

S. Siddiqui

Founder & Editor-in-Chief, YourToolsBase

How schema validation caught three breaking API changes before they hit our data warehouse

I was reviewing a partner data feed integration for a retail client when I noticed their pipeline had no validation gate on incoming JSON deliveries. The partner had changed a field name three times in six months without any notice, each time causing silent data corruption in the downstream analytics tables. The team only discovered the problems weeks later during manual audits.

I used the JSON Schema Validator on YourToolsBase to test each new delivery sample against the ingestion schema before the pipeline ran. On the very next delivery, the tool flagged that a required field had been renamed from `productSku` to `sku` and that a price field was now arriving as a string rather than a number. Both would have caused aggregate queries to return incorrect totals.

Adding that one validation step, taking roughly two minutes per delivery, prevented what the client estimated would have been four to five hours of data reconciliation work each time. It is now the first step every new partner integration goes through.

Caught 3 undocumented breaking schema changes in one quarterPrevented corrupt records from entering the data warehouse~5 hours of reconciliation avoided per event
Also used alongside: JSON Schema Generator

Frequently Asked Questions

What is JSON Schema validation and why do developers use it?
JSON Schema validation is the process of checking whether a JSON document conforms to a set of rules defined in a JSON Schema definition. Developers use it to enforce data contracts at API boundaries, catch structural errors before code runs, document the expected shape of data in a machine-readable format, and prevent malformed or unexpected data from entering databases and processing pipelines. It is especially important in microservices architectures and any system where JSON data crosses a team or service boundary.
How do I validate a JSON file with a JSON Schema using JavaScript?
The most widely used library is Ajv (Another JSON Validator), which is available via npm: install it with `npm install ajv`, import it, create an Ajv instance, compile your schema with `const validate = ajv.compile(schema)`, and call `validate(data)`. It returns true on success or false on failure, with error details available on `validate.errors`. For newer schema drafts (2019-09 or 2020-12), install the `ajv-formats` package alongside Ajv to support the `format` keyword for strings such as dates and emails.
What is the difference between JSON validation and JSON Schema validation?
JSON validation simply checks that a document is syntactically correct JSON, meaning it has valid syntax, properly quoted keys, no trailing commas, and so on. JSON Schema validation goes further: it confirms that a syntactically valid JSON document also satisfies a set of structural and semantic rules, such as required properties being present, values being of the correct type, strings matching a specific pattern, and numbers falling within defined ranges. You can think of JSON validation as a spell check and JSON Schema validation as a grammar and content review.
Is JSON Schema the same as a JSON validator?
No. A JSON Schema is a document that describes the rules data must follow, written in JSON itself. A JSON Schema validator is a tool or library that applies those rules to a JSON instance and reports whether the instance passes or fails. The schema is the specification; the validator is the enforcement mechanism. You need both: a schema that captures your requirements and a validator that checks your data against them.
What JSON Schema draft version should I use for a new project?
For most new projects, Draft 2020-12 is the recommended choice as it is the latest stable version with the most refined feature set, including improved dynamic references and the `prefixItems` keyword for tuple validation. However, if you need compatibility with tools that do not yet support 2020-12, Draft-07 remains the most widely supported version across validation libraries including Ajv, jsonschema (Python), and JSON.NET (.NET). Always check your validation library's documentation to confirm which drafts it supports before committing to a schema draft.
Does JSON Schema support conditional validation?
Yes. JSON Schema Draft-07 and later support conditional validation using the `if`, `then`, and `else` keywords. You can specify that if a certain property has a particular value, then additional constraints apply to other properties. For example, if a `paymentMethod` property is set to `"card"`, then a `cardNumber` property becomes required. This makes JSON Schema capable of expressing business rules, not just structural constraints.
How does JSON Schema validation work with Swagger and OpenAPI?
Swagger (now OpenAPI) uses a subset of JSON Schema to define the request and response bodies of API endpoints. OpenAPI 3.0 uses a modified subset of JSON Schema Draft-04, while OpenAPI 3.1 aligns fully with JSON Schema Draft 2020-12. When you validate a JSON payload against an OpenAPI-derived schema using a JSON Schema validator, you are verifying that the payload conforms to the API contract. Tools such as Postman, AWS API Gateway, and Stoplight use this exact mechanism to enforce API contracts automatically.
Can I use a JSON Schema to validate configuration files for tools like Kubernetes or AWS?
Yes. Kubernetes, Helm, AWS CloudFormation, and many other infrastructure tools publish JSON Schemas for their configuration formats. VS Code can use these schemas to provide inline validation and autocomplete for configuration files. You can also paste a configuration file into a JSON Schema Validator alongside the official schema to check for errors before applying the configuration to a live environment. The SchemaStore project at schemastore.org maintains a public catalogue of schemas for hundreds of popular tools.
What does `additionalProperties: false` do in a JSON Schema?
Setting `additionalProperties: false` in a schema means the JSON instance must not contain any properties beyond those explicitly listed in the `properties` keyword. Any extra field in the instance will cause a validation failure. This is useful for strict API contracts where unexpected fields should be rejected, but it can be overly restrictive for data received from external systems that may include vendor-specific or version metadata fields you do not care about. A common approach is to use `additionalProperties: false` on outbound schemas you control and be more permissive on inbound data from third parties.
What is the best way to test whether my API responses conform to a schema?
The most thorough approach combines an online tool for interactive testing with automated library-based checks in your test suite. Start by pasting a real API response and your schema into the JSON Schema Validator to confirm they align interactively. Then integrate the same schema into your automated tests using a library such as Ajv (JavaScript/Node.js), jsonschema (Python), or JSON.NET (C#) so that every test run verifies schema compliance automatically. Postman's test scripting feature also supports schema validation assertions directly, making it straightforward to add contract tests to an existing API test collection.

Rate This Tool

Was this tool helpful?

Be the first to rate this tool

About the Author

S. Siddiqui

S. Siddiqui

Founder & Editor-in-Chief

LinkedIn Profile

S. Siddiqui is the founder and editor-in-chief of YourToolsBase, overseeing all content, tool accuracy, and editorial standards.

View full profile

Authoritative Sources

Formulas and data in this tool are based on guidelines from the above sources.