JSON Repair
Fix broken JSON automatically: trailing commas, single quotes, unquoted keys, comments, Python literals, code fences, and truncated LLM output.
Local workspace
Named projects in IndexedDB · Local only — never synced to our servers. Worksp…
Batch workspace
Format multiple files locally in one run.
Broken JSON shows up everywhere: LLM replies wrapped in markdown, config snippets with comments and trailing commas, Python dicts pasted from a notebook, and API payloads cut off mid-stream. JSON Repair extracts the JSON from the surrounding text, fixes quoting, commas, and literals with the jsonrepair library, closes anything left open, and formats the result. When the input isn't JSON at all, the error shows where repair stopped instead of guessing. Run the output through the JSON Validator or a schema check before relying on it.
Common errors and fixes
Colon expected
The input isn't JSON. It's often a GraphQL query or JavaScript code; use the GraphQL Formatter or JavaScript Beautifier instead.
No JSON object or array found
The input is plain text or a single value. Paste the broken JSON, including its opening { or [.
Repaired output is missing data at the end
The source was truncated, so there was nothing to recover after the cut. Copy or request the complete payload.
Duplicate keys keep only the last value
JSON parsers keep the last occurrence of a repeated key. Rename duplicates before repairing if both values matter.
Options
| Option | Description |
|---|---|
| Indent | Formatting of the repaired JSON. |
FAQ
What kinds of broken JSON can be repaired?
Trailing commas, single-quoted strings, unquoted keys, JavaScript comments, Python True, False, and None, missing commas, unescaped characters, and truncated documents with unclosed brackets.
Can it fix JSON from ChatGPT, Claude, or other LLMs?
Yes. It pulls the JSON out of a markdown code fence or the surrounding sentences, and closes objects and arrays when the reply was cut off.
Can a repair change my data?
Syntax fixes don't change values. When input is truncated, the repair closes the open structures, but anything that was cut off stays missing, so check the end of the output.
When can't JSON be repaired?
When the input isn't JSON-like, such as a GraphQL query, YAML, or JavaScript code. The error shows the line and column where repair stopped.
Should I repair JSON automatically in production code?
It's a useful safety net for LLM output and legacy data, but validate the result against a schema afterwards. This tool uses the open-source jsonrepair library, which you can add to your own pipeline.