Schema with required fields
Schema:
{
"type": "object",
"required": ["name", "age"],
"properties": {
"name": { "type": "string" },
"age": { "type": "integer", "minimum": 0 }
}
}The JSON Schema Validator checks whether a JSON document conforms to a JSON Schema you provide. Paste your schema and your data side by side and the tool validates the instance entirely in your browser, reporting every constraint that fails: wrong types, missing required properties, values outside allowed ranges, pattern mismatches, and more. This is invaluable for verifying API payloads, configuration files, and data contracts so you can catch malformed data before it flows through your application.
JSON Schema is a declarative vocabulary, defined by the json-schema.org specifications, for describing the structure of JSON data. A schema specifies expected types, required fields, value constraints (minimum, maximum, pattern, enum), and nested object and array shapes. Validation compares a concrete JSON instance against that schema and produces a pass or a list of violations. Using schemas turns informal assumptions about your data into machine-checkable rules, improving reliability and making it easy to document and enforce the shape of the data your systems exchange.
The main file is the entry point for each run.
Use the Input panel to pipe standard input to your program when it needs data.
Run sends your code to a fresh hosted runtime and streams the result into the output panel.
Your draft stays in this browser, and Share creates a separate snapshot link.
Schema:
{
"type": "object",
"required": ["name", "age"],
"properties": {
"name": { "type": "string" },
"age": { "type": "integer", "minimum": 0 }
}
}Data:
{ "name": "Ada", "age": 36 }
Result: Valid — all required fields present and types match.Data:
{ "name": "Ada" }
Result: Invalid — missing required property "age".Data:
{ "name": "Ada", "age": -5 }
Result: Invalid — "age" violates "minimum": 0 (and must be an integer).Schema:
{
"type": "object",
"properties": {
"role": { "enum": ["admin", "user"] },
"code": { "type": "string", "pattern": "^[A-Z]{3}$" }
}
}
Valid: { "role": "admin", "code": "ABC" }
Invalid: { "role": "guest", "code": "ab" } — role not in enum; code fails the pattern.Schema:
{
"type": "array",
"items": { "type": "number" },
"minItems": 1,
"uniqueItems": true
}
Valid: [1, 2, 3]
Invalid: [1, 1] — fails "uniqueItems"; [] — fails "minItems": 1.Schema:
{
"type": "object",
"properties": {
"user": {
"type": "object",
"required": ["id"],
"properties": { "id": { "type": "integer" } }
}
}
}
Valid: { "user": { "id": 7 } }
Invalid: { "user": { "id": "7" } } — nested "id" must be an integer, not a string.Schema:
{
"type": "object",
"properties": { "name": { "type": "string" } },
"additionalProperties": false
}
Valid: { "name": "Ada" }
Invalid: { "name": "Ada", "extra": 1 } — "extra" is not a defined property.Schema:
{
"type": "object",
"properties": {
"email": { "type": "string", "format": "email" },
"pin": { "type": "string", "minLength": 4, "maxLength": 4 }
}
}
Valid: { "email": "[email protected]", "pin": "1234" }
Invalid: { "email": "a@b", "pin": "12" } — bad email format; pin too short.The editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.
Paste your JSON Schema and your data instance side by side
The tool validates the instance against the schema in-browser
It returns a pass or a list of every constraint that fails
Expected types and required properties
Ranges like minimum and maximum, plus pattern and enum
Nested object and array shapes
Validation runs entirely in your browser
Your schema and data are never uploaded or stored on a server
Verifying API payloads and config against a data contract
Catching malformed data before it flows through your app