JSON Schema Validator - Free Online Draft 2020-12 Checker

Optimización de motores de búsqueda
  1. Home
  2. Developer Tools
  3. JSON Schema Validator
Share: Report

JSON Schema Validator

100% free · Runs 100% in your browser · No signup needed

JSON Schema (draft 2020-12 core subset)
JSON instance to validate

Supported keywords: type, properties, required, items, additionalProperties, minimum, maximum, exclusiveMinimum, exclusiveMaximum, minLength, maxLength, pattern, enum, format (email, uri, date). NO $ref / $defs support — references are ignored and flagged above when detected. format is assertion-only: email, uri and date are checked with regular expressions, not full RFC validation, so a value can pass here and still be rejected by a strict parser.

Try an example: load the valid sample

Acerca de JSON Schema Validator

What Is the JSON Schema Validator?

The JSON Schema Validator is a free online tool that checks whether a piece of JSON data matches the rules in a JSON Schema. You paste a schema in one editor and a JSON document, called an instance, in the other, and the tool reports whether the instance is valid. If it is not, you get a clear list of errors, each pointing to the exact place that failed. It is made for developers, API builders, data engineers, and students who want to catch bad data before it reaches an application, a database, or a partner system.

JSON itself only describes data; it does not say what data is allowed. A field could be a string today and a number tomorrow, a required field could be missing, or a zip code could be in the wrong format, and plain JSON would not complain. A JSON Schema adds that contract. It says which fields must exist, what types they must have, what values are allowed, and how long or how large they may be. Validating against a schema turns vague assumptions into a testable rule, which is why schemas are used for API requests and responses, configuration files, and data imports.

Which Part of JSON Schema This Tool Implements

This tool implements the JSON Schema draft 2020-12 core subset, and stating that subset clearly is part of using the tool correctly. The supported keywords are type, covering object, array, string, number, integer, boolean, and null; properties, which describes the allowed fields of an object; required, which lists fields that must be present; items, which describes the items of an array; additionalProperties, which controls whether extra fields are allowed; minimum and maximum for numbers; minLength and maxLength for strings; pattern, which checks a string against an ECMA-262 regular expression; enum, which restricts a value to a listed set; and format, which checks email, uri, and date values.

A sample schema and a matching valid and invalid JSON example are preloaded, so you can see the tool working before you paste your own data. The validate button runs a full check, and live mode re-validates as you type, which is useful when you are writing a schema and want immediate feedback. Errors are reported with JSON-path notation, for example $.address.zip, which tells you the failing value is the zip field inside the address object at the root of the document. That path style makes large documents much easier to debug than a bare message such as invalid value, because you can jump straight to the problem.

How to Use This Tool

  1. Paste or write your JSON Schema in the schema editor, or load the sample to see a working example.
  2. Paste the JSON instance you want to test in the instance editor. The tool checks that both editors contain valid JSON first.
  3. Click Validate, or switch on live mode to validate automatically as you edit either side.
  4. Read the result. A valid instance passes cleanly. An invalid instance shows an error list with a JSON path, the keyword that failed, and a plain explanation.
  5. Fix the instance or the schema, whichever is wrong, and validate again. Many errors are schema mistakes, not data mistakes, so check both sides.
  6. Copy or share the corrected schema and instance once validation passes, and keep the schema beside your API documentation or code.

Understanding Common Validation Errors

The most common error is a type mismatch: a field declared as a number arrives as a string, often because a form or a spreadsheet exported it with quotes. The next most common is a missing required field, which usually means the data producer and the schema author disagree about what is mandatory. Range errors follow: a value below minimum or above maximum, a string shorter than minLength or longer than maxLength, or an array item that does not match items. Pattern errors mean a string failed its regular expression, for example a code that should contain only digits and hyphens but contains a letter. Enum errors mean a value is outside the allowed list, which often happens when a new status or category is added to the data but not to the schema.

When you see an error, read the path first, then the keyword, then the value. The path $.address.zip tells you where to look, the keyword tells you which rule failed, and the value tells you what was actually there. If an error surprises you, re-read the schema keyword: additionalProperties set to false, for example, rejects any field not listed in properties, which is a frequent source of unexpected failures when a data source adds a new field.

An Honest Label: What This Tool Does Not Do

This is an offline, client-side tool with a defined subset, and that boundary matters. It does not resolve $ref or $defs references to external schemas, so a schema that points to another file or a remote URL will not be fully resolved here. If your schema uses references, inline the referenced parts before validating, or use a full schema validator for that case. The tool also does not fetch anything from the internet: your schema and your data stay in your browser, which is good for privacy and for working with sensitive examples, but it also means external references cannot be loaded by design.

The format keyword deserves a second honest note. In this tool, format checks for email, uri, and date are regex checks, not full RFC validators. They catch obviously malformed values, such as an email without an at-sign or a date in the wrong shape, but they do not prove that an email address exists, that a URI resolves, or that a date is valid in every edge case of the relevant standard. In the JSON Schema specification, format is also assertion-only by default in many implementations, meaning it annotates rather than strictly validates unless an implementation chooses otherwise. Treat a passing format check as a useful sanity check, not as proof of real-world validity, and add dedicated checks in your application where correctness truly matters.

Where Schema Validation Fits in Real Work

Schema validation is most valuable at boundaries: where data enters your system from a user, a form, a file upload, another service, or a third-party API. Validating at the boundary stops bad data early, before it is stored, processed, or passed onward, and it gives the sender a precise, actionable error instead of a vague server failure later. API teams use schemas to document request and response shapes, to generate tests, and to catch breaking changes when a field is renamed or a type changes. Data teams use them to check imports and migrations, so a bad file fails fast with a path like $.address.zip instead of corrupting a database silently.

Validation is not, however, a substitute for business logic. A schema can prove that an age is an integer above zero, but it cannot prove that the age belongs to the right person, that a price is commercially correct, or that a booking date is in the future relative to a business rule that changes daily. Use the schema for structure, types, ranges, and formats, and keep business rules in your application code where they can be tested and changed independently.

Tips for Writing Good Schemas

  • Start small and add keywords only when you need them. A schema with type, properties, and required covers most cases.
  • Use additionalProperties: false deliberately, not by habit, so legitimate new fields are not rejected without warning.
  • Prefer enum for fixed sets such as status values, and keep the list in sync with your application code.
  • Use pattern sparingly, and test each regular expression against both valid and invalid examples before relying on it.
  • Give numbers sensible minimum and maximum bounds, and strings sensible minLength and maxLength limits, to catch typos and overflow early.
  • Keep one example of a valid instance beside every schema. If the example stops validating, the schema changed, and that is a signal worth noticing.

When your data needs reshaping rather than checking, convert it with the JSON to CSV Converter or the CSV to JSON Converter, translate YAML with the YAML to JSON tool, or tidy markup with the XML Formatter.

When you are ready to put your API or project online, FistHost shared hosting starts at just $0.99 per month, and an annual plan includes a free domain, so you can publish your application, documentation, or portfolio without a large upfront cost. Visit FistHost to see the current plans and get started in minutes.

Every FistHost hosting plan, starting at just $0.99 per month, is built for real websites, with fast loading, simple setup, and support when you need it, and the free domain with an annual plan means your new site can have a proper address from day one. Visit FistHost to choose a plan and launch your site today.

User Reviews

No reviews yet. Be the first to review this tool!

Write a Review

★★★★★

Captcha

Reviews are protected by captcha and moderated before they appear.


WordPress

WordPress Hosting Made Easy

One-click installs on fast,
secure servers

Launch WordPress
Pro Built for Creators Fast hosting for blogs, · stores and portfolios Create Now