What is JSON Pretty Printing?
Pretty printing JSON is the process of converting compact, single-line JSON into an indented, multi-line format that humans can read and navigate. The term "pretty print" comes from the concept of typesetting — presenting data in its most readable visual form.
Pretty Print JSON with Python
In Python, json.dumps(data, indent=2) pretty prints a dictionary to JSON. Our browser tool does the same thing instantly, without writing any code.
Pretty Print JSON with JavaScript
JSON.stringify(data, null, 2) in JavaScript produces pretty-printed JSON with 2-space indentation. Our tool is the browser equivalent — paste, click, done.
When Do You Need JSON Pretty Printing?
- Debugging API responses copied from browser Network tab
- Reading log files that use inline JSON
- Reviewing
package.json,tsconfig.json,.eslintrcconfigurations - Inspecting database exports from MongoDB, Firebase, or DynamoDB