What this does
Pretty print is the read path: 2-space or 4-space indent, not minify. Use this when a gateway logged a single-line body or a colleague pasted compact JSON in chat. The formatter on this page is the same engine as JSON Formatter; the copy and default job are about reading, not shipping bytes.
Minify JSON is the opposite job. Mixing them on one generic page hides the intent. This URL exists for people who searched “pretty print.”
Anyone staring at `{"id":1,"items":[...]}` in a terminal and losing nested objects.
Pretty print is a reading lamp, not a build step. CI should not depend on whitespace. Humans should.
If the payload contains tokens, pretty printing it in a shared screenshot is still a leak. Format locally, redact, then share.
API logs love compact JSON because it is one line per event. That is hostile when you are hunting a nested `errors[0].source.pointer`. Beautify a copy, find the field, then go back to the raw log for the timestamp. Do not pretty-print a 20MB dump in a text area if your browser tab starts to wheeze — slice the object first.
Indent is a social convention. Two spaces matches most JavaScript repos and GitHub comments. Four spaces shows up in Java and C# samples. Pick what the surrounding code uses so a pasted snippet does not start a whitespace war in review.
When to use it
- An API client shows compact JSON.
- You need to compare two pretty copies visually.
- You are about to paste JSON into a review comment.
How to
- Paste JSON. From the network panel, log, or file.
- Beautify. Run format with your indent.
- Read. Collapse in your head; check keys.
- Copy if needed. Do not minify unless you are saving bytes.
Features
- Indent choices. 2, 4, or tabs.
- Local parse. Production payloads never leave the tab.
- Copy output. Paste into an editor or ticket.
Why it helps
- See structure. Nested objects stop looking like a ransom note.
- Safer reviews. You spot missing fields before they ship.
Use cases
- Webhook debugging. Stripe-style payloads are unreadable compacted.
- Config in Slack. Pretty print, then paste a snippet, not the secret-laden whole file.
Examples
- Minified array of objects. Beautify, then you can see whether `user` is null or missing.
Common mistakes
- Pretty printing invalid JSON and blaming the tool. Fix trailing commas first, or use the validator.
- Committing pretty JSON into a size-sensitive mobile bundle. Pretty is for humans.
Tips
- Use 2 spaces if you will paste into GitHub. Use tabs only if your repo already does.
- If parse fails, switch to JSON Validator for the line number.
FAQ
- Is pretty print the same as validate?
- Pretty print must parse. If it fails, the JSON is invalid — use the validator for a clearer error.
- Does this sort keys?
- No. Key order is preserved as parsed.