Fix Invalid JSON
Paste broken JSON and repair common syntax errors instantly. Fix trailing commas, quotes, comments, malformed keys, and other common issues directly in your browser.
- Fix invalid JSON fast
- Repair common syntax issues
- Private browser processing
- No upload required
What we fixTrailing commas · Quotes · Comments · Unquoted keys
Paste invalid or lenient JSON here.
Fix Invalid JSON: Resolve Parse Errors Fast
When your parser throws Unexpected token, Unexpected end of input, or Expected property name, paste the failing JSON here. We pinpoint the line and column, explain the cause, and apply a one-click fix: all in your browser.
Use this page when you came in from a parse error message and want a guided fix tied to that exact error. For batch cleanup of lenient JSON-like text (logs, JSON5, configs with comments) where you just want strict JSON out, JSON Repair is the higher-throughput tool. For just confirming whether something parses, use JSON Validator.
Why JSON Becomes Invalid
How to Fix
- Paste invalid JSON into the input panel.
- Click Fix JSON (or press Ctrl+Enter).
- Review the fixed JSON and the summary of what changed.
- Copy the valid JSON, or open the Formatter for pretty-print tweaks.
Common Error Messages
- Unexpected token: often a stray character, comma, or quote where the parser expected something else.
- Unexpected end of JSON input: the document ended before an object, array, or string was closed.
- Expected property name: a key is missing, not quoted, or there is an extra comma before
}. - Unexpected string in JSON: structure is wrong, such as a string where a key or colon was expected.
- Trailing comma: a comma appears where the next token cannot follow in strict JSON.
Frequently Asked Questions
Should I use Fix Invalid JSON or JSON Repair?
Use this page when you arrived from a specific parser error and want the fix tied to that message. Use JSON Repair when you have lenient JSON-like text (logs, JSON5, configs with comments) and just want strict JSON out.
How does this match a JSON.parse error to a fix?
After repair, the tool reports the line and column where strict JSON broke and groups changes by error class (trailing comma, unquoted key, single-quoted string, bad escape). See the error mapping section above for each parser message.
What errors can it fix?
Typical fixes include trailing commas, comments, single quotes, unquoted keys, and undefined → null. Very damaged text may still fail.
Can it remove trailing commas?
Yes, when they are the kind of trailing commas this repair pass is designed to handle.
Can it add missing quotes?
Yes for many unquoted object keys. Strings still need to follow recognizable patterns.
What if repair fails?
Trim the snippet, fix obvious unmatched brackets, and try again. For a strict second opinion, use the JSON Validator.
Does it work on mobile?
Yes. Editors are touch-friendly, and the sticky bar helps you fix and copy quickly.
Is repaired output valid JSON?
Successful repair means the result parses as JSON. You can still validate before using it in production.
Related Tools