CalcSnippets Search
CLI 1 min read

`jq .` Is the JSON Sanity Check You Should Run When API Payloads and Config Files Have Started Looking Like Untrusted Noise

A practical guide to `jq .` for pretty-printing and validating JSON quickly so malformed payloads, broken config files, and ugly one-line responses become readable and testable.

Why this command matters: JSON becomes much easier to debug the moment it stops looking like a single angry line of punctuation.

jq . is one of the simplest and most useful JSON inspection commands. It pretty-prints valid JSON and fails on invalid JSON, which makes it a great first pass for API responses, config dumps, and generated artifacts.

The command

cat response.json | jq .

Or directly from curl:

curl -s https://api.example.com/items | jq .

That turns unreadable JSON into something you can actually scan.

Why it helps

It is useful when:

  1. API payloads are hard to read
  2. you want quick validation of JSON syntax
  3. a config file may be malformed
  4. you need to inspect nested fields without opening a GUI

This is one of those commands that reduces both visual noise and debugging delay.

Final recommendation

When JSON is involved and your eyes are doing unnecessary work, start with jq .. It is still one of the fastest ways to turn payload noise into readable structure and immediate syntax feedback.

Sources

Keep reading

Related guides