# Structured Output Validator > Validate AI JSON output against a JSON Schema: parse errors with line/column, plain-language fixes. Paste a JSON Schema (or an OpenAI/Anthropic/MCP wrapper around one) and the model's output. The tool extracts the JSON from markdown code fences or surrounding prose, reports syntax errors with exact line and column, validates against a draft 2020-12 subset (types, required, additionalProperties, enum, const, ranges, lengths, patterns, items, anyOf/oneOf/allOf, local $ref and more) with human explanations and hints for typical LLM mistakes, and suggests a repaired JSON only for trivial issues such as code fences or trailing commas. Part of usefulweb.site (https://usefulweb.site/). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://structuredoutputvalidator.usefulweb.site/ (interactive tool at https://structuredoutputvalidator.usefulweb.site/tool) - JSON API: POST https://structuredoutputvalidator.usefulweb.site/api/v1/calculate with a JSON object of inputs (schema: https://structuredoutputvalidator.usefulweb.site/api/v1/tool) - OpenAPI: https://structuredoutputvalidator.usefulweb.site/openapi.json - MCP (Streamable HTTP): https://structuredoutputvalidator.usefulweb.site/mcp - tool `structured_output_validator` ## Inputs - schema (textarea, required): JSON Schema - Plain schema or a response_format / function-tool wrapper. - output (textarea, required): AI output - Raw model output; code fences and prose around the JSON are handled. - maxErrors (integer): Maximum errors listed ## Method - Extraction: raw JSON if the output starts with { or [; otherwise the first ```json (or JSON-looking) code fence; otherwise the first balanced {…} / […] in the prose. - Parsing uses a strict RFC 8259 parser that reports the first error with line and column in your original text (single quotes, unquoted keys, NaN/None/True, trailing commas, unescaped line breaks are named explicitly). - Repair is attempted only for trivial issues – removing code fences/prose and trailing commas. Anything else is reported, never guessed. Validation then runs on the repaired JSON and says so. - Validation implements the draft 2020-12 core used by structured-output APIs: type, enum, const, properties, required, additionalProperties, patternProperties, propertyNames, min/maxProperties, items, prefixItems, contains, min/maxItems, uniqueItems, minimum/maximum (incl. exclusive), multipleOf, min/maxLength, pattern, anyOf, oneOf, allOf, not, if/then/else, dependentRequired and local $ref. format is checked for common formats and reported as a warning. Unknown keywords are listed as not checked. - Wrappers (OpenAI response_format/json_schema, Responses text.format, function tools, Anthropic input_schema, MCP inputSchema) are unwrapped; with strict: true the OpenAI strict-mode rules (closed objects, all properties required) are checked too.