GUIDE深度 · Deep dive
Format vs Minify JSON
Formatting adds spaces and newlines for humans; minifying removes whitespace to reduce payload size. APIs usually send minified JSON, while logs and configs often use formatted JSON.
When to format
Debugging API responses, reading configs and writing docs.
Formatting does not change semantics, only whitespace.
When to minify
Production payloads, URL embedding and smaller logs.
Keep numbers, booleans and null types; do not hand-edit strings.
FAQ
Does minifying lose data?
No; only structural whitespace is removed, string content stays.
Can formatted JSON go to production?
Yes, but it is larger; production usually minifies.