A valid document
Illustrative examplename and age are present, age is an integer and email is an optional string, so the document conforms to the schema.
{ "name": "Alice", "age": 30, "email": "[email protected]"}Valid JSON syntax doesn’t always mean valid application data.
Captain JSON’s JSON Schema Validator helps you validate JSON documents against defined schemas and identify data structure or constraint violations.
Check required fields, property types, and schema rules before using JSON data in your APIs, applications, and integration workflows.
Part of the Captain JSON toolkit — 20+ JSON tools in one extension.
Example: a document that breaks its schema
Illustrative example{ "name": "Alice", "age": "thirty", "email": "[email protected]"}Your JSON toolkit. Wherever you develop.
Captain JSON brings essential JSON developer utilities into your everyday browser workflow. Escape JSON strings, convert between data formats, inspect JWT tokens, work with JSONL files, validate JSON schemas, and generate code from JSON. Install Captain JSON on your preferred supported browser and access your developer toolkit from one convenient place.
Available today: Google Chrome, Microsoft Edge and Mozilla Firefox. More browsers are coming soon.
A JSON Schema validator checks whether a JSON document conforms to a schema — the required properties, data types and constraints it must satisfy — which goes beyond checking that the JSON syntax is valid. Captain JSON’s JSON Schema Validator supports Draft-04, Draft-06, Draft-07, Draft 2019-09 and Draft 2020-12 and reports detailed errors with exact error paths.
About Captain JSON: Captain JSON is a browser extension by PiratesOfBugs that provides JSON developer utilities including JSON comparison, formatting, pretty printing and validation.
Everything the JSON Schema Validator offers, from supported drafts to detailed error paths.
Check a document against the schema you provide.
Validate against schemas written for Draft-04.
Validate against schemas written for Draft-06.
Validate against schemas written for Draft-07.
Validate against schemas written for Draft 2019-09.
Validate against schemas written for Draft 2020-12.
Detect missing required properties.
Check that values have the expected types.
Apply constraints to strings, numbers and arrays.
Check objects inside objects.
Check values against enums and constants.
Read a detailed description of each violation.
See the path to each failing value.
Try your schema against example data.
Explore the structure of the schema visually.
A JSON document can follow correct JSON syntax but still violate the expected structure of an application or API.
For example, an API might require an integer field, a specific property, or a predefined object structure.
JSON Schema defines rules for validating these structures.
Captain JSON helps developers and testers validate JSON documents against JSON Schema specifications and identify violations before data reaches downstream systems.
Check responses against the agreed schema.
Try a schema against example data as you design it.
Check data before it reaches downstream systems.
Make sure configuration matches its schema.
Check example payloads against JSON Schema definitions.
JSON syntax validation checks whether a document is valid JSON: quotes, commas and brackets are all in the right places. The JSON validator does this.
JSON Schema validation goes one step further. It checks whether a valid JSON document conforms to a defined schema: which properties are required, what type each value has and what constraints apply.
In the example below, the document is valid JSON. Whether it is valid data depends on the schema, which requires a string name and an integer age and allows an optional email string. This document satisfies it.
{ "name": "Alice", "age": 30, "email": "[email protected]"}{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "required": ["name", "age"], "properties": { "name": { "type": "string" }, "age": { "type": "integer" }, "email": { "type": "string", "format": "email" } }}Validate JSON documents against schemas written for any of these drafts. The $schema keyword inside a schema identifies the draft it was written for.
Using the Draft-07 schema from the section above, here is how three documents fare. They are illustrative examples, not screenshots of the extension.
name and age are present, age is an integer and email is an optional string, so the document conforms to the schema.
{ "name": "Alice", "age": 30, "email": "[email protected]"}The schema requires age to be an integer, but the document supplies a string, so validation fails at age.
{ "name": "Alice", "age": "thirty", "email": "[email protected]"}The schema lists age as required, but the document omits it, so validation fails.
{ "name": "Alice", "email": "[email protected]"}From escaping JSON strings and converting data formats to inspecting JWT tokens, working with JSONL, validating schemas, and generating code, Captain JSON brings essential developer utilities together in one browser extension.
We use analytics cookies to understand how the site is used. No personal data is sold. See our privacy practices before choosing.