What gets fixed, and what no tool can guess.
Repair is a heuristic pass over the source text, not a re-serialisation of a parsed value: it runs before JSON.parse, so it can rescue text that would never have parsed. String literals are masked out first, which is what keeps the fixes from reaching inside your data.
| Broken input | What happens to it |
|---|---|
// note, /* block */ | Comment removed, surrounding structure untouched |
{ "a": 1, } | Trailing comma dropped |
{ a: 1 } | Unquoted key quoted |
{ 'a': 1 } | Single quotes converted, inner quotes escaped |
True, None, undefined, NaN | true, null, null, null |
+.5, 1., 0x1f | 0.5, 1, 31 |
The part that is not rule-based
Repair does not invent a value, does not choose between two duplicate keys (the last one wins and you are warned), and does not decide whether a bare token was meant to be a string or a number. Anything the rules cannot settle falls through to jsonrepair, which reconstructs structure — unbalanced brackets, concatenated objects, fragments of a truncated stream — and the status bar says which path produced the result.
jsonrepair is also coarser about numbers than the text pass above: run the Repair module on 0x1f and it arrives as the string "0x1f", on 1. as 1.0, and on NaN as the string "NaN" — valid JSON, but not the type you meant. The formatter's repair pass is the one that rewrites those to 31, 1 and null.
NOTE Every repair is reported. If a fix changed meaning, you are told what was touched rather than quietly handed different data.
What you get on this page
- ▸Strip line and block comments
- ▸Remove trailing commas
- ▸Quote bare object keys
- ▸Convert True, False, None and undefined
- ▸Fallback to jsonrepair for badly broken input
Because bracekit is a static application, this page loads quickly, caches well and never sends your data to a parsing server. Your formatting preferences, recent documents and snippets stay in local storage.