JSON Schema Validator

Validate JSON against a schema, or generate a starting schema from sample data.

Found this useful? Share it

X LinkedIn Reddit WhatsApp

About JSON Schema Validator

When an LLM returns structured output — function-calling arguments, a tool-use response, or JSON forced through a response schema — you need to confirm it actually matches the shape you asked for before using it in code. Paste your JSON Schema and the data to check, and this tool validates it using Ajv, the same JSON Schema validator used by most JavaScript tooling, supporting the full range of schema keywords (types, required fields, enums, patterns, nested objects and arrays, oneOf/anyOf, and more). Every validation error shows exactly which field failed and why. If you don't have a schema yet, switch to Generate Schema, paste a sample JSON object (like an example API response), and get a draft schema inferring types, nested objects/arrays, and required fields — a starting point you can tighten up with constraints Ajv can't infer, like string patterns or numeric ranges.

Frequently Asked Questions

This tool uses Ajv, which supports JSON Schema draft-07 and 2020-12 — the versions used by OpenAI function calling, Anthropic tool use, and most structured-output APIs.

Yes — paste the parameters schema you'd send to the API as the Schema, and a sample of what you expect the model to return as the Data, to confirm the schema is well-formed and behaves as expected before wiring it into your app.

instancePath shows the exact location in your data where validation failed, using JSON Pointer syntax — for example /user/age means the age field inside the user object.

It infers types (string, number, boolean, object, array) and marks every key present in your sample as required — it's a solid starting point, not a final schema. It can't infer constraints like string formats, numeric ranges, or which fields are actually optional, since a single sample doesn't show that.