LLM JSON Output Validator & Repair
Paste the JSON a language model returned and check whether it parses. When it does not, this tool attempts a formatting repair for the usual culprits: markdown code fences, prose wrapped around the JSON, and trailing commas. Everything runs in your browser; nothing is sent anywhere.
Result
Not valid JSON: Unexpected token 'H', "Here is th"... is not valid JSON
Attempted repair
Applied: removed markdown code fence, removed trailing commas.
The repaired text now parses as JSON.
Repaired and pretty-printed
{
"name": "invoice",
"items": [
{
"sku": "A-100",
"qty": 2
},
{
"sku": "B-200",
"qty": 1
}
]
}This tool fixes formatting only: code fences, wrapping prose, and trailing commas. It does not check the JSON against a schema and it will not invent values a model left out.
Common questions
- What does the repair actually fix?
- Formatting, not meaning. It strips a leading or trailing markdown code fence, trims any prose before the first brace and after the last one, and removes trailing commas that sit before a closing brace or bracket. Then it tries to parse the result again.
- Does it check my JSON against a schema?
- No. This tool does not do JSON-schema validation, so it will not tell you whether a required field is missing or whether a value has the wrong type. It only reports whether the text is syntactically valid JSON and offers a formatting repair when it is not.
- Why does the repair sometimes fail?
- The heuristics fix formatting, not truncation or invented syntax. If a model cut off mid-object, mismatched quotes, or wrote a value that is not valid JSON, the repaired text stays invalid on purpose rather than guessing at what you meant. The new parse error is shown so you can see what remains.