Fix LLM JSON — Repair Broken AI Output
How to fix invalid JSON from ChatGPT?
Paste your output into the browser tool below — repair trailing commas, missing quotes, and common LLM JSON mistakes. Nothing is uploaded.
Paste JSON from ChatGPT, Claude, or other LLMs when JSON.parse
fails. This guide covers the usual AI mistakes — markdown code fences, smart quotes, trailing commas, and
half-finished objects — then use our browser-only validator to find the error line and format
clean JSON. Nothing is uploaded.
When ChatGPT or Claude gives you broken JSON
-
Markdown fences — remove
```jsonand```at the start and end before parsing. -
Smart quotes — replace curly
“ ” ‘ ’with straight double quotes". -
Trailing commas — delete the comma after the last item in
{ }or[ ]. -
JavaScript extras — remove
undefined, comments, or unquoted keys; JSON is stricter than JavaScript. -
Truncated replies — the model stopped mid-object; paste a complete block or fix missing
}/].
Fix workflow (see what broke, then repair)
- Paste AI output into the JSON lint tool.
- Click Validate — read the error message and line hint.
- Fix one issue at a time (fence, quote, comma) and validate again.
- Click Format when parsing succeeds.
Validation runs entirely in your browser — good for API keys, prompts, and private LLM payloads while you fix LLM JSON step by step.
Fix LLM JSON vs auto-repair libraries
Tools like json-repair on npm can auto-patch some errors. This site focuses on
clear errors + pretty-print so you see exactly what failed — a lightweight
fix llm json online option when you want control without sending data to a server.
Related: Fix product feed JSON · JSON compare guide · JSONLint guide · Lint JSON guide