JSON Schema Validator

JSON Data

1
2
3
4
5
6
7
8
9
10

JSON Schema

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

Validation Results

Validate JSON Data

Enter JSON data and schema to validate data structure and constraints

Validates data types and structure

Checks required properties

Verifies constraints and formats

How to validate JSON against a JSON Schema – step-by-step guide

Validate API responses, config files, and payload samples by checking JSON data against a schema contract. This is useful for debugging, documentation, and contract testing.

  1. Step 1 – Paste your JSON data

    • Paste JSON into the JSON Data editor.
    • Use the Import button if your JSON lives in a file, URL, or clipboard.
  2. Step 2 – Paste your JSON Schema

    • Paste the schema into the JSON Schema editor.
    • Focus on core structure: type, properties, required, items.
  3. Step 3 – Read the validation result

    • The right panel shows a valid flag and an errors list.
    • Use the error paths to locate the exact field that doesn't match.
  4. Step 4 – Fix data or schema

    • If the data is wrong, fix the payload (missing fields, wrong types).
    • If the contract changed, update the schema and re-run validation.
  5. Step 5 – Use a strict validator in CI

    • For production-grade validation (draft support, $ref, composition), run a full JSON Schema validator in CI.
    • Keep your schema versioned and test it against real payload fixtures.

Important note about JSON Schema features

  • This validator is intentionally lightweight and focuses on core keywords ( type, properties, required, items).
  • Schemas that rely on $ref, anyOf, oneOf, or allOf may require a full validator.
Example: validate JSON data against schema
// JSON data
{ "id": 1, "name": "Maeve Winters" }

// JSON Schema
{
  "type": "object",
  "properties": {
    "id": { "type": "integer" },
    "name": { "type": "string" },
    "email": { "type": "string" }
  },
  "required": ["id", "name", "email"]
}

// Result
{
  "valid": false,
  "errors": ["root: Missing required property 'email'"]
}

Related JSON Schema tools

Generate schemas, create mock payloads, and clean JSON before validating.

Frequently Asked Questions

What is JSON Schema validation?

JSON Schema validation is the process of checking whether a JSON document conforms to a given schema. It verifies data types, required properties, constraints, and structure rules defined in the schema.

How do I validate JSON against a schema?

Provide your JSON data in the input editor and your schema in the settings panel. Validation will happen automatically as you type.

What validation errors might I encounter?

Common validation errors include type mismatches, missing required properties, additional properties not allowed by the schema, string length violations, and number range violations.

Can I use custom JSON schemas?

Yes. You can paste standard JSON Schema JSON, but this validator focuses on core keywords like type/properties/required/items and does not resolve $ref or fully evaluate advanced composition keywords.

JSON Schema Validator Online | JSONSwiss