What This Tool Fixes (And What It Doesn't)
This json repair online tool, free to use, targets the handful of mistakes that show up constantly in practice: pasting a JavaScript object literal instead of real JSON, copying output from an LLM that used single quotes or left a trailing comma, or hand-editing a config file and leaving a comment behind. It fixes single quotes, trailing commas, unquoted keys, JS-only literals like undefined and NaN, and both comment styles, everything you need to fix json online without installing anything. It is honest about being narrower than a full fault-tolerant JSON parser like the open-source jsonrepair library, which can also recover from missing string quotes, unescaped quotes, and unbalanced brackets. This tool covers the common cases well and always validates its own output, it never hands back something that merely looks fixed.
How to Repair Broken JSON With This Tool
Paste your broken JSON into the input field, choose an indent width for the output, and the repaired result appears immediately along with a list of exactly which fixes were applied, replaced single quotes, removed trailing commas, quoted keys, and so on. There is nothing to install, so you can fix invalid json in the time it takes to paste and copy. If the text genuinely cannot be repaired, you get a clear error instead of a silently broken result.
The Six Fixes, Explained
Single-quoted strings are converted to double-quoted, since real JSON only allows double quotes. To fix trailing comma json, any comma right before a closing } or ] is removed, since standard JSON forbids it even though JavaScript allows it. Unquoted object keys like name: "Alice" get quotes added around the key. JavaScript-only values, undefined, Infinity, -Infinity, and NaN, are replaced with null, since none of them are valid JSON. Both // line comments and /* block */ comments are stripped entirely, since JSON has no comment syntax at all. Finally, the repaired text is parsed with a real JSON parser, this is what makes this a json validator and fixer rather than just a fixer, if parsing still fails after every other fix, you get a clear error instead of broken output.
Apostrophes and Nested Quotes Are Handled Safely
A naive single-quote fix that blindly swaps every quote character would corrupt a value like "O'Brien" that is already double-quoted, turning it into broken JSON. This json syntax fixer avoids that: existing double-quoted strings are identified and left completely untouched before any single-quoted strings elsewhere in the document are converted, so an apostrophe inside a name, contraction, or possessive is always preserved exactly, whether it started out double-quoted or single-quoted.
Common Uses for a JSON Repair Tool
Fixing a JavaScript object literal pasted from source code into a place that expects real JSON, cleaning up JSON-like output from an LLM that used single quotes or left comments in, repairing a config file after a trailing comma sneaks in during a manual edit, and quickly checking whether a suspicious blob of text is fixable at all are all common reasons to use a json fixer like this one, a json repair free tool with no account required.