Back to feed
Dev.to
Dev.to
7/9/2026
jq, json.tool, or a browser formatter? How I pretty-print curl JSON

jq, json.tool, or a browser formatter? How I pretty-print curl JSON

Short summary

A practical guide to pretty-printing JSON from curl responses, comparing jq, Python's json.tool, and browser-based formatters. The author recommends jq as the default, json.tool as a fallback in constrained environments, and browser formatters only for sharing—with a critical security warning about online formatters that retain pasted data. Includes jq redaction patterns to strip secrets before sharing.

  • jq is the default for terminal JSON formatting; json.tool is the fallback when jq isn't installed
  • Browser formatters should only be used for sharing, and only static-site ones with no server-side processing
  • Always redact secret-bearing keys with jq before pasting JSON into Slack or GitHub issues

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more