Files
tldr/pages/common/python-m-json.tool.md
2025-10-21 20:06:23 +00:00

361 B

python -m json.tool

Validate and pretty-print JSON data. Part of Python's standard library. More information: https://docs.python.org/library/json.html#module-json.tool.

  • Pretty-print JSON from a file:

python -m json.tool {{path/to/file.json}}

  • Validate and pretty-print JSON from stdin:

echo '{{{"key": "value"}}}' | python -m json.tool