How to use Pretty Print JSON
- 1. Paste minified JSON. Or drop a .json file from logs or curl output.
- 2. Pretty print. Pick indentation, then copy from the formatted pane.
- 3. Explore structure. Open Tree view for nested objects without scrolling a wall of text.
About this tool
“Pretty print json” and “format json online” are the same practical task: make machine JSON human-readable. This alias exists so the title and H1 match that query instead of a generic tool name.
Pretty print in your editor vs online
IDE formatters are great for files already in git. An online pretty-printer helps when the payload is in a ticket, a chat message, or a production log you cannot save to disk.
Code examples
JavaScript
const payload = JSON.parse(raw);
console.log(JSON.stringify(payload, null, 2));Python
import json
print(json.dumps(json.loads(raw), indent=2, sort_keys=True))Go
var buf bytes.Buffer
if err := json.Indent(&buf, []byte(raw), "", " "); err != nil {
log.Fatal(err)
}