JSON (JavaScript Object Notation) is a lightweight data interchange format that's easy for humans to read and write. APIs, config files, and frontend-backend communication all use JSON. Format: key-value pairs separated by colons, objects in , arrays in [].
API responses are usually minified (one long line), making them hard to read. Formatting adds indentation and line breaks so the structure is instantly clear. Essential for debugging APIs, reviewing data, and writing documentation.
Turns minified JSON into an indented, readable format. For example, expanding {"name":"John","age":30} into multiple lines with proper alignment. The most commonly used operation.
The reverse — strip all whitespace and line breaks, compressing JSON into a single line. Used in production to reduce payload size and improve load times.
Checks JSON syntax for errors. Common mistakes: trailing commas, missing quotes, unmatched brackets. The formatter highlights the error location so you can fix it quickly.
❌ Trailing comma: {"a": 1, "b": 2,} ← no comma after last item
❌ Unquoted keys: {name: "John"} ← keys must use double quotes
❌ Single quotes: {"name": 'John'} ← must use double quotes
❌ Comments: JSON does not support comments (// or /* */)