JSON cleanup
How to fix invalid JSON common errors
Find missing commas, broken quotes, trailing commas, wrong brackets, and other common JSON formatting problems.
Start with the first parse error
Invalid JSON often has one small mistake that creates several confusing symptoms. Fix the first clear error, then validate again.
- Check quotes around keys.
- Look for missing commas.
- Remove trailing commas.
- Match brackets and braces.
Quick workflow
Paste the JSON into a formatter, read the validation message, fix one issue at a time, then format again before minifying or using it elsewhere.
Do
- Keep a copy of the original.
- Validate before minifying.
- Review nested objects carefully.
Don't
- Do not paste secrets unless necessary.
- Do not assume formatting means the data is semantically correct.
- Do not edit several unknown parts at once.
FAQs
Can JSON be valid but still wrong?
Yes. Valid JSON only means the structure parses. The values may still be incorrect for your use case.
Should I minify JSON before validating it?
No. Validate and review formatted JSON first, then minify only when you need compact output.