AI JSON Repair Tool

Fix broken LLM JSON: strip markdown fences, trailing commas, single quotes, and more.

Paste broken LLM JSON above to auto-repair it

Related Tools

Learn More

FAQ

What types of JSON errors does this tool fix?
The tool fixes: markdown code fences (```json ... ```), trailing commas before closing brackets or braces, single-quoted strings replaced with double quotes, unquoted object keys, missing closing brackets/braces (counted by comparing opens vs closes), and JavaScript-style comments (// line comments and /* block comments */).
Why do LLMs produce broken JSON?
Language models generate text token by token without a formal JSON parser. Common mistakes include wrapping output in markdown code blocks, using Python-style single quotes, adding trailing commas, or truncating the output mid-structure if the context window is exhausted.
What is the difference between AI JSON Repair and AI JSON Fixer?
JSON Repair applies targeted fixes assuming the input is mostly JSON. JSON Fixer is more aggressive — it first extracts the JSON substring from mixed text (finding the first { or [ and its matching closer) and then applies the same repairs. Use JSON Fixer when the model wrapped JSON in prose.

Automatically repair malformed JSON commonly produced by language models. Handles: stripping markdown code fences (```json...```), removing trailing commas before } or ], replacing single quotes with double quotes, adding quotes to unquoted keys, adding missing closing brackets and braces, and removing JavaScript comments (// and /* */). Each applied fix is listed below the output.