Skip to content
ToolPlankDEV
JSON Tools
100% In-Browser Execution

Updated:

JSON Schema Validator

Paste a schema and your JSON, and this json schema validator lists every error, not only the first, with a plain-English message and the line and column to fix. Check one document or a whole JSON Lines file. Nothing is uploaded.

Processing in browser...

Loading the tool. It runs entirely in your browser, so your data is never uploaded.

More free tools you may need next.

Quick Guide

How to use JSON Schema Validator

Simple step-by-step instructions to get the exact output you need.

  1. 01

    Paste the schema and the data

    Put your JSON Schema in the left box and the JSON to check in the right box, or open files into them. Example loads a schema and a record with several mistakes, and JSON Lines example loads five records to check one by one.

  2. 02

    Read the verdict and the errors

    The result shows Valid or Invalid with the number of errors. Every error lists the JSON Pointer path, a plain-English message, a hint for the fix and the line and column in the data box.

  3. 03

    Jump to the problem

    Press the line and column button on an error and the data box scrolls there and selects the spot, so you can fix the value and watch the error go away.

  4. 04

    Set the draft, formats and batch mode

    The draft is read from $schema, or you can choose it. Turn Check formats on to test email, date-time and similar formats. Turn on Several documents to check every JSON value or JSON Lines record on its own and see a pass or fail table.

How to validate JSON against a schema

A JSON Schema is a set of rules for a JSON document: which keys are required, what type each value has, which numbers and text lengths are allowed. To validate JSON against a schema, paste both and the tool runs a standards-compliant validator, Ajv, in your browser. Nothing is uploaded, which matters when the data comes from production.

The validator reports every rule that fails, not only the first, so one pass shows you the whole list of fixes. The checks run as you type. The Privacy Policy explains what stays on your device.

Text
Draft 2020-12: 0 valid, 1 invalid, 4 errors in 1 document.

Document 1 (line 1): 4 errors
  /extra (line 5, column 3) [additionalProperties]: Unexpected property "extra" in the document. The schema does not allow extra properties. Remove "extra", or allow extra properties in the schema.
  /id (line 2, column 9) [minimum]: /id must be at least 1 but is 0. Change the number to fit the range.
  /email (line 3, column 12) [format]: "ana-at-example.com" at /email is not a valid email. Use a value in email format.
  /role (line 4, column 11) [enum]: "owner" at /role is not one of the allowed values: "admin", "user".

Errors with paths, lines and columns

Each error carries a JSON Pointer such as /users/3/email, which names the exact value. The tool also maps the pointer back to the text you pasted, so you get a line and a column. A missing required property points at the object that lacks it, and an unexpected property points at its key.

The messages are written for people. Instead of must have required property, you read Missing required property "age" in the document, and the hint says what to change. The raw keyword, such as minimum or enum, is shown too, so you can find the rule in the schema.

When a document has more than 100 errors, the list and the copied report show the first 100, followed by how many were left out. The counts include all of them.

JSON Schema draft 2020-12, 2019-09, 07, 06 and 04

The draft is taken from the $schema keyword. If the schema has none, 2020-12 is used. Choose a draft from the list to override it, and the tool notes that the $schema value was ignored. A $schema value that is not a known draft is ignored the same way.

  • 2020-12 and 2019-09 support prefixItems, dependentRequired, unevaluatedProperties and $defs.
  • Draft 07 and 06 use definitions and items arrays for tuples. Draft 06 added const and contains.
  • Draft 04 uses boolean exclusiveMinimum and exclusiveMaximum next to minimum and maximum.

Before it checks any data, the tool checks the schema itself against the meta-schema of the chosen draft, so a typo such as type: strin is reported as a schema problem instead of passing silently.

Format checks

By default JSON Schema treats format as a hint, so a bad email passes. Turn on Check formats and the validator tests the common ones: date-time, date, time, email, hostname, ipv4, ipv6, uri, uuid, regex and more. Leave it off to check structure only.

Validate JSON Lines in bulk

Turn on Several documents and the data box can hold many JSON values, one per line or one after another. Each is checked on its own. The result shows how many passed and failed, and a table lists each document with its starting line and error count. Press a document to see its errors. Only invalid is on by default, so a long file shows just the problems.

The report you copy lists every failing document, which suits a log of a data feed. To look through a large file first, JSONL Viewer shows its records.

References with $ref and $defs

References inside the schema, such as #/$defs/address or #/definitions/address, are resolved, including recursive ones. A schema that points to another file with $ref needs that file in the Referenced schemas box. Paste each extra schema there with its own $id and the reference is found. The validator never fetches anything from the network.

If a reference cannot be found, the message names it and says where to define it.

  • Keywords that the chosen draft does not know are ignored, as the specification says.
  • Regular expressions in pattern use JavaScript syntax.
  • A batch can hold up to 200,000 documents, and the input is limited to 2 million characters.
  • The validator checks data against a schema. It does not edit the schema.
  • A property that is named __proto__ is not handled correctly by the underlying validator, so avoid that name in schemas and data.

If you do not have a schema yet, the JSON Schema Generator makes one from your samples, and the button above the boxes sends your data to it. JSON to YAML and Sort JSON Keys help tidy a schema file.

Frequently Asked Questions

Technical Q&A for JSON Schema Validator

Common questions about edge cases, character encoding, and privacy guarantees.

Paste the schema in the left box and the JSON in the right box. The result lists every error with its path, a plain message and the line and column.

All of them. The counts include every error, and the list and the copied report show the first 100 for each document, followed by the number that were left out.

Draft 2020-12, 2019-09, 07, 06 and 04. The draft is read from $schema, or you can choose it.

Because format is only checked when Check formats is on. By default JSON Schema treats it as an annotation.

Yes. Turn on Several documents and paste JSON Lines or several values. You get a pass or fail table and the errors of each document.

Paste the other schema into Referenced schemas with its own $id. The validator resolves the reference from there and does not use the network.

It checks that JSON, such as an API payload, a config file or a data feed row, follows the contract described by a schema before it is used.

The tool checks the schema against the meta-schema first and reports the problem, for example an unknown type name, before it looks at the data.

Yes. Each error has a line and column button that scrolls the data box to the value and selects it.

No. The validation runs in your browser, so production payloads and private schemas stay on your computer.