JSON Schema Validator

Validate JSON data against a JSON Schema (Draft-7) and show error locations as JSON Pointers.

Category: Dev Tools

When to use?

Use it to check that an API response JSON meets a predefined Schema, or to instantly use a team data-spec document as a validation tool.

How to use

  • Enter the JSON Schema on the left.
  • Enter the JSON data to validate on the right.
  • Check error locations and messages in the result.

Input Explanation

Enter two things: a JSON Schema (Draft-7 format) and the JSON data to validate.

Calculation Basis

It recursively validates type, required, properties, enum, minimum, maximum, pattern, minLength, maxLength, items, minItems, and maxItems in pure JS. Error locations are returned as JSON Pointers (/field/subfield).

Usage Examples

  • Validate API responses - Check that a backend API response JSON follows a predefined contract Schema.
  • Validate team data specs - Document agreed JSON structures as a Schema and validate real data against it.

Examples

  • If the Schema has required: ["name"] and the data lacks name, an error shows at the /name path
  • If age has minimum: 0 and the data is -1, an error shows at /age

Cautions

  • Some advanced Draft-7 keywords ($ref, allOf, anyOf, oneOf, not) are not supported.
  • For full Draft-7 compatibility, use a dedicated library like ajv.

FAQ

What is JSON Schema?

A standard spec describing the structure, types, and constraints of JSON data. Draft-7 is the most widely used IETF draft.

Which keywords are supported?

type, required, properties, enum, minimum, maximum, pattern, minLength, maxLength, items, minItems, maxItems.

Related Tools

  • JSON Formatter - Beautify or minify JSON strings instantly and check for validity errors.
  • UUID Generator - Generate up to 20 cryptographically secure UUID v4 values at once.
  • Password Generator - Generate secure random passwords in the browser by choosing length, character set, and count.
  • JWT Decoder - Decode a JWT header and payload to view the JSON and key claims.
  • Regex Tester - Enter a regex pattern to see matches in text in real time.
  • QR Code Generator - Convert text or a URL into a QR code and download it as an image.