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:

JSON
1
2
3
4
5
6
7
8
9
10
{
 "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, and age
  • id must be an integer
  • name and email must be strings
  • email must be a valid email format
  • age must be between 0 and 150
  • id, name, and email are 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

KeywordPurposeExample
typeData type"type": "string"
propertiesObject properties"properties": { "name": {...} }
requiredRequired fields"required": ["id", "name"]

Constraint Keywords

KeywordPurposeExample
minimumMinimum value"minimum": 0
maximumMaximum value"maximum": 100
minLengthMinimum string length"minLength": 3
maxLengthMaximum string length"maxLength": 50
patternRegex pattern"pattern": "^[a-z]+$"
enumAllowed values"enum": ["active", "inactive"]
formatSpecial formats"format": "email"

Type Constraints

JSON
1
2
3
4
5
6
{
 "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:

JSON
1
2
3
4
5
6
7
8
9
{
 "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:

JSON
1
2
3
4
5
{
 "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

JSON
1
2
3
4
5
6
7
8
9
10
{
 "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:

JSON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
 "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:

JSON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
 "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:

JSON
{ "type": "integer" }

Invalid Data:

JSON
"123" // String, not integer

Fix: Use the correct type: 123 (without quotes)

Error: Missing Required Field

Schema:

JSON
1
2
3
4
{
 "properties": { "email": { "type": "string" } },
 "required": ["email"]
}

Invalid Data:

JSON
{ "name": "John" } // Missing email

Fix: Include all required fields

Error: Value Out of Range

Schema:

JSON
1
2
3
4
5
{
 "type": "integer",
 "minimum": 0,
 "maximum": 100
}

Invalid Data:

JSON
150 // Exceeds maximum

Fix: Use a value between 0 and 100

Error: Invalid Format

Schema:

JSON
1
2
3
4
{
 "type": "string",
 "format": "email"
}

Invalid Data:

JSON
"john.example.com" // Missing @

Fix: Use valid email: "john@example.com"

Practical Example: User Registration API

Your API accepts user registration with this schema:

JSON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
 "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:

JSON
1
2
3
4
5
6
7
{
 "username": "john_doe123",
 "password": "securePassword123",
 "email": "john@example.com",
 "age": 25,
 "terms_accepted": true
}

Invalid (multiple errors):

JSON
1
2
3
4
5
6
7
{
 "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 Comparison

CapabilityFindUtils
Schema ValidationYes
Schema GenerationYes
Draft 7 SupportYes
Detailed Error MessagesYes
Client-Side ProcessingYes
No Signup RequiredYes

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:

JSON
1
2
3
4
5
6
7
{
 "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

Validate with confidence! ✅