Check syntax and pretty-print if valid.
Section: Validate JSON files
Validate with Python json.tool
bash
bash
python -m json.tool input.jsonExplanation
A built-in option that many systems already have.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Validate JSON files
Raw newlines inside strings are invalid
Use `\n` rather than an actual line break inside a string literal.