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. 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.
- Supports Draft-07, 2019-09, and 2020-12; auto-detects via
$schema.
- Validates arrays of records, nested objects, and discriminated unions (
oneOf with const).
- Copy individual error rows or the full report for tickets, PRs, and contract docs.
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? Click Infer schema to generate a starter draft from your sample, then edit and tighten.
- Copy a specific error 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": false to fail on unexpected fields — most contract bugs sneak in this way.
- A field listed in
properties is not required by default — add it to the required array 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 no nullable: true in standard JSON Schema (that's OpenAPI 3.0 sugar).
- For OpenAPI 3.0 schemas, convert
nullable: true and the example keyword 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
$schema or you can pick manually.
- How do I generate a JSON Schema from a sample? Click Infer schema on a representative JSON payload — the tool produces a starting draft you can tighten.
- Why is my "required" field not failing? The
required array 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. OpenAPI 3.0
nullable: true may need translation to standard type: [..., "null"].
Runs locally in your browser. Powered by Ajv. No uploads. No analytics on pasted JSON.