JSON Schema Validator
Check JSON data against a JSON Schema.
What Is a JSON Schema Validator?
A JSON Schema validator checks whether a JSON document follows the rules in a JSON Schema like which properties are required, what type each value has, which values are allowed, and how arrays and nested objects are shaped. You can use it to test API payloads, config files and data exports before they reach production.
This validator runs in your browser, your schema and data are not uploaded to Geekflare servers.
How to Use It
- Paste or upload your JSON Schema on the left. If you don't have one yet, create it from a sample with the JSON Schema Generator.
- Paste or upload the JSON data you want to check on the right.
- Leave Schema draft on auto-detect, or pick the draft your schema is written for.
- Select Validate JSON. Each error shows the line in your data, where the problem is, what's wrong and the schema rule that failed. Select a line number to jump to it.
Reading the Errors
| Error | What it means | Usual fix |
|---|---|---|
is missing required property "email" | An object doesn't have a property listed in required | Add the property, or remove it from required if it's optional |
must be integer | The value has the wrong type, such as "1001" instead of 1001 | Change the value's type, or widen type in the schema |
has a property that is not allowed | additionalProperties: false blocks a property the schema doesn't list | Remove the property, or add it under properties |
must match format "email" | A string doesn't match its format | Fix the value, or turn off format checking if format is only a note |
must be one of ... | The value isn't in the enum list | Use one of the listed values, or add the new value to the enum |
must NOT have fewer than 1 items | An array is shorter than minItems | Add items, or lower minItems |
When the location is (root), the problem is with the top-level value itself, such as a missing required property.
Supported Drafts
| Draft | $schema value | Notes |
|---|---|---|
| 2020-12 | https://json-schema.org/draft/2020-12/schema | Current draft. Used when the schema doesn't declare one |
| 2019-09 | https://json-schema.org/draft/2019-09/schema | Adds unevaluatedProperties and $defs |
| Draft 7 | http://json-schema.org/draft-07/schema# | Still common in older tools. Adds if, then and else |
| Draft 6 | http://json-schema.org/draft-06/schema# | Adds const, contains and propertyNames |
| Draft 4 | http://json-schema.org/draft-04/schema# | exclusiveMinimum and exclusiveMaximum are booleans here |
The same schema can behave differently between drafts, so declare $schema in your schemas to keep results consistent across tools.
When the Schema Itself Is Wrong
Before checking your data, the tool checks the schema against its draft's meta-schema. A typo such as "type": "strnig", a keyword with the wrong kind of value, or a $ref that points to another file is reported as a schema problem with its line in the schema, so you don't chase errors in data that's fine.
$ref references inside the same schema work, such as #/$defs/address. References to other files or URLs aren't loaded, so copy those definitions into the schema under $defs.
Tips for Reliable Validation
- Declare
$schemaso every validator reads your schema the same way. - Use
additionalProperties: falseon objects where unknown fields should be rejected, such as config files. - Keep
formatchecks on for user input, and treat them as hints for data you don't control, since validators differ on edge cases. - Test the schema with a few failing examples, not only a valid one, so you know it rejects what it should.