JSON Schema Validator
Check one JSON value against a small subset of JSON Schema: types, ranges, required keys, properties, items, pattern, and enum.
🔒 Processed entirely in your browser — nothing you enter here is ever uploaded.
The result appears on this page after you run the tool. Nothing you enter is uploaded.
Result
About this tool
There are two boxes. The first is the JSON value and the second is the schema. Both are parsed with JSON.parse. A failure in the value is reported as JSON Payload Parse Error plus the parser's message. A failure in the schema is JSON Schema Parse Error. Neither error tries to point at a line, because JSON.parse does not give this page a line number. If both parse, the value is walked against the schema object. A schema node that is null or not an object is skipped.
The type keyword accepts string, number, integer, boolean, object, array, and null. The actual type treats arrays as array and null as null, and otherwise uses typeof. Integer requires a number that Number.isInteger accepts, so 1.5 fails integer and 1 passes. Number rejects a numeric string. For a number, minimum and maximum are inclusive bounds. For a string, minLength, maxLength, and pattern are applied. Pattern is passed to the RegExp constructor and tested. A pattern that does not compile is ignored, because the constructor is in an empty catch. Enum compares JSON.stringify of the value with JSON.stringify of each allowed option. Objects check a required array by looking for each name with the in operator. Then each key that also appears under properties is checked against that property schema. Keys that are not listed in properties are allowed through. Arrays check every element against items when items is present.
A concrete failure is easy to paste. The value {"age": 15} against {"type": "object", "required": ["name"], "properties": {"age": {"type": "integer", "minimum": 0}}} fails with Required property "name" is missing. Path: "name". Change the value to {"name": "Ada", "age": 15} and the same schema passes, with the message JSON payload matches the JSON Schema successfully! Age 15 is an integer and it is not below 0. Age 15.5 would fail as Expected integer. A string property with pattern "^[A-Z]" fails when the value does not match that regular expression. The path in an object is the dotted key, and an array element is reported as path[index]. Keywords this walker does not read are not enforced. $ref is not followed. oneOf, anyOf, allOf, not, format, uniqueItems, additionalProperties, minItems, maxItems, and dependentRequired do nothing here. additionalProperties set to false will not reject an extra key, because the walker never looks at that keyword. A passing result means the keywords above were satisfied. It does not mean the document satisfies the full JSON Schema specification. The text stays in the browser. On failure the status box shows the message, and a line reprint happens only when the result carries a line number, which these parse and schema errors generally do not.
Example. The value {"age": 15} against a schema that requires name and an integer age of at least 0 fails with Required property "name" is missing. {"name": "Ada", "age": 15} against that schema passes.
Limit. Only type, minimum, maximum, minLength, maxLength, pattern, enum, required, properties, and items are applied. $ref, combinators, format, and additionalProperties are ignored, and a bad pattern is skipped.
Which schema keywords actually run?
type, minimum, maximum, minLength, maxLength, pattern, enum, required, properties, and items. Integer means a JSON number that is a whole number. Enum uses JSON.stringify to compare. Required uses the in operator, so a key that is present and null still counts as present.
Why did an extra field pass when additionalProperties is false?
The walker never reads additionalProperties. It only descends into keys that are listed under properties. An extra key is allowed. oneOf, anyOf, allOf, $ref, format, uniqueItems, and the array length keywords are also ignored.
What does a missing required field look like?
{"age": 15} against an object schema whose required array contains name fails with Required property "name" is missing. Path: "name". Adding "name": "Ada" makes that schema pass, as long as age stays an integer of at least the minimum.
Does a pattern error point at a line?
JSON.parse errors are reported as payload or schema parse errors without a line number from this page. A pattern that fails RegExp is caught and skipped, so a broken pattern does not by itself fail the value. A pattern that compiles and does not match fails with the pattern text in the message.