Why format JSON?
APIs and log files usually send JSON as one long line, which is almost impossible to read or debug. Formatting adds indentation and line breaks so you can see the structure at a glance.
Validating at the same time catches the mistakes that break JSON parsers: trailing commas, single quotes, missing commas and unclosed brackets. Each error is reported with its exact line and column.
- Debugging APIs: paste a response to inspect nested data.
- Comparing files: Sort keys makes two JSON files line up.
- Shipping config: Minify removes whitespace for the smallest payload.