JSON Schema Validator
Validate JSON against a JSON Schema (type / properties / required / items / enum / numeric & length limits / additionalProperties).
Validate JSON data against JSON Schema rules
What is JSON Schema validation?
JSON Schema validation matches JSON data against a set of Schema rules to check whether its structure and content meet predefined requirements. For example, a Schema can require a field to exist, specify that a field must be a string or number, define the structure of array items, and set constraints for numeric or string values.
What are JSON and Schema?
Enter the JSON data to validate on the left and the JSON Schema on the right. JSON is the actual data, while Schema describes the data structure and constraints. Both are provided separately, and the tool validates the JSON according to the Schema.
Common Schema rules
Common rules include type for specifying data types, required for required properties, properties for describing object fields, and items for describing array elements. Other value constraints include enum, const, minimum, maximum, minLength, and maxLength. The exact supported range depends on the validator implementation used by the page.
How to read validation results
A successful validation means the current JSON data conforms to the provided Schema rules. When validation fails, the result area lists the locations and reasons for violations, making it easier to identify missing fields, type errors, or values that do not meet constraints. When investigating an error, first check the path and then review the corresponding Schema rule before modifying the JSON data.
How does required work in JSON Schema?
required specifies properties that must exist in an object. For example, a Schema with required: [\"name\"] requires the JSON object to contain a name property. Note that required checks whether a property exists; it does not determine the property's value type or whether the value can be empty. Those rules should be defined with type and other keywords under properties.
properties and additionalProperties
properties describes specific fields in an object. For example, name can be defined as a string and age as a number. additionalProperties controls whether properties not defined in the Schema are allowed. If unknown fields should be prohibited, the corresponding object Schema can explicitly define that rule.
How to validate a local JSON file
Switch to the file upload tab and select local files separately for the JSON data and Schema. The files are read in the browser and used for validation, making it suitable for checking local configuration files, API data, or other JSON documents. The maximum file size is shown on the page.
How to troubleshoot validation failures
If the result reports a JSON syntax error, first confirm that the input itself is valid JSON. If the JSON parses successfully but Schema validation fails, use the error path to inspect the corresponding field. Common issues include missing required properties, type mismatches, array items that do not satisfy items, enum values that are not included in the enum list, and numeric or string values outside their defined constraints.
What is JSON Schema validation used for?
JSON Schema is commonly used for API data validation, configuration checks, frontend and backend data contracts, batch processing, and development testing. Defining the expected data structure first and then validating actual JSON against the Schema can identify structural and field-level problems before the data enters a later processing stage.
How do you validate JSON with JSON Schema?
JSON Schema describes the structure and constraints of JSON data using rules. During validation, the actual JSON data is matched against the Schema to check whether its fields, types, arrays, and other constraints conform to the rules.
When validation fails, use the reported error path and reason to locate the specific field, then update the JSON data or Schema rule as needed.
- Validate JSON data against JSON Schema rules to check structure and field constraints
- Supports common Schema rules including type, required, properties, and items
- Checks common constraints such as enums, numeric ranges, and string lengths
- Shows error locations and reasons when validation fails, making specific fields easier to locate
- Supports entering or uploading JSON data and Schema files separately
- Everything runs locally in the browser, and input data is not uploaded to the server