JSON Schema Validator & Generator
Validate JSON against Draft 2020-12 with field-level errors, or infer a reviewable starting schema from sample data—entirely in your browser.
JSON document
The JSON value to validate
JSON Schema
A Draft 2020-12 schema
Validation results
Field-level schema failures
Provide a JSON document and Draft 2020-12 schema, then validate.
Sample JSON
Representative data used to infer a schema
Inferred schema
A Draft 2020-12 starting schema
Load representative JSON, then generate a starting schema.
Validate JSON against a schema
Paste a JSON document beside its schema, then validate. Each failure identifies the document path, the JSON Schema keyword that failed, and a readable explanation so you can correct the field rather than search through a generic error dump.
Understand field-level validation errors
A missing email can appear as $.email — Required field is missing, while an age below a minimum points to $.age and explains the accepted boundary.
The report can be copied or downloaded for debugging, tests, and contract reviews.
Generate a starting schema from JSON
Generation infers objects, arrays, strings, booleans, nulls, integers, and numbers from the values it can observe. For arrays of objects, it combines observed properties and marks only fields present in every sample item as required.
The result is deliberately labelled an inferred starting point. A sample cannot reveal every optional field, enum, pattern, limit, or business rule.
Draft 2020-12 support and limits
The validator uses JSON Schema Draft 2020-12. Local fragment references inside the supplied schema are supported; external references are rejected and never fetched. The shared editor may load fixed interface assets from jsDelivr, but document and schema inputs stay in browser memory. Schemas declaring another dialect are rejected instead of being interpreted silently.
JSON Schema questions
- Which JSON Schema version is supported?
- The workbench validates JSON Schema Draft 2020-12. If $schema is omitted, the schema is interpreted as Draft 2020-12.
- Is a generated JSON Schema production-ready?
- No. Generation infers types and observed structure only. Treat the result as a starting point and review required fields, constraints, formats, and business rules.
- Can the validator load remote $ref schemas?
- No. Local fragment references such as $defs work inside the supplied schema, but external references are rejected and never fetched. The shared code editor may load its fixed interface assets from jsDelivr; document and schema inputs are not sent there.
- Are JSON documents or schemas uploaded?
- No. Validation and schema inference run in browser memory, and inputs are not sent to a PayloadHarbor application backend.
What this JSON Schema does
Use this JSON Schema Validator and Generator to validate JSON documents against JSON Schema Draft 2020-12 or infer a starting schema from representative sample data. Validation reports the exact instance path, failed keyword, and readable rule explanation without uploading either document.
When developers use it
- Check API requests, responses, webhook payloads, and configuration objects against an explicit data contract.
- Locate missing fields, incorrect types, format failures, and constraint violations by JSON path.
- Generate an editable starting schema from representative JSON before adding business-specific constraints.
Privacy, input, and output
JSON documents and schemas are parsed, validated, and inferred in your browser session. PayloadHarbor does not execute requests or upload the inputs to an application backend.
Validation mode accepts a JSON document and a Draft 2020-12 schema, then returns field-level results. Generation mode accepts representative JSON and emits a formatted Draft 2020-12 starting schema for review, copying, or download.
Validation rules and limitations
- The validator supports JSON Schema Draft 2020-12. An omitted $schema is interpreted using that dialect; schemas declaring another dialect are rejected clearly.
- A generated schema describes values observed in the sample. It cannot infer unobserved optional fields, business rules, enums, numeric limits, string patterns, or authoritative requirements.
- Generated schemas are inferred starting points and must be reviewed before production use.