JSON Schema Validator

Check JSON data against a JSON Schema.

Paste JSON or upload a file. Nothing is sent to a server.

What Is a JSON Schema Validator?

A JSON Schema validator checks whether a JSON document follows the rules in a JSON Schema like which properties are required, what type each value has, which values are allowed, and how arrays and nested objects are shaped. You can use it to test API payloads, config files and data exports before they reach production.

This validator runs in your browser, your schema and data are not uploaded to Geekflare servers.

How to Use It

  1. Paste or upload your JSON Schema on the left. If you don't have one yet, create it from a sample with the JSON Schema Generator.
  2. Paste or upload the JSON data you want to check on the right.
  3. Leave Schema draft on auto-detect, or pick the draft your schema is written for.
  4. Select Validate JSON. Each error shows the line in your data, where the problem is, what's wrong and the schema rule that failed. Select a line number to jump to it.

Reading the Errors

ErrorWhat it meansUsual fix
is missing required property "email"An object doesn't have a property listed in requiredAdd the property, or remove it from required if it's optional
must be integerThe value has the wrong type, such as "1001" instead of 1001Change the value's type, or widen type in the schema
has a property that is not allowedadditionalProperties: false blocks a property the schema doesn't listRemove the property, or add it under properties
must match format "email"A string doesn't match its formatFix the value, or turn off format checking if format is only a note
must be one of ...The value isn't in the enum listUse one of the listed values, or add the new value to the enum
must NOT have fewer than 1 itemsAn array is shorter than minItemsAdd items, or lower minItems

When the location is (root), the problem is with the top-level value itself, such as a missing required property.

Supported Drafts

Draft$schema valueNotes
2020-12https://json-schema.org/draft/2020-12/schemaCurrent draft. Used when the schema doesn't declare one
2019-09https://json-schema.org/draft/2019-09/schemaAdds unevaluatedProperties and $defs
Draft 7http://json-schema.org/draft-07/schema#Still common in older tools. Adds if, then and else
Draft 6http://json-schema.org/draft-06/schema#Adds const, contains and propertyNames
Draft 4http://json-schema.org/draft-04/schema#exclusiveMinimum and exclusiveMaximum are booleans here

The same schema can behave differently between drafts, so declare $schema in your schemas to keep results consistent across tools.

When the Schema Itself Is Wrong

Before checking your data, the tool checks the schema against its draft's meta-schema. A typo such as "type": "strnig", a keyword with the wrong kind of value, or a $ref that points to another file is reported as a schema problem with its line in the schema, so you don't chase errors in data that's fine.

$ref references inside the same schema work, such as #/$defs/address. References to other files or URLs aren't loaded, so copy those definitions into the schema under $defs.

Tips for Reliable Validation

  • Declare $schema so every validator reads your schema the same way.
  • Use additionalProperties: false on objects where unknown fields should be rejected, such as config files.
  • Keep format checks on for user input, and treat them as hints for data you don't control, since validators differ on edge cases.
  • Test the schema with a few failing examples, not only a valid one, so you know it rejects what it should.
More Utilities & Converters tools
Free to start · No card

Building your own app? Try the Geekflare API.

One API key for scraping, search, screenshots, DNS, PDF, and more.

bash
curl -X POST https://api.geekflare.com/webscraping \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com"}'