JSON Schema Validator
Validate a JSON instance against a JSON Schema with Ajv (Draft-07 / 2019-09 / 2020-12, plus OpenAPI modes) — humanized errors, schema lint, coverage, and generated negative cases. Runs in your browser.
Auto-validates as you type. Ctrl+Enter to re-run. Document A is the instance; Document B is the schema.
Need a schema from a sample? Use the Schema Inspector. Need example data that satisfies a schema? Use the Synthetic Data Generator.
How to use the JSON Schema Validator
Validate any JSON payload — an API response, webhook body, fixture, config file, or OpenAPI component example — against a JSON Schema (Draft-07, 2019-09, or 2020-12). Powered by Ajv in the browser, the validator reports precise JSON Pointer error paths, supports $ref resolution, and can infer a starter schema from a sample with the companion Schema Inspector. Use it to test API contracts, confirm fixtures, and harden CI validation.
What it does
- Validates JSON against a schema with full Ajv coverage of keywords (
type,required,enum,pattern,format,oneOf,allOf,anyOf,$ref). - Reports each error with a JSON Pointer path, keyword, and human-readable message.
- Infers a schema from a sample payload as a starting draft via the Schema Inspector.
- Supports Draft-07, 2019-09, and 2020-12; auto-detects via
$schema. - Validates arrays of records, nested objects, and discriminated unions (
oneOfwithconst). - Shows schema lint, coverage, and generated negative cases to harden your contract.
When to use it
- Confirm an API response matches the documented contract before testing further.
- Validate webhook payloads from third parties (Stripe, GitHub, Slack, etc.).
- Test an OpenAPI component schema against real sample data.
- Build contract tests for QA without writing code.
- Lock down configuration files in your CI pipeline.
- Author a new schema by inferring from a representative sample, then tightening it.
How to use it
- Paste your JSON payload on the left and the JSON Schema on the right.
- Pick the schema draft (or leave it on auto-detect via
$schema). - Validation runs automatically — passing payloads show a success indicator; failures list each error with the JSON Pointer path.
- Don't have a schema yet? Use the Schema Inspector to generate a starter draft from your sample, then edit and tighten.
- Copy the report to a ticket, or copy the schema once you're satisfied.
- Send the validated payload to JSONPath Tester for query checks, or use the Schema Inspector to explore structure.
Tips & pitfalls
- Add
"additionalProperties": falseto fail on unexpected fields — most contract bugs sneak in this way. - A field listed in
propertiesis not required by default — add it to therequiredarray explicitly. - Use
format: "date-time","email","uuid"for string validation; enable format checking explicitly. - Draft-07 uses
definitions; 2019-09+ uses$defs. Match the draft your toolchain expects. - For nullable fields, use
"type": ["string", "null"]— there is nonullable: truein standard JSON Schema (that's OpenAPI 3.0 sugar). - For OpenAPI 3.0 schemas, convert
nullable: trueand theexamplekeyword as needed.
FAQ
- How do I validate JSON against a schema online? Paste the JSON and the schema into the two editors. Errors appear instantly with the path and reason.
- Which JSON Schema drafts are supported? Draft-07, 2019-09, and 2020-12. The tool auto-detects from
$schemaor you can pick manually. - How do I generate a JSON Schema from a sample? Use the Schema Inspector on a representative JSON payload — it produces a starting draft you can tighten.
- Why is my "required" field not failing? The
requiredarray must be declared at the object level whose keys it constrains. Putting it inside a property definition has no effect. - Is my JSON or schema uploaded? No. Validation uses Ajv in your browser. Nothing is sent to a server or logged.
- Can it validate OpenAPI component schemas? Yes — paste the component schema and a sample payload, and pick an OpenAPI mode. OpenAPI 3.0
nullable: trueis handled for you.
Related tools
- Validate an agent tool contract in the Agent Debugging & Integration Toolkit.
- Format and validate JSON before checking it against a schema.
- Diff two JSON documents to see what changed between payloads.
- Generate and apply JSON Patch using the JSON Pointer paths in your errors.
- Test JSONPath expressions against a validated payload.
- Convert cURL commands to capture the API response you want to validate.
Use-case guides
Runs locally in your browser. Powered by Ajv. No uploads. No analytics on pasted JSON.
Common tasks solved by this tool
- Validate an OpenAPI example payload
- Validate a JSON request or response against a schema
- Find missing required fields in a payload
- Debug enum and type validation errors
- Infer a starter schema from a sample payload
- Generate a JSON Patch between two versions
Continue in a JSON/API workflow
Chain this into related tools, or build it as a saved workflow in Workflows.
- Format or inspect JSON
- Compare two JSON documents
- Generate and apply a JSON Patch
- Validate the result against a schema — this tool
Part of the JSON and API contract toolkit
Validate schemas, compare JSON responses, generate JSON Patch operations and debug API contract examples with related privacy-first tools.