JSON repair
What this is
jsonformatter.curiousconcept.com added “fix” because developers paste object literals, not JSON. Repair walks the text outside of strings and: strips // and /* */ comments, turns single-quoted strings into JSON strings, quotes bare keys, maps True/False/None/undefined/NaN/Infinity, and removes trailing commas. It is not a JS parser — if you paste a function, it will still fail. Always re-validate after a repair; the result should round-trip through JSON.parse.
Open the formatter — paste stays in this tab.
{
// from a JS file
user: { name: 'Ada', },
tags: ['cron',],
active: True,
}FAQ
- Will repair change my data?
- undefined, NaN, and Infinity become null. Comments disappear. That is the point of turning JS into JSON.
- JSON5?
- Repair aims at RFC 8259, not JSON5. Hex numbers and extra JSON5 syntax are not rewritten.