JSON Schema reference

JSON Schema Guide

JSON Schema describes the structure and constraints a JSON document is expected to follow. It can verify required fields, data types, nested objects, arrays, enums, patterns and numeric limits after the JSON itself is syntactically valid.

Quick answer

JSON syntax validation asks “is this valid JSON?” JSON Schema validation asks “does this valid JSON have the shape and values my application expects?”

What JSON Schema validates

A schema can require properties, restrict values to specific types or enums, validate array items, apply string patterns and length rules, set numeric minimums and maximums, and describe nested objects. This makes it useful at API boundaries, configuration loading, form processing, test fixtures and data pipelines.

Start with type and properties

For an object, the most common starting point is {"type":"object","properties":{...}}. Each property can have its own schema. Add a required array for fields that must exist and additionalProperties:false when unknown keys should be rejected.

Schema validation is not business validation

A schema can verify that age is an integer between 0 and 120, but it cannot know whether a particular age is permitted by your business workflow unless you encode that rule. Treat schema validation as a strong boundary check, not a replacement for application logic.

Basic JSON Schema example

{
  "type": "object",
  "required": ["id", "email"],
  "properties": {
    "id": { "type": "integer", "minimum": 1 },
    "email": { "type": "string", "pattern": "^[^@]+@[^@]+$" },
    "active": { "type": "boolean" }
  },
  "additionalProperties": false
}

Related JSON tools and guides

Frequently asked questions

What is JSON Schema?

JSON Schema is a vocabulary for describing and validating the structure, types and allowed values in JSON data.

Is JSON Schema the same as JSON validation?

No. JSON validation checks syntax. JSON Schema validation checks whether already-valid JSON conforms to an expected structure and constraints.

Which JSON Schema draft should I use?

Use the draft supported by the systems that exchange your data. Modern tooling commonly targets newer drafts, but compatibility matters more than choosing a draft in isolation.

Source-backed reference

JSON standards quick reference

Concise, standards-backed facts for developers working with JSON debugging and validation. Each claim is linked to the evidence registry and resolves to a primary standard or platform reference so it can be independently verified.

JSON standard
JSON is a text format for serializing structured data, with syntax defined by interoperable standards rather than by FixTools.
Strings and object keys
JSON strings and object member names use double quotation marks. Single-quoted strings are not valid standard JSON syntax.
Trailing commas
Standard JSON grammar does not allow a comma after the final member of an object or the final element of an array.
Parser behavior
JSON.parse() parses JSON text into a JavaScript value and raises a SyntaxError when the input is not valid JSON.

Common invalid → valid JSON examples

Trailing comma

{"a":1,}{"a":1}

Single-quoted key

{'a':1}{"a":1}

Unsupported literal

{"score":NaN}{"score":null}

Built for verification, not just extraction

Direct answers are paired with source-specific evidence. This keeps technical claims independently verifiable and gives search and answer systems a clearer provenance trail than unsupported summary copy.