JSON Schema Validator Online

Check that JSON data matches a schema, including required properties, types, formats, and value constraints. Validation runs in your browser using JSON Schema Draft 2020-12.

Generate a JSON Schema from sample JSON

Draft 2020-12Local references supported; remote references are not fetched.

JSON data

JSON Schema

Validation result

Load or enter JSON data and a schema.

    Validate JSON Data Against a Schema

    Valid JSON is not automatically valid for your API or application. A JSON parser checks syntax; a JSON Schema validator checks whether a parsed value follows rules written in a schema. Those rules can describe the expected structure, types, required properties, allowed values, and limits for strings, numbers, and arrays.

    Enter or open both the JSON data and a JSON Schema, then select Validate JSON. This page supports JSON Schema Draft 2020-12, checks common formats, and reports failing data paths alongside the schema rules that produced the errors. Validation happens in your browser.

    How to Use the JSON Schema Validator

    1. Paste JSON into the JSON data field, or select Open data to load a .json file.
    2. Paste a Draft 2020-12 schema into JSON Schema, or select Open schema to load a schema file.
    3. Select Validate JSON. Use Load sample to see a working data-and-schema pair.
    4. Read the result. A valid result means the data conforms to the schema you supplied; an invalid result lists the reported paths and rules to review.

    Both the data and schema must be valid JSON text before schema validation can run. The page reports malformed data, malformed schema syntax, schema compilation problems, and data validation failures separately.

    What Can a JSON Schema Check?

    Schema keywords let you describe the shape and constraints of data. For example, type sets a value’s type, required lists object properties that must be present, and properties defines rules for named fields. Other common keywords include enum for an allowed set of values, minimum and maximum for numbers, minLength and maxLength for strings, and items for array elements.

    Here is a small schema for a customer record:

    {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "required": ["email", "age"],
      "properties": {
        "email": { "type": "string", "format": "email" },
        "age": { "type": "integer", "minimum": 18 }
      },
      "additionalProperties": false
    }

    This schema requires an email address and an integer age of at least 18. It also rejects fields other than email and age. Without required, properties described under properties are optional; without additionalProperties: false, extra fields are allowed by default. Add only the restrictions your data contract needs.

    Read Validation Errors

    Each reported error includes the data location (instancePath) and the schema location (schemaPath). For example, /items/2/price points to the price property in the third item of an items array. These paths use JSON Pointer style, so they help you locate the value in the original document. The validator shows up to 100 errors to keep the result manageable.

    If the result says the schema could not be compiled, check that the schema itself is valid and uses Draft 2020-12 keywords. For instance, tuple-style array rules from older drafts may need to be rewritten with the Draft 2020-12 keywords prefixItems and items. See the official Draft 2020-12 specification for the full vocabulary.

    JSON Syntax Validation vs. JSON Schema Validation

    A JSON Validator checks whether text follows JSON syntax, such as using double quotes and correctly placed commas and brackets. A JSON Schema Validator checks additional rules that you define. The data must parse as JSON first, then it can be checked against the schema.

    A successful result does not prove that the data will meet every business or application requirement. It only confirms the rules expressed in the supplied schema. If your API has additional conditions, include them in the schema where possible or check them in your application.

    Draft Version and Reference Support

    This tool uses JSON Schema Draft 2020-12. Set "$schema": "https://json-schema.org/draft/2020-12/schema" at the top of a schema to make its intended draft explicit. Local references within the supplied schema are supported, including definitions under $defs. Remote $ref URLs are not downloaded, so include the referenced definitions in the schema document before validating.

    Common formats such as email, date, and uri are checked by this validator. Format behavior can vary between validators and configurations; the underlying JSON Schema specification separates format annotation from format assertion. See the Ajv format documentation for details on the format checks used by this page.

    Privacy and Input Limits

    Each JSON data input and schema can be up to 10 MiB. The page parses and validates them in your browser and does not send them to RomitJSON. It loads the Ajv validator libraries from esm.sh, so your browser needs a connection to retrieve those scripts; that library request is separate from your JSON input. Avoid using secrets or confidential data in online tools unless their handling fits your requirements.

    Frequently Asked Questions

    What is the difference between JSON Schema and JSON?

    JSON is a text format for structured data. JSON Schema is a separate JSON document that describes rules for checking the structure and values of JSON data.

    Which JSON Schema draft does this validator support?

    This tool supports Draft 2020-12. Older drafts may use different keywords and can fail to compile as a 2020-12 schema.

    Does the required keyword make every property required?

    No. List required property names in the schema’s required array. Properties described under properties are optional unless they are also listed as required.

    Can I use a remote $ref?

    No. Remote schema references are not fetched. Use local references and include the definitions they point to in the schema you provide.

    Why does valid JSON fail schema validation?

    The text may be valid JSON while a value has the wrong type, a required field is missing, a number is outside its allowed range, or another schema rule is not met. Follow the reported data path and review the corresponding keyword.

    Does a valid result guarantee that my application accepts the data?

    No. It confirms that the data matches the supplied schema. Your application may enforce additional rules that are not represented there.

    Related JSON Tools

    Need to create a schema first? Use the JSON Schema Generator to infer a starting schema from sample JSON, then review its rules before relying on it. To check only JSON syntax, use the JSON Validator. For a readable view of nested data, open the JSON Viewer.