What is JSON Schema Generator & Validator?
JSON Schema Generator and Validator helps you create and validate JSON Schema definitions. The generator examines sample JSON data and produces a schema that describes its structure including property types, required fields, nested object schemas, and array item schemas. The validator checks a JSON document against a schema and reports all validation errors with descriptions of what failed and why.
quickAnswer
Generate JSON Schema from sample data with type inference and required field detection, or validate JSON against an existing schema. Supports Draft 04, Draft 7, and Draft 2020-12. Results show inferred schemas or detailed validation errors.
limitations
- External $ref references are not resolved during validation. The schema and data must be self-contained for validation to work. Use a schema bundling tool to merge multi-file schemas before validating.
- Generated schemas are based on the structure and types present in the sample data. The generator cannot infer constraints like minimum, maximum, pattern, or format -- these must be added manually.
- Schema validation follows the selected draft specification. Features from different drafts cannot be mixed. Draft 2020-12 schemas are not compatible with Draft 04 validators and vice versa.
How to use this tool
- Switch between Generate (create schema from sample data) and Validate (check JSON against a schema) modes.
- In Generate mode: paste sample JSON, select a schema draft (Draft 04, Draft 07, or 2020-12), and click Generate. Review the inferred schema.
- In Validate mode: paste your JSON data on the left and your schema on the right, then click Validate.
- Copy the generated schema or reviewed validation results. Adjust inference options like marking all properties as required.
What you can use it for
- Generate a JSON Schema from sample API response data to document your REST API endpoint contract.
- Validate incoming API payloads against a schema to catch malformed data before it enters your pipeline.
- Create a schema for JSON configuration files to enable IDE autocompletion and validation in editors like VS Code.