What is the JSON Schema Validator?
ToolMint's JSON Schema Validator checks whether JSON instance data satisfies a user-supplied JSON Schema. Paste the data and schema, select a draft or use automatic detection, and the tool reports whether the instance is valid. When validation fails, each result identifies the instance path, schema path, keyword and message.
The validator supports JSON Schema Draft 7, Draft 2019-09 and Draft 2020-12. Validation happens in the current browser tab. ToolMint does not upload the JSON or schema, and it does not fetch external $ref documents.
JSON Schema is a data-validation system. It is different from Schema.org, which is a structured-data vocabulary commonly expressed as JSON-LD for search engines. The structured data and schema markup guide explains that separate SEO use case.
How to validate JSON against a schema
- Paste the instance you want to check into JSON Data.
- Paste a self-contained schema into JSON Schema.
- Keep the draft selector on Auto, or choose Draft 7, Draft 2019-09 or Draft 2020-12 explicitly.
- Select Validate.
- Review the result and correct each reported path or schema rule.
Auto mode reads a recognized root $schema declaration. If that declaration is absent, the tool uses Draft 2020-12 and displays a notice. If you explicitly select a different supported draft from the one declared in the schema, ToolMint validates with your selected draft and shows a mismatch warning rather than editing the schema.
Use Format JSON Data and Format Schema to apply two-space indentation. These actions parse and serialize the input with native JavaScript JSON methods; they do not preserve the original number text. For tree inspection, sorting and minification, use the dedicated JSON Formatter.
Numeric precision: both formatting and validation parse numbers as JavaScript Number values. Integers outside the safe range of -9,007,199,254,740,991 to 9,007,199,254,740,991 and high-precision decimals can lose precision. For example, formatting {"id":9007199254740993} produces {"id":9007199254740992} with indentation. Validation also uses the parsed value even when you do not select Format, so exact numeric constraints can produce misleading results for such inputs. See MDN's JSON.parse precision explanation.
Keep exact identifiers as quoted strings only when the data contract and schema define them as strings; changing a number to a string changes its type. When a contract requires exact large numbers or decimal arithmetic, use a validator with documented support for those values in the intended runtime. This tool does not provide arbitrary-precision numeric validation.
Debug a Draft 2019-09 local $ref error
Select Load failing $ref example above, then Validate. The button replaces both editors with a fictional order and a self-contained schema; Auto reads its Draft 2019-09 declaration. You can also paste the same inputs manually:
{"order":{"quantity":"2"}}
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"properties": {"order": {"$ref": "#/$defs/order"}},
"required": ["order"],
"$defs": {
"order": {
"type": "object",
"properties": {"quantity": {"type": "integer", "minimum": 1}},
"required": ["quantity"]
}
}
}
The data is valid JSON but fails the schema: /order/quantity is a string, while the referenced rule requires an integer. The result identifies the type keyword and the rule at #/$defs/order/properties/quantity/type. Change "2" to 2 in JSON Data and validate again; the corrected order passes. The local reference stays within the pasted schema and needs no download.
If you only need to select the quantity, use $.order.quantity in the JSONPath Tester. If you have sample rows but no schema contract, the JSON to TypeScript / Zod Generator can infer a starting shape; it cannot infer the minimum quantity rule from one example.
Supported JSON Schema drafts
| Draft | Notable behavior | ToolMint support |
|---|---|---|
| Draft 7 | Common in established APIs and schema libraries; uses definitions and dependencies |
Supported |
| Draft 2019-09 | Adds vocabulary declarations, dependentRequired, dependentSchemas, unevaluatedProperties and recursive references |
Supported |
| Draft 2020-12 | Current published draft; uses prefixItems, revised items behavior and dynamic references |
Supported and the default when $schema is absent |
Each draft uses its corresponding Ajv validator environment. ToolMint does not pass every schema through one generic configuration because keyword meaning and reference behavior differ between drafts.
Draft 4 and Draft 6 are not included in this version. A schema declaring an unsupported or custom dialect produces an error rather than being silently interpreted as a different draft.
Draft 7 vs 2019-09 vs 2020-12
Draft 7 remains common and is often the right choice when maintaining an existing contract. Draft 2019-09 introduced vocabulary-based organization and split the older dependencies keyword into dependentRequired and dependentSchemas. It also added unevaluated-property and unevaluated-item behavior.
Draft 2020-12 changes tuple validation. Tuple entries move to prefixItems, while items applies to subsequent array entries. It also replaces the 2019-09 recursive-reference keywords with $dynamicRef and $dynamicAnchor. These changes are why selecting the correct dialect matters.
Do not change a schema's draft only to remove an error. First confirm which draft the producer and consumer expect, then update keywords deliberately if you are migrating the contract.
Supported validation keywords
The validator delegates JSON Schema semantics to Ajv. Supported keyword groups include:
- Core object rules such as
type,properties,requiredandadditionalProperties - String rules such as
minLength,maxLength,patternand enabledformatvalues - Numeric rules such as
minimum,maximum, exclusive bounds andmultipleOf - Array rules such as
items,prefixItemswhere supported,minItems,maxItems,uniqueItemsandcontains - Object rules such as property counts,
patternProperties,propertyNamesand draft-specific dependency keywords - Composition with
allOf,anyOf,oneOfandnot - Conditional validation with
if,thenandelse - Local definitions and references through
$ref,$defs,definitionsand supported anchors
Boolean schemas are also valid. A schema containing only true accepts every JSON instance. A schema containing only false rejects every JSON instance.
How ToolMint handles $ref
Same-document references are supported. A schema can reference #/$defs/address, #/definitions/address, a supported local anchor, or the root schema through #. Bounded recursive local references work where the selected draft and Ajv support them.
External references are rejected before schema compilation. ToolMint does not fetch references such as https://example.com/address.schema.json, ./address.json or file:///schemas/address.json. Use local definitions or combine the required schemas into one self-contained document.
An absolute $id is not rejected by itself. In JSON Schema, $id identifies a schema resource and does not necessarily instruct a validator to download it. ToolMint still performs no schema network request.
Validation errors explained
The tool distinguishes four failure types:
- A JSON Data syntax error means the instance could not be parsed as JSON.
- A JSON Schema syntax error means the schema text could not be parsed as JSON.
- A schema compilation error means the parsed schema contains an invalid structure, unsupported dialect, unresolved local reference, invalid pattern or unknown format.
- A validation error means both documents parsed and the schema compiled, but the instance did not satisfy one or more rules.
The instance path points to the failing location in the data. /user/email means the email member inside user; / means the root value. The schema path points to the rule that failed. The keyword identifies the rule, such as required, type, minimum or format.
At most 100 errors are displayed. The cap keeps a malformed payload or broad allErrors result from creating thousands of interface elements. Copying errors produces the same concise paths, keywords and messages shown on screen, without copying the original values.
Format validation
ToolMint enables common ajv-formats checks for date-time, date, time, email, hostname, ipv4, ipv6, uri, uri-reference, uuid and regex. It does not claim to validate every custom format name.
Format semantics vary by JSON Schema draft and vocabulary. Draft 2020-12 separates format annotation from format assertion. This implementation deliberately enables the listed checks, so a non-matching listed format produces a validation error. An unknown format is not silently presented as verified.
A format check confirms a value's syntax against the configured implementation. It does not prove that an email mailbox exists, a hostname resolves, a URI is safe to visit, or a date is appropriate for your business rule.
JSON syntax vs JSON Schema validation
JSON syntax describes whether text can be parsed into objects, arrays, strings, numbers, booleans or null. JSON Schema adds rules about the permitted structure and values. A payload can therefore be valid JSON while still failing its schema.
For example, {"age":"28"} is valid JSON. It fails a schema that requires age to be an integer because the value is a string. Use the guide to pretty-printing JSON or JSON Formatter when the immediate problem is syntax or readability. Use this validator when a data contract defines the expected shape.
The JSON tips guide covers syntax, numeric precision, safe parsing and the role of schema validation in a broader input-security process.
Practical uses
JSON Schema validation is useful when reviewing API requests and responses, webhook payloads, configuration files, data imports, event messages and contracts shared between teams. It can identify missing fields, wrong types, unexpected properties, invalid array items and values outside declared constraints before downstream code relies on them.
After validating a payload, use JSON to YAML Converter when another configuration system expects YAML, or YAML to JSON Converter for the reverse direction. JSON to XML Converter and XML to JSON Converter handle format conversion, while Text Diff Checker can compare two schema revisions as text.
Limits and resource safety
The JSON Data editor accepts up to 2 MB and the JSON Schema editor accepts up to 512 KB. Parsed instance data is limited to 100 nesting levels, 100,000 values and 20,000 items in one array. Schemas are limited to 80 nesting levels and 10,000 nodes. The tool also caps the number and length of pattern expressions.
These controls reduce browser resource risk from deeply nested inputs, very large uniqueItems arrays, recursive references, complex composition trees and regex-heavy schemas. They cannot prove that every user-supplied regular expression is safe from pathological execution. Keep patterns narrow, avoid unnecessary nested alternatives and test important schemas in the runtime that will enforce them in production.
Schema validation should not be the only application security boundary. Authorization, rate limits, output encoding, storage controls and business-specific checks remain the application's responsibility.
Privacy and local processing
Parsing, draft selection, schema compilation and validation run in the current browser tab. ToolMint does not upload JSON data, schema text, identifiers, references, errors, paths, property names or values. The tool does not save input to localStorage and does not send it through analytics.
Analytics, when permitted by your privacy preferences, receive only aggregate interaction details such as the selected draft, valid or invalid outcome and a coarse error-count range. Clearing or closing the tab removes the editor state.
Browse additional local converters and developer utilities in the Developer category.
Sources
- JSON Schema specification
- JSON Schema Draft 7
- JSON Schema Draft 2019-09
- JSON Schema Draft 2020-12
- Ajv JSON Schema documentation
- Ajv format validation
The FAQ section below is generated from the ToolMint registry so visible answers and FAQ structured data remain synchronized.