Skip to content

Pretty-Printing Minified JSON Files in the Terminal

If you have a compact or minified JSON file and want to make it human-readable, you can use fx to pretty-print it instantly.

Basic Command

bash
cat input.json | fx

This opens an interactive, syntax-highlighted JSON viewer in your terminal. You can expand/collapse objects and navigate deeply nested structures easily.

Output Example

Pipe From Other Commands

You can also pretty-print JSON from any tool that outputs JSON:

bash
curl https://api.example.com/data | fx

or

bash
docker inspect container_id | fx

Why fx?

  • No need to remember formatting flags.
  • Works out-of-the-box with streams.
  • YAML support with --yaml flag.