Guide

JSON Format vs Minify

Use this guide when JSON is valid but you need it easier to read, smaller to copy, or easier to compare.

Short answer

  • Format JSON when humans need to read or review it.
  • Minify JSON when compact text is easier to store, paste, or transfer.
  • Use a diff when you need to inspect the exact before-and-after text.

Format vs minify

ActionOutputBest for
FormatIndented, multi-line JSONReviewing API responses, config, and examples
MinifyCompact one-line JSONReducing whitespace before copying or saving
DiffAdded and removed textChecking exactly what changed

What formatting validates

JSON formatting requires valid JSON syntax. If parsing fails, fix the syntax before formatting or minifying.

A successful format does not prove that the JSON matches a schema or application contract.

Compare output when it matters

Formatting should not change the parsed JSON value, but a text diff can still help you review the exact whitespace and line changes.

FAQ

Does minifying JSON change the data?

No. Minifying removes unnecessary whitespace while keeping the parsed JSON value the same.

Does formatting JSON validate a schema?

No. It checks basic JSON syntax by parsing, but it does not validate application-specific schema rules.

When should I use a text diff?

Use a diff when you need to inspect what changed between the original JSON text and formatted or edited output.