This tool reads a JSON file, validates its structure, and outputs a neatly formatted (pretty-printed) version of it. It is helpful for debugging, reading complex JSON, or preparing JSON for documentation.
- Validates JSON input
- Pretty-prints JSON with 4-space indentation
- Saves the output to a new file with
_formatted.jsonsuffix - Simple CLI-based interaction
- Python 3.6 or higher
- No external libraries needed (uses built-in
jsonmodule)
- Open terminal in this folder.
- Place your input JSON file in the same directory.
- Run the script with:
python json_formatter.py