Back to Blog
9 min read
Tutorial

JSON Schema Validator Online: Validate JSON Against a Schema

Learn what JSON Schema is, which drafts matter (4–2020-12), how SchemaStore helps, and how to use a free browser validator for APIs, configs, and package.json.

✓ Validate JSON before it breaks production

A JSON Schema validator checks whether a JSON document matches rules you define: required fields, types, enums, string patterns, and nested objects. This guide explains when you need validation, how drafts differ, how community schemas (SchemaStore) fit in, and how to use our free JSON Schema Validator in the browser—no account, data stays local.

Why validate JSON against a schema?

JSON is everywhere: REST APIs, config files, CI definitions, and tool manifests. Syntax-only checks (valid JSON) are not enough—you also need to know that fields exist, types are correct, and values stay within allowed ranges. A schema encodes those expectations so humans and tools agree on what "valid" means.

🛡️Catch mistakes early

  • Reject bad API payloads before they hit your backend
  • Document request and response shapes alongside OpenAPI or AsyncAPI
  • Keep config files (package.json, tsconfig, workflows) consistent

📚Single source of truth

  • Share schemas between teams and code generators
  • Pair with editors that offer completion from schema
  • Reuse public schemas from SchemaStore for known file types

What is JSON Schema?

JSON Schema is a JSON document that describes structure and constraints for other JSON data. It can specify type, required keys, properties, enum values, string pattern, numeric minimum/maximum, and nested objects and arrays. A validator takes your data JSON plus the schema and reports whether the data conforms, usually with paths and messages for each error.

Schemas often declare which specification they follow using $schema, for example Draft 7 or 2020-12. Your validator must use a compatible engine for that draft—mixing drafts is a common source of confusion.

Which JSON Schema draft should you use?

JSON Schema evolved across drafts; keywords and behavior differ slightly. Modern tools often support Draft 7 (widely deployed) and Draft 2020-12 (current work). Older codebases may still use Draft 4 or Draft 6. Draft 2019-09 introduced $recursiveRef and other changes on the path to 2020-12.

Rule of thumb: match the $schema URL in your schema file to the draft your toolchain expects. If you validate online, select the same draft in the tool before clicking validate.

What is SchemaStore?

SchemaStore.org hosts hundreds of community-maintained JSON Schemas for well-known files: npm package.json, TypeScript tsconfig.json, GitHub Actions workflows, ESLint, Prettier, and more. Instead of copying a schema by hand, you can load the catalog entry and validate your file against the canonical schema—ideal when you only care that your JSON matches the ecosystem's expectations.

Using the Spoold JSON Schema Validator

Our JSON Schema Validator runs in your browser: paste your JSON document in one panel and your JSON Schema in the other, pick the draft (Draft 4, 6, 7, 2019-09, or 2020-12), then validate. You get clear errors with JSON paths when something fails. You can load built-in samples, pull schemas from SchemaStore, and keep working without sending payloads to a server.

1Prepare your JSON

Paste the instance you want to check—an API response body, a config snippet, or a full file. Fix JSON syntax errors first if the editor reports them.

2Add the schema

Paste your schema or load one from SchemaStore. Confirm the draft selector matches your schema's $schema declaration.

3Validate and fix

Run validation and read each error path. Adjust your JSON or tighten/loosen the schema until the document passes—or until you have intentionally strict rules for CI.

Common pitfalls

  • Draft mismatch — Validation uses the draft you select; if it does not match $schema, results can be wrong or misleading.
  • Additional properties — Depending on draft and keywords, extra properties may or may not be allowed; use additionalProperties explicitly when you care.
  • Confusing syntax with semantics — Valid JSON that fails schema is still "valid JSON"; only a schema check catches business rules.

Related tools on Spoold

Format and explore JSON with the JSON Formatter, compare versions with JSON Diff, convert between JSON and YAML with JSON ↔ YAML, or escape strings with the JSON Escape tool. Together they cover editing, diffing, and validating structured data in your workflow.

Start validating in seconds

Open the free JSON Schema Validator, paste your document and schema, choose the right draft, and validate—client-side, no sign-up.

Open JSON Schema Validator

Try It Now

Put this guide into practice with our free tools. No sign-up required.

Try JSON Schema Validator
JSON Schema Validator Online: Validate JSON Against a Schema | Spoold Blog | Spoold