When working with JSON responses from servers, raw payloads are often "minified"—stripped of all whitespace to save bandwidth. While efficient for machines, minified JSON is impossible for developers to debug without formatting.
Pretty-Printing Indentation Options
- 2 Spaces: The industry standard in modern JavaScript, TypeScript, and web development.
- 4 Spaces: Traditional format preferred in Python, Java, and C# environments.
- Tabs: Uses a single tab character per indentation level, letting developers view it at their preferred width.
Minification: Shrinking Payloads
Minification strips indentation spaces, tabs, and line breaks while preserving string contents. On typical API payloads, minification reduces file size by 20% to 40%.