JSON Output Validator

Validate model JSON against a JSON Schema.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Paste the JSON an LLM produced and the JSON Schema it was supposed to follow, and get a list of every mismatch with its path, such as $.age: expected integer. It runs in your browser; your data is not sent to a model or a server.

How to use

1
Step 1
Paste the model output on the left.
2
Step 2
Paste the JSON Schema on the right.
3
Step 3
Press Run and read the errors.

How it works

The validator walks the data and the schema together, checking: type (object, array, string, number, integer, boolean, null), required keys, properties, array items and enum. Each problem is reported with a path from the root, written $.field[index]. Anything else in the schema is ignored, so a passing result means these checks passed, not that every schema keyword was satisfied.

Worked example

Wrong type and a missing key

Input
JSON: {"name":"Ada","age":"30","tags":[1]} Schema: {"type":"object","required":["name","email"],"properties":{"name":{"type":"string"},"age":{"type":"integer"},"tags":{"type":"array","items":{"type":"string"}}}}
Output
{ "valid": false, "errors": [ "$.email: required", "$.age: expected integer", "$.tags[0]: expected string" ] }
Walkthrough
email is required but absent, age is the string "30" instead of an integer, and the first tag is a number instead of a string.

Limitations

  • Supports only type, required, properties, items and enum. Keywords like additionalProperties, minLength, pattern, minimum, format, oneOf, anyOf and $ref are not checked.
  • Output wrapped in Markdown fences (```json) is invalid JSON; strip the fences first.
  • It does not repair JSON or call a model.

Questions

How do I validate LLM JSON output against a schema?
Paste the output and the schema and press Run. Mismatches are listed with paths.
Which JSON Schema keywords are supported?
type, required, properties, items and enum.
Why does it say Invalid JSON?
The output is not parseable JSON, often because of a code fence, trailing text or a trailing comma.
Is my model output uploaded?
No, validation happens in the browser.

Features

  • Path-based errors
  • Type, required, items, enum
  • Local, no API call

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • Mean, Variance and Standard Deviation

    StatQuest with Josh Starmer

    Stats foundations behind many ML metrics tools.

    Watch on YouTube
  • TensorFlow 2.0 Complete Course

    freeCodeCamp.org

    Practical ML stack context next to AI utilities.

    Watch on YouTube