← All articles

Instantly Validate JSON with a Free JSON Schema Validator

2026-10-02 · 4 min read

Advertisement

Instantly Validate JSON with a Free JSON Schema Validator

Why a validator matters right now

What a free JSON schema validator actually does

Choosing the right online tool

Step‑by‑step: validating a payload in seconds

  • Copy the schema – Grab the .json file from your repository (usually under src/main/resources/schema/*.json).
  • Paste the instance – Open your chosen validator, drop the schema into the left pane and the JSON into the right pane.
  • Hit Validate – Click the button (often labeled *Validate* or *Check*). The result panel appears instantly.
  • Read the errors – Each entry shows a JSON‑Pointer like /user/address/zip and a short message, for example *"value is not a number"*.
  • Fix and repeat – Adjust the instance or the schema, then click Validate again. Continue until the error list is empty.

Quick checklist while you’re at it

Real‑world example

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "User",
  "type": "object",
  "required": ["id", "email"],
  "properties": {
    "id": {"type": "integer"},
    "email": {"type": "string", "format": "email"},
    "age": {"type": "integer", "minimum": 0},
    "tags": {
      "type": "array",
      "items": {"type": "string"}
    }
  },
  "additionalProperties": false
}

And the payload you received looks like this:

Advertisement
{
  "id": "42",
  "email": "invalid-email",
  "age": -5,
  "extra": "should be rejected"
}

Running both through the validator shows four errors:
- /id – *"value is not of type integer"*
- /email – *"value does not match format email"*
- /age – *"value is less than the minimum of 0"*
- /extra – *"additional properties are not allowed"*

Fix each issue:
- Change "42" to 42.
- Use a proper email format.
- Set age to a non‑negative number.
- Remove the extra field.

After these changes the validator returns an empty error list.

Integrating the validator into CI

npx ajv-cli validate -s schema/user.json -d payload.json --errors=verbose

The output is the same as the online tools, but it runs automatically on every pull request. Because the package is free and open source, there is no licensing cost.

Common pitfalls and how to avoid them

Bottom line

Feel free to bookmark the three sites mentioned earlier. The next time a contract breaks, you’ll have an answer before the coffee gets cold.

Advertisement
Advertisement