The FindUtils JSON Schema Validator lets you paste a JSON Schema and a data payload, then checks a supported subset of schema rules — all in your browser with no data uploaded to servers. You can also auto-generate schemas from sample JSON using the FindUtils Schema Generator.
JSON Schema is a vocabulary for validating JSON structure. Instead of discovering data errors at runtime, schema validation catches problems immediately. It's like a blueprint that says "JSON data must have these fields, with these types, and these constraints."
What is JSON Schema
JSON Schema defines the rules JSON data must follow:
{
"type": "object",
"properties": {
"id": { "type": "integer" },
"name": { "type": "string" },
"email": { "type": "string", "format": "email" },
"age": { "type": "integer", "minimum": 0, "maximum": 150 }
},
"required": ["id", "name", "email"]
}This schema says:
- The data must be a JSON object
- It defines rules for
id,name,email, andage idmust be an integernameandemailmust be stringsemailmust be a valid email formatagemust be between 0 and 150id,name, andemailare required (others optional)
How to Get Started
Use the FindUtils JSON Schema Validator to validate data against schemas, or the JSON Schema Generator to auto-generate schemas from sample data. These browser tools work with the supplied JSON. Use example data, and check the validator limits below.
What the browser validator does not prove
JSON Schema keywords define the intended contract. A validator must implement those keywords to enforce it. The current FindUtils browser validator implements a subset and does not enforce every dialect feature.
In this version, integer values can report a type error because the type check uses JavaScript typeof. The validator also does not enforce const. The registration example below uses const: true to express consent, but a conforming application validator must check it.
Use a full validator in the application that accepts the data. Check JSON Schema dialects and the constant-value rule before you rely on the examples.
Key Schema Keywords
Basic Type Keywords
| Keyword | Purpose | Example |
|---|---|---|
type | Data type | "type": "string" |
properties | Object properties | "properties": { "name": {...} } |
required | Required fields | "required": ["id", "name"] |
Constraint Keywords
| Keyword | Purpose | Example |
|---|---|---|
minimum | Minimum value | "minimum": 0 |
maximum | Maximum value | "maximum": 100 |
minLength | Minimum string length | "minLength": 3 |
maxLength | Maximum string length | "maxLength": 50 |
pattern | Regex pattern | "pattern": "^[a-z]+$" |
enum | Allowed values | "enum": ["active", "inactive"] |
format | Special formats | "format": "email" |
Type Constraints
{
"type": "string",
"minLength": 3,
"maxLength": 50,
"pattern": "^[A-Z][a-z]*$" // Must start with capital letter
}This string must be:
- 3 to 50 characters long
- Start with a capital letter
- Contain only letters
How to Validate JSON Against a Schema Online
Step 1: Write or Paste Your Schema
Create a JSON Schema defining your data rules. Start simple:
{
"type": "object",
"properties": {
"username": { "type": "string" },
"password": { "type": "string", "minLength": 8 },
"email": { "type": "string", "format": "email" }
},
"required": ["username", "password", "email"]
}Step 2: Paste Your Data
Paste the JSON you want to validate:
{
"username": "johndoe",
"password": "securePassword123",
"email": "john@example.com"
}Step 3: Click Validate
The validator checks if data conforms to schema:
- ✓ Valid — Data matches all rules
- ✗ Invalid — Data violates rules, with specific error messages
Step 4: Fix Errors
If invalid, the validator shows exactly what's wrong:
Error: password must be at least 8 characters Error: email is not a valid email format
How to Auto-Generate a Schema from Existing JSON
Writing schemas manually is tedious. A schema generator creates one from sample JSON:
Step 1: Paste Sample JSON
{
"user": {
"id": 123,
"name": "John Doe",
"email": "john@example.com",
"age": 30,
"active": true,
"tags": ["admin", "developer"]
}
}Step 2: Generate Schema
Open the findutils.com JSON Schema Generator and the tool infers the schema:
{
"type": "object",
"properties": {
"user": {
"type": "object",
"properties": {
"id": { "type": "integer" },
"name": { "type": "string" },
"email": { "type": "string" },
"age": { "type": "integer" },
"active": { "type": "boolean" },
"tags": {
"type": "array",
"items": { "type": "string" }
}
}
}
}
}Step 3: Refine
Add constraints:
{
"type": "object",
"properties": {
"user": {
"type": "object",
"properties": {
"id": { "type": "integer" },
"name": { "type": "string", "minLength": 1 },
"email": { "type": "string", "format": "email" },
"age": { "type": "integer", "minimum": 0, "maximum": 150 },
"active": { "type": "boolean" },
"tags": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["id", "name", "email"]
}
}
}Common Validation Errors and How to Fix Them
Error: Type Mismatch
Schema:
{ "type": "integer" }Invalid Data:
"123" // String, not integer
Fix: Use the correct type: 123 (without quotes)
Error: Missing Required Field
Schema:
{
"properties": { "email": { "type": "string" } },
"required": ["email"]
}Invalid Data:
{ "name": "John" } // Missing emailFix: Include all required fields
Error: Value Out of Range
Schema:
{
"type": "integer",
"minimum": 0,
"maximum": 100
}Invalid Data:
150 // Exceeds maximum
Fix: Use a value between 0 and 100
Error: Invalid Format
Schema:
{
"type": "string",
"format": "email"
}Invalid Data:
"john.example.com" // Missing @
Fix: Use valid email: "john@example.com"
Practical Example: User Registration API
Your API accepts user registration with this schema:
{
"type": "object",
"properties": {
"username": {
"type": "string",
"minLength": 3,
"maxLength": 20,
"pattern": "^[a-zA-Z0-9_]+$"
},
"password": {
"type": "string",
"minLength": 8
},
"email": {
"type": "string",
"format": "email"
},
"age": {
"type": "integer",
"minimum": 13,
"maximum": 120
},
"terms_accepted": {
"type": "boolean",
"const": true
}
},
"required": ["username", "password", "email", "terms_accepted"]
}Valid registration:
{
"username": "john_doe123",
"password": "securePassword123",
"email": "john@example.com",
"age": 25,
"terms_accepted": true
}Invalid (multiple errors):
{
"username": "jd", // Too short
"password": "short", // Too short
"email": "not-an-email", // Invalid format
"age": 12, // Below minimum
"terms_accepted": false // Required to be true
}Tools Used in This Guide
- JSON Schema Validator — Validate data against a schema online
- JSON Schema Generator — Auto-generate schemas from sample JSON data
JSON Schema Validator Comparison
| Capability | FindUtils |
|---|---|
| Schema Validation | Yes |
| Schema Generation | Yes |
| Draft 7 Support | Yes |
| Detailed Error Messages | Yes |
| Client-Side Processing | Yes |
| No Signup Required | Yes |
FAQ
Q1: What's the difference between JSON Schema Draft 4, 6, 7?
A: Newer versions add more keywords and flexibility. Draft 7 is one dialect. Later dialects include 2019-09 and 2020-12. Choose the dialect supported by your application validator and declare it with $schema.
Q2: Can I use JSON Schema in my API? A: Yes! Many API frameworks (Express, FastAPI, etc.) have schema validation libraries. Validate on the server side to ensure data quality.
Q3: Is JSON Schema just for validation? A: It's primarily for validation, but also used for API documentation generation, testing, and code generation.
Q4: Can I validate arrays?
A: Yes! Use "type": "array" with "items" to define what each element must look like:
{
"type": "array",
"items": {
"type": "object",
"properties": { "name": { "type": "string" } }
}
}Q5: Should I auto-generate or write schemas manually? A: Auto-generate to get started, then manually refine. The generator gives you structure; you add constraints.
Next Steps
- Compare JSON files to spot schema violations
- Learn JSON conversion for interoperability
- Return to the complete JSON tools guide
Validate with confidence! ✅