JSON Repair.
Fix broken JSON — trailing commas, single quotes, comments, missing brackets — and see every repair made.
Runs in your browserAbout JSON Repair
JSON Repair takes text that is almost JSON and turns it into valid JSON, listing every fix it made with a line and column. It is built for the JSON you actually meet: a Python dict printed with single quotes and True or None, a JavaScript object literal with unquoted keys and a trailing comma, a config file with // and /* */ comments, a log line cut off in the middle, or a language model answer wrapped in a ```json code fence that stops before the last bracket. For example, {name: 'Ada', tags: ['math', 'code',], active: True becomes {"name": "Ada", "tags": ["math", "code"], "active": true} with the missing closing brace added. The repairer also inserts missing commas and colons, removes JSONP and MongoDB wrappers such as callback( ) or ObjectId( ), escapes raw line breaks and stray backslashes inside strings, converts NaN, Infinity and undefined to null, and wraps several top-level values (NDJSON) in an array. Numbers keep their exact digits, so a long ID is not rounded the way JSON.parse would round it; numbers with leading zeros such as 007 become strings because the zeros usually matter. Always read the repairs table before you trust the output: a repair is a guess about what the author meant, and a quote missing in the middle of a document can shift the rest of it. If the text is already valid, the output is simply reformatted and the repairs table stays empty. Everything runs in your browser and nothing is uploaded.
How to Use
- Paste the broken JSON, including any code fence or wrapper.
- Check the repairs table to see what was changed and where.
- Copy or download the repaired JSON.
Frequently Asked Questions
What kinds of errors can it fix?
Trailing and missing commas, missing colons, single, back and typographic quotes, unquoted keys and values, comments, Python and JavaScript literals, missing closing brackets and quotes, code fences and function-call wrappers.
Can it fix any broken JSON?
No. It applies predictable rules, not guesswork about meaning. A missing quote in the middle of a document can make the rest parse differently, so always review the repairs table.
Does it change my numbers?
Only when they are not valid JSON numbers, for example .5, +1 or 0x1F. Valid numbers are copied digit for digit, so large integers are not rounded.
Is my data uploaded?
No. The repair runs in your browser and the page makes no network requests while you use it.
Related Tools
Pretty print, minify, and validate JSON.
Convert JSON5 or JSON with comments (tsconfig, VS Code settings) to strict, standard JSON.
Compare two JSON documents and see every added, removed and changed value by path.
View JSON as a tree with types and sizes, and get the JSONPath and JSON Pointer of every value.
Convert between YAML and JSON formats.
Test regular expressions with match highlighting.