What “repair” actually fixes
Strict JSON is unforgiving: one trailing comma and the whole file is invalid. Real-world data rarely arrives that clean — people paste JavaScript object literals from a console, config snippets from a blog post, or a log line with a comment bolted onto the end. The repair button walks your text with a small scanner and safely rewrites:
- Trailing commas —
[1, 2, 3,]becomes[1, 2, 3] - Single-quoted strings —
'value'becomes"value", with inner quotes escaped correctly - Unquoted keys —
{'name'}style keys like{ name: 1 }get quotes - Comments —
// lineand/* block */comments are removed - JS-only values —
undefined,NaNandInfinitybecomenull
It runs character by character, so a comma or colon inside a string is never touched. If the result still will not parse, the original text is left exactly as you pasted it and the error panel tells you where the problem is.
Reading the error message
When JSON breaks, browsers report a position. This tool converts that into a line and column and prints the offending source line with a caret underneath:
line 4, column 12
"price": 19.99,
^ Expected double-quoted property name
Nine times out of ten the real mistake is a few characters earlier — a missing comma on the previous line, or a quote that was never closed.
Format vs minify vs sort
Format expands the document with your chosen indentation so it is readable in a diff or a code review. Minify strips every unnecessary byte — useful when you are pasting JSON into a URL, an environment variable or a database cell with a size limit. Sort keys reorders object keys alphabetically at every level, which makes two documents comparable and keeps config files predictable in version control.
Why the tree view helps
Deeply nested API responses are hard to read even when they are perfectly indented. The tree view renders collapsible nodes with type-coloured values, so you can collapse the 400-element array you do not care about and inspect the two objects you do. Switch back to Code whenever you want to copy the text.
Safety
Your JSON is parsed with the browser’s own JSON.parse — no evaluation, no server,
no analytics on the content. That matters when the payload contains tokens, customer records or
internal URLs. Close the tab and it is gone.