How to use
- Paste the broken JSON — or the whole model reply, including the ```json fence and any text around it.
- The repaired JSON appears instantly, with a list of what was fixed.
- Copy the result, or turn on Minify to get compact output for code or logs.
FAQ
What problems can it fix?
Markdown code fences, text before or after the JSON, // and /* */ comments, single or curly quotes, unquoted keys, trailing commas, missing commas between items, Python and JavaScript literals (True, None, undefined, NaN), raw line breaks inside strings, and output that stops in the middle of a string, array or object.
How do I stop LLMs from returning broken JSON in the first place?
Use the provider’s structured output or JSON mode with a schema (see the JSON Schema Generator), keep max_tokens high enough that the answer isn’t cut off, and validate the result with Zod or a JSON Schema validator. Keep a repair step as a safety net.
Is the repaired data guaranteed to be correct?
The output is always valid JSON, but when the input was truncated the missing part cannot be recovered — open strings are closed as-is and missing values become null. Check the list of fixes to see what was changed.