What is JSON Schema Validator?
JSON Schema is a vocabulary that allows you to annotate and validate JSON documents. It defines the structure, types, and constraints that JSON data must follow. This validator checks your JSON data against a JSON Schema definition and reports any violations, helping you ensure data integrity in APIs, configurations, and data pipelines.
How to Use
- Paste your JSON Schema definition in the left panel
- Paste your JSON data in the right panel
- Click Validate to check data against the schema
- Review any validation errors with their paths and messages
- Fix the data and re-validate until all errors are resolved
Why Use This Tool?
Tips & Best Practices
- Start with a simple schema and add constraints incrementally
- Use 'required' to enforce mandatory fields
- Use 'pattern' with regex for email, URL, and custom formats
- Set 'additionalProperties: false' to reject unexpected fields
- Combine with our JSON to TypeScript tool for end-to-end type safety
Frequently Asked Questions
What JSON Schema draft is supported?
This validator supports JSON Schema Draft-07 compatible syntax. It handles common keywords: type, properties, required, items, enum, pattern, minLength, maxLength, minimum, maximum, and additionalProperties. Some advanced keywords (allOf, anyOf, oneOf, $ref) are not yet supported.
How is this different from the JSON Validator tool?
The JSON Validator checks if your JSON is syntactically correct (valid JSON format). This tool validates JSON data against a JSON Schema definition, checking structure, types, and constraints. Think of it as: JSON Validator = syntax check, JSON Schema Validator = semantic check.
Can I validate nested objects and arrays?
Yes. Use 'properties' for nested objects and 'items' for arrays. The validator recursively checks all nested structures and reports the exact path of any error.
What does 'additionalProperties: false' do?
It rejects any properties in the data that are not defined in the schema's 'properties' object. This enforces a strict schema where only explicitly defined fields are allowed.
Can I use regex patterns?
Yes, use the 'pattern' keyword with a regular expression string. Common patterns: email (^[^@]+@[^@]+\.[^@]+$), URL, phone numbers. The pattern must match the entire string value.
How do I validate an array of objects?
Use 'type: array' with 'items' defining the schema for each element. Example: { 'type': 'array', 'items': { 'type': 'object', 'required': ['id'] } } validates that every element is an object with an 'id' field.