Why Formatting and Validation Belong Together
Formatting requires parsing. To re-indent JSON a tool must first read it into memory as a data structure, and that read either succeeds or fails. A formatter that reports nothing when the parse fails is hiding information you need; one that reports the failing line has already done the validation work.
What the Validator Catches Before Formatting
- Trailing commas —
{"a": 1,}is valid JavaScript but invalid JSON. - Single quotes — RFC 8259 requires double quotes for both keys and string values.
- Unquoted keys —
{name: "Ada"}is an object literal, not JSON. - Comments —
//and/* */are not part of the JSON grammar. - Unclosed brackets or quotes — reported as an unexpected end of input.
Order of Operations
- Paste JSON into the input pane.
- The document is parsed. On failure, the error line and column are shown and no output is produced.
- On success, the output pane returns pretty-printed JSON at your chosen indent width.
Who this guide is for
- Confirm a payload is valid before pasting it into a request body
- Format a config file and catch a stray trailing comma in the same step
- Check a webhook body copied from a log line, then read it as a tree
- Review a colleague's JSON snippet for both syntax and structure