When to minify JSON and when not to
A practical guide to choosing JSON minification when size matters, and skipping it when readability or editing matters more.
Minify JSON when transport size matters more than readability
JSON minification removes whitespace without changing the data. That makes sense when the payload must stay small, such as in network requests, API responses, embedded config values or generated files that are meant for machines first.
It also helps when the same data will be stored, copied or passed around often and you want to avoid paying for extra characters that do not add meaning. In those cases, compact output is a real advantage.
Do not minify when humans still need to read or edit the file
If the JSON is still under active review, debugging or manual editing, formatted output is usually the better choice. Indentation and line breaks make nested data easier to inspect and reduce the chance of missing structure during a quick review.
The main tradeoff is simple: minification saves space, while formatting saves time for people. If the file is not yet finished or will be touched by humans again, readability usually matters more than the small size win.