Lesson 3 of 67 minFormat, Validate, and Debug
Format JSON for Readability
Formatting does not change the data. It adds indentation so humans can scan nested objects and arrays.
Core concepts
- Formatting improves readability.
- Minified JSON is common in API responses.
- Indentation reveals nesting.
- Pretty JSON is easier to review.
Example
{"user":{"name":"Ava","roles":["admin","editor"],"active":true}}Practice
Use the playground to format the minified sample, then identify the top-level keys and nested arrays.
Checklist
- Format first.
- Scan top-level keys.
- Expand nested objects mentally.
- Avoid editing before you understand the shape.
Quiz
What does formatting JSON usually change?