Format JSON with indentation and colors in many terminals.

Section: Pretty-printing

Pretty-print with jq

bash
bash
jq . data.json
Explanation

The most common CLI workflow for readable JSON.

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 Pretty-printing
Pretty-print with Python
Format JSON using the standard library.
OpenIn sheetbashsame section
Pretty-print with sorted keys
Sort object keys for predictable diffs.
OpenIn sheetbashsame section
Compact JSON with jq
Emit a minified one-line form.
OpenIn sheetbash2 tag match
Pretty-print an API response
Pipe JSON from an HTTP request into jq.
OpenIn sheetbash2 tag match
Minify with Python
Serialize JSON without extra whitespace.
OpenIn sheetbash1 tag match