Skip to content
SmaftyTools

JSON Schema Validator

Validate JSON data against a JSON Schema and see exactly which fields fail, and why. Free online JSON Schema validator, runs client-side.

About JSON Schema Validator

The JSON Schema Validator checks a JSON document against a JSON Schema and reports every field that fails, with a specific reason and its exact location — 'age: must be >= 0' rather than a generic 'invalid data' message. Paste the data on one side and the schema on the other; validation runs instantly as you edit either.

It's used for testing an API's request or response shape against its documented schema before writing integration code, checking that a config file matches the structure an application expects before deploying it, validating sample data while designing a schema for a new API, and debugging why a payload a service rejected doesn't actually conform to the contract everyone assumed it did. It's a fast, no-install way to answer 'does this JSON actually match this schema?' without writing a script around a validation library.

The validator supports the JSON Schema keywords used in the overwhelming majority of real-world schemas: `type` (including `integer` as a distinct check from `number`), `required`, `properties`, `additionalProperties`, `items` for array element validation, `enum` and `const` for fixed value sets, `minimum`/`maximum` for numbers, `minLength`/`maxLength` and `pattern` for strings, and `minItems`/`maxItems`/`uniqueItems` for arrays — applied recursively through nested objects and arrays, with each error's path showing exactly where in the document it occurred (e.g. `user.addresses[1].zip`).

This is a focused, dependency-free implementation covering the common subset of JSON Schema rather than the full specification — advanced features like `$ref` references between schemas, `oneOf`/`anyOf`/`allOf` combinators, and conditional (`if`/`then`/`else`) schemas aren't supported, and the schema itself isn't validated against the JSON Schema meta-schema (an unrecognized keyword in your schema is simply ignored rather than flagged). For validating everyday API payloads and config shapes, this covers the vast majority of real-world use. Both the data and the schema are validated entirely in your browser.

How to Use the JSON Schema Validator

  1. Paste your JSON data into the left box.
  2. Paste the JSON Schema to validate against into the right box.
  3. Review the pass/fail result — each violation lists its field path and reason.

Features

  • Supports type, required, properties, enum, const, min/max, pattern, items and more
  • Reports every violation with its exact field path, not just the first
  • Recursive validation through nested objects and arrays
  • Instant, client-side validation as you edit

Examples

Validating a passing object

Input

Data: {"name": "Ada Lovelace", "age": 28}
Schema: requires name (string) and age (integer, minimum 0)

Output

Valid — no schema violations found.

Catching multiple violations at once

Input

Data: {"name": "A", "age": -5}
Schema: name minLength 2, age minimum 0

Output

✗ name: must be at least 2 characters
✗ age: must be >= 0

Flagging a missing required field

Input

Data: {"name": "Ada"}
Schema: required ["name", "age"]

Output

✗ age: is required

Frequently Asked Questions

Which JSON Schema keywords are supported?

The common subset: type, enum, const, required, properties, additionalProperties, items, minItems/maxItems/uniqueItems, minLength/maxLength, pattern, minimum/maximum, and basic email/uri format checks. Advanced features like $ref, oneOf/anyOf/allOf and conditional schemas aren't supported.

Why does 'integer' behave differently from 'number' in the type check?

type: "integer" additionally requires the value to be a whole number, so 28 passes but 28.5 fails — matching how JSON Schema distinguishes the two, since JSON itself only has one native number type.

What happens if my schema uses an unsupported keyword?

It's silently ignored rather than causing an error, since the validator doesn't check the schema itself against a meta-schema. If a validation result looks wrong, check whether the rule you expected is on the supported-keyword list above.

Is the JSON Schema Validator free?

Yes, the JSON Schema Validator is completely free with no usage limits. No signup, no account and no installation required.

Is my data safe?

Yes. All processing happens locally in your browser using JavaScript — nothing you type is uploaded or stored on our servers.