How to validate JSON against a schema
- Paste your JSON Schema on the left and the JSON to check on the right, or open files.
- Pick the draft if your schema does not declare one with $schema.
- Read the result under the editors. Each error lists the path, what is wrong, and the line.
- No schema yet? Paste a sample and press "Generate schema from the JSON".
To tidy or check the syntax of a document first, use the JSON Formatter. To turn JSON into types for your code, try JSON to TypeScript.
Questions
Is my JSON or schema uploaded?
No. Validation runs in your browser with Ajv, a widely used JSON Schema library. Neither your data nor your schema is sent anywhere, so it is safe for private API payloads.
Which JSON Schema versions are supported?
Draft-07, draft 2019-09, and draft 2020-12. If your schema has a $schema keyword for one of them, the tool uses that draft. Otherwise it uses the one you choose.
How are the error locations shown?
Each error shows the JSON Pointer to the failing value, for example /users/0/email, the keyword that failed, and the line number in your JSON. A missing required property points at the object that lacks it.
Does "format" validation work?
Yes. The common formats such as email, uri, date, date-time, uuid, and ipv4 are checked with ajv-formats. Formats the library does not know are ignored rather than failing.
How good is the generated schema?
It is a starting point. The tool reads your sample and writes the types, nested properties, required keys, array item types, and common formats. Add limits such as minimum or pattern by hand, since one sample cannot tell the tool what is allowed.
Credits
Built on Ajv (MIT) and ajv-formats (MIT). OneTooling is not affiliated with these projects.