Section: Minify JSON

Compact JSON with jq

bash
bash
jq -c . data.json
Explanation

Useful for logs, payload fixtures, and embedding JSON in scripts.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Minify JSON
Minify with Python
Serialize JSON without extra whitespace.
OpenIn sheetbashsame section
Pretty-print an API response
Pipe JSON from an HTTP request into jq.
OpenIn sheetbashsame section
Pretty-print with jq
Format JSON with indentation and colors in many terminals.
OpenIn sheetbash2 tag match
Pretty-print with Python
Format JSON using the standard library.
OpenIn sheetbash1 tag match
Pretty-print with sorted keys
Sort object keys for predictable diffs.
OpenIn sheetbash1 tag match