Structured Output Validator

Syntactically valid JSON from LLMs or APIs may still violate field types and required keys. This tool validates structured output against JSON Schema locally—reporting missing fields, type errors, and enum violations. Format samples with json-formatter first; tidy OpenAPI component schemas with openapi-formatter before pasting.

Read the full guide: JSON Schema API Design Guide: From Sample Generation to LLM Validation →

Privacy: processed locally, never uploaded.

↓ Paste in the input area below to see results instantly

JSON data

JSON Schema

Notes

Scope

Supports object type, required, and nested properties; basic type checks only. Not a full JSON Schema implementation.

Syntactically valid JSON from LLMs or APIs may still violate field types and required keys. This tool validates structured output against JSON Schema locally—reporting missing fields, type errors, and enum violations. Format samples with json-formatter first; tidy OpenAPI component schemas with openapi-formatter before pasting.

Quick start

  1. Paste JSON

    Left side is model output or sample data.

  2. Paste schema

    Right side uses object, required, and properties.

Use cases

Pair with JSON Schema from Sample to infer a schema, then validate real outputs here.

Typical Workflow

To use this tool, first paste the JSON returned by your LLM into the left input box. Then paste your JSON Schema in the right box. Click validate to see highlighted errors including missing fields, type mismatches, and format issues. Fix the errors and re-validate until the output fully complies with your schema.

For complex schemas, validate in phases: check required fields first, then types, finally nested structures. Simplify schema during debugging to isolate issues. Revalidate whenever API responses change, especially after model updates.

JSON Schema gates

Define required, type, enum, pattern constraints. Same schema for LLM structured output and REST contract tests. Valid JSON may fail schema—json-formatter first, then validate.

Extract schemas from OpenAPI components—openapi-formatter tidies large specs before copy.

LLM workflow

System prompt declares schema; retry or fallback on validator failure. Use llm-json-extractor to strip Markdown fences.

token-counter keeps schema + examples within context.

CI integration mindset

Browser tool for ad-hoc; CI uses ajv with the same schema file. Error paths ($.items[2].price) pinpoint bugs.

json-diff before/after fixes against schema changes.

Examples

Example

Input

{"name":"Ada","score":98}

Output

Valid or issue list

FAQ

Array validation?

Focused on nested objects; review complex arrays manually.

Does validation guarantee production readiness?

Not entirely. While we check structural compliance, real-world usage requires testing field semantics, null handling, text truncation etc. Combine with unit tests and sandbox validation.

Which JSON Schema draft?

See tool implementation—complex $ref may need simplification.

YAML schema?

yaml-converter first for YAML instances or schemas.

Uploaded?

No.

format keyword?

email/date-time format support varies—use pattern for critical rules.