JSON Repair Tool
Data ConversionFix broken JSON automatically — LLM output, hand-edited config and copied code.
Runs entirely in your browser — nothing is uploaded
Features
- Strips markdown code fences and the prose an LLM wraps around its answer.
- Closes brackets on a reply that was cut off mid-object.
- Fixes single quotes, unquoted keys, trailing and missing commas.
- Converts Python None / True / False and NaN / Infinity.
- Repairs smart quotes, stray control characters and unescaped line breaks.
- Lists every change with the line it happened on.
- Leaves already-valid JSON completely untouched.
How to use the JSON Repair Tool
- 1Paste the broken JSON — the whole LLM reply is fine, fences and all.
- 2Read the list of fixes to check each one is what you wanted.
- 3Copy or download the repaired JSON.
Frequently asked questions
What kinds of broken JSON can it fix?
Markdown code fences and surrounding prose, truncation from a token limit, single quotes, unquoted keys, trailing and missing commas, // and /* */ comments, Python’s None, True and False, NaN and Infinity, curly quotes from a word processor, unescaped line breaks and tabs inside strings, hex and octal numbers, and several concatenated objects that were meant to be an array.
How does it fix JSON that was cut off?
It tracks which brackets are still open as it reads, so when the document ends early it closes them in the right order. A half-written string or number at the very end is dropped. That makes it the usual fix for an LLM response that hit its token limit mid-object.
Could the repair change my data?
The repairs are listed with their line numbers precisely so you can check. The parser reads character by character rather than running find-and-replace, so a comma inside a string is never mistaken for a comma between two values — which is exactly how regex-based fixers corrupt data. If the input is already valid JSON, nothing is changed at all.
Why is a number with a leading zero kept as a string?
Because 007 as a number is 7, and that is almost never what the data meant. A leading zero signals an identifier — an SKU, a pin code, an extension — so it is quoted instead.
What does “double-encoded” mean?
A value that was turned into a JSON string and then serialised again, so the whole document is one quoted string containing more JSON. It happens when data passes through a queue or a log field. It is technically valid JSON, so unwrapping it is the one change made to a document that already parses — and it can be switched off.
Is my JSON sent to a server?
No. The repair runs in your browser, which matters here more than anywhere else on the site — broken JSON from a real system tends to contain real keys, tokens and customer records.