JSON Validator
Validate JSON against schemas with detailed error reporting. Generate schemas from JSON.
¿Qué es 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.
Cómo usar JSON Validator
- Enter your JSON data in the left panel — this is what you want to validate.
- Enter your JSON Schema in the right panel — this defines the rules your JSON must follow.
- Validation runs automatically. Green checkmark means valid; red X with error details means invalid.
- Click 'Generate Schema' to auto-create a basic schema from your JSON data as a starting point.
- Click 'Copy JSON' or 'Copy schema' to grab either the validated data or the schema itself.
Ejemplos
Valid user object
Entrada
{ "name": "Alice", "age": 30, "email": "alice@example.com" }
Salida
{ "$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
Entrada
{ "tags": ["javascript", "json", "schema"] }
Salida
{ "type": "object", "properties": { "tags": { "type": "array", "items": { "type": "string" }, "minItems": 1, "uniqueItems": true } }, "required": ["tags"] }
Errores comunes
- 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]+$/'.
Por qué usar esta herramienta
- 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.