TToolFlow
All articles
Developer5 min readSep 30, 2026

Why JSON formatting matters more than you think

A wall of minified JSON hides bugs. Consistent indentation makes reviews faster and diffs readable — here is a workflow that works.

Minified JSON is for machines

Shipping compressed JSON is correct. Reading it is not. When a 4,000-character response arrives as a single line, your eyes cannot compare structure, and a missing bracket is invisible until a parser complains.

The three states of a JSON file

  1. Transport — minified, no whitespace, smallest payload.
  2. Review — indented, sorted keys where it helps, one value per line.
  3. Storage — usually minified, but pretty-printed configuration is easier to audit.

Confusing these states is how a debug session turns into an hour. Format on arrival, review, then minify on the way out.

A workflow that catches errors early

  • Paste the payload into the JSON Formatter and format with two spaces.
  • If parsing fails, read the reported position rather than guessing. Most errors are a trailing comma or an unquoted key.
  • Use key sorting when comparing two payloads; the order of keys is not semantic.
  • Copy the cleaned result into your diff tool instead of comparing raw strings.

Trailing commas and comments

Strict JSON has neither. If your source is JSON5 or JSONC — common in configuration files — the parser will reject it. Keep a separate mental bucket for "JSON-like" formats and avoid pasting them into API clients that expect strict JSON.

Large payloads

Formatting a 20 MB file in a browser tab is possible but slow. For payloads that large, extract the subtree you care about first, then format the fragment. You rarely need to read all of it.

Formatting is a review tool

The goal is not aesthetics. It is making structure visible so that a human can spot the thing that changed. Once you accept that, a formatter becomes part of your review loop rather than a one-off utility.