Skip to content
jsonforge.app

JSON Validator

Validate JSON against schemas with detailed error reporting. Generate schemas from JSON.

JSON data
Loading editor…
JSON Schema
Loading editor…
Enter JSON data and a schema to see validation results.

What is JSON Validator?

A JSON Schema validator checks whether JSON data conforms to a schema — a blueprint that defines the expected structure, types, and constraints. The schema acts as a contract: it specifies which properties must exist, what data types are allowed (string, number, boolean, object, array), which values are permitted, and rules like minimum/maximum lengths or required fields. JSON Schema is itself JSON, making it easy to version, share, and generate. This validator implements the JSON Schema Draft 7 specification and supports the most common validation keywords: type, properties, required, items, enum, const, minimum/maximum, minLength/maxLength, pattern, format, additionalProperties, min/maxItems, and uniqueItems. Use it to validate API payloads, configuration files, or any structured data before processing it.

How to use JSON Validator

  1. Enter your JSON data in the left panel — this is what you want to validate.
  2. Enter your JSON Schema in the right panel — this defines the rules your JSON must follow.
  3. Validation runs automatically. Green checkmark means valid; red X with error details means invalid.
  4. Click 'Generate Schema' to auto-create a basic schema from your JSON data as a starting point.
  5. Click 'Copy JSON' or 'Copy schema' to grab either the validated data or the schema itself.

Examples

Valid user object

Input

{ "name": "Alice", "age": 30, "email": "alice@example.com" }

Output

{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "name": { "type": "string" }, "age": { "type": "number" }, "email": { "type": "string", "format": "email" } }, "required": ["name", "age", "email"] }

Array with constraints

Input

{ "tags": ["javascript", "json", "schema"] }

Output

{ "type": "object", "properties": { "tags": { "type": "array", "items": { "type": "string" }, "minItems": 1, "uniqueItems": true } }, "required": ["tags"] }

Common mistakes

  • Forgetting to set required for mandatory fields — by default every property is optional, so use the required array (e.g. required: ['name']) to specify which properties must be present.
  • Using additionalProperties: false when you need extensibility — it forbids any property not defined in properties, so use true (the default) or a sub-schema if you need to accept extra fields.
  • Not quoting pattern regex strings — pattern must be a regex string without / delimiters; write 'pattern': '^[a-z]+$' rather than 'pattern': '/^[a-z]+$/'.

Why use this tool

  • Auto-generate schemas from JSON — click 'Generate Schema' to create a working JSON Schema from your data, a great starting point for documentation and validation.
  • Detailed error reporting — get the exact path, message, and offending value for every validation error, so you can pinpoint what's wrong and where instead of guessing.
  • Draft 7 standard compliance — implements the most widely-used JSON Schema keywords, so schemas you write here are compatible with other tools and libraries.

Frequently asked questions