JSON Formatting Guide
Why formatting matters, how to read nested JSON and common syntax mistakes.
What formatting actually does
Formatting adds whitespace — indentation and line breaks — without changing any values. A formatted document parses to exactly the same object as its minified version.
This makes diffs readable and errors easier to spot, which is why formatted JSON is the default for configuration files and code review.
Reading nested structures
Start from the outermost braces and work inward. Arrays are ordered lists; objects are key/value maps. A tree view helps you collapse branches you do not need right now.
- •Objects use curly braces and named keys
- •Arrays use square brackets and numeric positions
- •Strings must use double quotes in JSON
Common syntax mistakes
Trailing commas, single-quoted strings, comments and unquoted keys are the four most frequent causes of parse errors. JSON does not allow any of them.
Try it yourself
Format, beautify, validate and explore JSON with adjustable indentation and a tree view. Runs locally in your browser.
Open JSON Formatter