JSON

JSON Repair

Fix broken JSON — trailing commas, single quotes, unquoted keys, comments, Python literals (True/False/None), and more — with a full list of every fix applied.


                    

Data that claims to be JSON often has small deviations from the spec: a trailing comma, single quotes, unquoted keys, Python literals like True/False/None instead of true/false/null. This tool fixes such issues automatically and lists every fix it applied.

How to use it

Common uses

Things to keep in mind

The tool only fixes syntax errors — it won't catch a broken data structure (a missing field, swapped values), since that kind of JSON is still syntactically valid.

If the damage is severe enough (a string cut off mid-way, for example), the automatic fix can produce an unexpected result — always check the output before using it.

Article about this tool: JSON Repair: why JSON breaks and how to fix it

Frequently asked questions

What kinds of errors can this tool fix?

Trailing commas, single quotes instead of double quotes, unquoted keys, comments (which are not valid in JSON), Python literals like True/False/None, missing commas or colons, and unclosed strings, objects, or arrays — with a full list of every fix applied.

Can broken JSON always be repaired?

No. If the input is fundamentally ambiguous or truncated badly enough that data is genuinely lost, there is no single unambiguous "correct" repair to fall back on.

Is it safe to paste broken data from logs or an API here?

Yes, the repair runs entirely in your browser via JavaScript, and nothing is sent to a server.

What if the repaired result looks wrong?

Always check the result manually, especially around the point of truncation. Automatic repair makes a "least destructive" guess (usually just closing open brackets), but it cannot guess what value was actually intended if the data is badly damaged.

Does the tool fix logical errors in the data?

No, only syntax errors. If a field is missing entirely or values are swapped around (but the JSON is otherwise syntactically valid), the tool will not catch it — that is not a syntax error.

Articles: JSON