You've seen this before: a frontend sends a request, the backend crashes, and the logs say TypeError: Cannot read properties of undefined. The payload was missing a required field, or a number arrived as a string. JSON Schema exists precisely to stop this class of bugs before they reach production.

This guide explains what JSON Schema is, how to write one, and how to validate JSON data against it — right in your browser.

What Is JSON Schema?

JSON Schema is a vocabulary that describes the structure of JSON data. It's itself written in JSON and defines:

What fields are required