QuietJSON

How to Fix JSON from ChatGPT, Claude & Gemini

Last updated: October 2026 · 5 min read

Large language models like ChatGPT, Claude, and Gemini frequently generate JSON that looks correct but fails to parse. This guide explains the 5 most common LLM JSON errors and how to fix them — automatically or manually.

Fix it automatically — free

Paste broken JSON, get valid JSON in one click. 100% private.

Try JSON Repair →

The 5 Most Common LLM JSON Errors

1. Trailing Commas

JSON does not allow a comma after the last item in an object or array. JavaScript allows it — LLMs trained on JS code frequently include them.

❌ Invalid

{"name": "Alice", "age": 30,}

✓ Valid

{"name": "Alice", "age": 30}

2. Single Quotes Instead of Double Quotes

JSON requires double quotes for all strings and keys. Single quotes are valid in Python and JavaScript, so models sometimes output them.

❌ Invalid

{'name': 'Alice'}

✓ Valid

{"name": "Alice"}

3. Python Boolean & Null Values

Python uses True, False, and None (capitalised). JSON uses lowercase true, false, and null. LLMs trained on Python produce this constantly. See our in-depth reference on fixing Python True, False, and None in JSON.

❌ Invalid

{"active": True, "data": None}

✓ Valid

{"active": true, "data": null}

4. Unquoted Object Keys

JavaScript allows unquoted keys in object literals. JSON requires every key to be a double-quoted string.

❌ Invalid

{name: "Alice", age: 30}

✓ Valid

{"name": "Alice", "age": 30}

5. Markdown Code Fences

ChatGPT and Claude wrap JSON in markdown code blocks for display. When copy-pasted, the backtick fences break parsing.

❌ Invalid

```json
{"name": "Alice"}
```

✓ Valid

{"name": "Alice"}

How to Fix It — 3 Methods

Method 1 — Use QuietJSON Repair Tool (Fastest)

Paste your broken JSON at quietjson.com/json-repair/ and click Repair. Fixes all 5 error types automatically. 100% client-side — your data never leaves your browser.

Method 2 — Fix in Your Prompt

Add to your prompt: "Respond with only valid RFC 8259 JSON. No markdown, no code fences, no trailing commas, no single quotes."

Method 3 — Fix Manually

Find & Replace in your editor: swap single quotes for double quotes, remove trailing commas before } and ], replace True/False/None with true/false/null.

Fix your JSON now — free

No signup. No upload. 100% private. Works on any LLM output.

Open JSON Repair Tool →