JSON Schema validator: check JSON against a schema
Pick a schema such as package.json, tsconfig.json or OpenAPI, or paste your own on the left. Paste JSON on the right. Each problem shows its line, its path and what the value must be. Nothing is uploaded, and no schema is downloaded.
Schema
emptyJSON
emptyResult
Paste JSON on the right, or drop a file on it.
What a schema check tells you
JSON can parse and still be wrong. A JSON Schema says what a document must hold: which keys, the type of each value, and which values are allowed. This page checks your JSON against one and lists every place it does not match. Each problem has its line, its path, such as $.version, and a sentence that says what the value must be. Click the line to jump to it.
Built-in schemas
Pick one from the list. If your JSON has a $schema that names one, or an openapi version, it is picked for you.
- package.json, for npm. Keys such as
prettierandeslintConfigare checked against their own schemas too. - tsconfig.json. Comments and trailing commas are allowed, as TypeScript allows them.
- composer.json, for PHP.
- appsettings.json, for .NET. Comments and trailing commas are allowed here too.
- OpenAPI 3.0 and 3.1, in JSON form.
- GeoJSON.
- JSON Schema draft-07 and 2020-12, to check a schema itself.
A built-in is read only. Choose Edit a copy to change it. The copy is yours, under Custom. The built-ins come from SchemaStore, Composer, the OpenAPI Initiative, GeoJSON and json-schema.org, and are kept with the site.
Your own schema
Paste it on the left, drop a file on it, or choose Upload schema. Drafts 4, 6, 7, 2019-09 and 2020-12 are read. Everything but tsconfig.json and appsettings.json must be strict JSON: no comments, no trailing commas.
In draft-07 and earlier, format is checked, so "format": "email" rejects "x". In 2019-09 and 2020-12 the standard makes format a note only, so it is not checked.
Nothing is uploaded or downloaded
The check runs in your browser. Your JSON and your schema never leave it. If a schema points to another schema by its URL, that schema is not downloaded. The part behind it is listed under Not checked, and the rest is still checked. If your JSON names a schema that is not built in, the page says so and you can paste it in.
Generate a schema from JSON
Generate from JSON writes a starting schema (draft 2020-12) from the JSON on the right: the type of every value, the keys of every object and the items of every array. Every key is required, unless only some items of an array have it. It is a start. Add limits, patterns and descriptions yourself.
Share a check
Share copies a link that holds your JSON and your schema, or the name of the built-in. They are in the part of the link after #, which browsers never send to a server.
When the JSON will not parse
A document has to parse before it can be checked. These are the parse errors seen most often: