JSON Repair.
Fix broken and AI-generated JSON in one click — trailing commas, single
quotes, Python True/None, comments, smart quotes, and
unbalanced braces. See a log of every fix. 100% private, in your browser.
No signup · No uploads · No file-size cap
Repaired JSON
Repair JSON online - fix broken JSON privately
A JSON repair tool turns almost-valid text into valid JSON. Paste broken JSON above to fix trailing commas, single quotes, unquoted keys, comments, Python values, smart quotes, and broken AI-generated JSON. The tool validates the output and keeps the whole process client-side.
How to repair JSON in three steps
- Paste the broken JSON — code fences, prose, and all.
- Press Repair JSON to fix quotes, commas, comments, and braces.
- Review the repair log before you trust the output.
Built for invalid JSON and LLM JSON
Many AI tools return JSON inside Markdown fences or with small syntax mistakes. This fix JSON workflow removes those wrappers, repairs common syntax issues, and shows what changed so you can review the result before using it in an app, API call, or config file.
Language models generate text one token at a time, so nothing forces the output to be syntactically valid — and the damage is remarkably consistent. This is what a typical broken LLM response looks like:
Sure! Here's the JSON you asked for:
```json
{
// the user record
'name': 'Ada',
"active": True,
"score": 42,
"tags": ["admin", "dev",],
``` Six separate problems, all at once:
- Prose before the JSON (“Sure! Here's…”)
- A Markdown
```jsoncode fence wrapping it - A
//comment, which JSON does not allow - Single quotes instead of double quotes
- Python's
Trueinstead oftrue - A trailing comma, and the closing brace missing entirely (truncated)
Repaired:
{
"name": "Ada",
"active": true,
"score": 42,
"tags": ["admin", "dev"]
} The JSON errors this fixes — and what they mean
Expecting property name enclosed in double quotes
— unquoted keys or single quotes. Your text is a Python dict or a
JavaScript object literal, not JSON.
Unexpected token } in JSON at position … — a
trailing comma before the closing brace or bracket. Legal in JavaScript,
illegal in JSON.
Unexpected end of JSON input — the input is
truncated, with braces left unclosed. Usually an LLM hitting its token
limit, or a partial download.
Unexpected token N in JSON — a Python None, True, or NaN. JSON only knows null, true, false.
One honest warning about auto-repair
Repairs are syntactic. They fix quotes, commas, and braces — they never invent values. That matters most for truncated input: if an LLM was cut off after 8 of 50 records, closing the brackets produces perfectly valid JSON containing 8 records. The other 42 are genuinely gone, and no tool can recover them.
This is exactly why the repair log exists, and why this tool shows one instead of silently rewriting your data. Read it before you push the output into a pipeline — “valid” and “complete” are not the same thing.
Why use this JSON fixer?
It is private, fast, and transparent. After repairing, you can format the JSON, validate the JSON, or compare it with the original. For a deeper walkthrough, read how to repair JSON.
FAQ
JSON repair, answered.
How do I repair JSON online? +
Paste broken JSON into the repair tool and press Repair JSON. It fixes common JSON syntax problems, validates the repaired output, and shows a log of what changed. The repaired JSON can then be copied or downloaded.
What JSON errors can this tool fix? +
It can fix many almost-JSON problems: trailing commas, single quotes, unquoted keys, comments, smart quotes, Markdown code fences, Python True/False/None, and some unbalanced braces or brackets.
Can it fix AI-generated or LLM JSON? +
Yes. AI-generated JSON often includes code fences, extra comments, Python-style values, trailing commas, or missing closing braces. This JSON repair tool is designed to clean those common LLM JSON issues and produce valid JSON.
What is the difference between JSON repair and JSON validation? +
A JSON validator tells you whether the input is valid and where it breaks. A JSON repair tool tries to turn invalid or broken JSON into valid JSON. The best workflow is to repair first, review the repair log, then validate the final output.
Does the repair log show what changed? +
Yes. The tool shows a repair log so you can see the fixes applied, such as removing trailing commas, converting Python values, or stripping comments. That makes it safer than tools that silently rewrite your data.
Is my broken JSON uploaded to a server? +
No. JSON repair happens 100% in your browser. Your input and repaired output are never uploaded, stored, logged, or seen by any server.
Why does ChatGPT or Claude return broken JSON? +
Language models generate text token by token, so nothing guarantees the output is syntactically valid. The usual damage is predictable: the JSON is wrapped in a ```json Markdown fence, prose is added before or after it, trailing commas creep in, Python's True/False/None appear instead of true/false/null, and long responses get cut off mid-structure leaving braces unclosed. This tool targets exactly those patterns.
What causes 'Expecting property name enclosed in double quotes'? +
You have unquoted keys or single quotes — usually because the text is a Python dict or a JavaScript object literal rather than JSON. JSON requires double quotes on every key and every string value. Repairing converts { name: 'Ada' } into { "name": "Ada" }.
Can it fix JSON that was cut off mid-way? +
Often, yes. Truncated output — common when an LLM hits its token limit — leaves unbalanced braces and brackets. The repairer closes them to produce parseable JSON. Be careful, though: it can only recover the data that is actually there. If the response was cut off, the missing records are genuinely gone, and closing the braces just makes the fragment valid. Always check the repair log.
Is it safe to auto-repair JSON? +
It is safe as long as you review what changed, which is why this tool shows a repair log rather than silently rewriting your data. Repairs are syntactic — fixing quotes, commas, and braces — and never invent values. But a repair that closes a truncated array will produce valid JSON that is missing data, so read the log before trusting the output in a pipeline.
What is the difference between JSON5 and JSON? +
JSON5 is a relaxed superset that permits comments, trailing commas, unquoted keys, and single quotes — everything strict JSON forbids. Config files are often written in JSON5 style. If a parser rejects your file, converting the JSON5-isms into strict JSON is exactly what this repair tool does.