How to Validate JSON Against a Schema Online

JSON Schema is a standard for describing the structure and validation rules for JSON data. It lets you define required fields, data types, value constraints, and patterns that valid JSON must follow. Validating JSON against a schema is essential for API development, configuration validation, and data quality assurance. This guide shows you how to validate JSON against schemas using fixie.tools — a free JSON Schema validator with detailed error reporting.

Step 1: Open the JSON Schema Validator

Go to fixie.tools/json-schema in your browser. The tool validates JSON locally in your browser with no server uploads, keeping your data private and providing instant validation results.

Step 2: Enter Your JSON Schema

In the schema input area, paste or type your JSON Schema definition. This describes what your valid JSON should look like — required properties, data types, allowed values, string patterns, array constraints, and more. If you don't have a schema yet, use the example schemas provided or consult the JSON Schema specification. The tool supports JSON Schema Draft 7, which is the most widely used version.

Step 3: Paste Your JSON Data

In the data input area, enter the JSON you want to validate against your schema. This could be an API request payload, configuration file, form submission data, or any JSON you need to verify matches the expected structure. The tool validates syntax first, then checks the data against your schema rules.

Step 4: Review Validation Results

The tool instantly validates your JSON and displays results. If validation succeeds, you'll see a green success message confirming the JSON conforms to the schema. If validation fails, you'll see detailed error messages showing exactly what's wrong: missing required properties, incorrect data types, values outside allowed ranges, or pattern mismatches. Each error includes the JSON path where the problem occurred, making it easy to locate and fix issues.

Step 5: Fix Errors and Revalidate

Use the error messages to correct your JSON or schema. Common issues include misspelled property names, wrong data types (string instead of number), missing required fields, or values that don't match enum constraints. Edit your JSON or schema and the tool revalidates automatically in real-time. Once all errors are fixed, you'll see the validation success message.

Frequently Asked Questions

What is JSON Schema?
JSON Schema is a vocabulary for describing and validating the structure of JSON data. It defines rules like required properties, data types (string, number, boolean, object, array), value constraints (minimum/maximum, string patterns), and nested structures. Schemas are themselves written in JSON format.
Why validate JSON with a schema?
Schema validation ensures data quality and API contract compliance. Use it to validate API requests before processing, verify configuration files match expected format, test API responses during development, enforce data structure rules, and generate clear error messages when data doesn't match expectations. It catches errors early before they cause runtime failures.
What can JSON Schema validate?
JSON Schema can validate data types (string, number, integer, boolean, null, object, array), required vs optional properties, allowed values (enums), numeric ranges (minimum/maximum), string formats (email, URL, date, regex patterns), array constraints (min/max items, unique items), and nested object structures. It's extremely flexible and powerful.
Is the JSON Schema validator free?
Yes, Fixie's JSON Schema Validator is completely free with no signup requirements, no size limits (within browser memory), and no ads. All validation happens locally in your browser for instant results and complete data privacy.
What JSON Schema version is supported?
The tool supports JSON Schema Draft 7, which is the most widely adopted version. Draft 7 includes features like if/then/else conditionals, readOnly/writeOnly properties, and content encoding. Most APIs and tools use Draft 7, making this validator compatible with the majority of existing schemas.

Related Tools