JSON Formatter
About this tool
API responses in DevTools are often a single line. This JSON formatter indents objects and arrays so you can read the tree, then minifies again when you need a compact string. Invalid JSON fails out loud instead of being silently rewritten.
Features
- Pretty-print nested objects and arrays
- Minify to one line for logs or request bodies
- Surface parse errors instead of guessing missing commas
How to use
- Paste JSON from an API response or log line.
- Format to expand indentation.
- Minify when you need a single line.
- If parsing fails, fix syntax or open the JSON validator for a tighter error location.
When to use it
- Inspecting a minified Network-panel payload
- Reading a JSON blob dumped into application logs
- Packing a edited document back into one line for a colleague
Examples
- {"user":{"id":1,"name":"Ada"}} pretty-prints so user, id, and name are easy to scan.
- {id:1} is not JSON; the tool reports the error instead of adding quotes for you.
FAQ
How do I pretty-print JSON online?
Paste the text and format. Use minify when you want one line. It runs in the browser; no account required.
What if JSON fails to parse?
Read the error, then check commas, quotes, and brackets. The JSON validator is better when you need the exact offset.
Can I minify JSON here too?
Yes. Format and minify are two actions on this page. There is no separate minify-only URL.
Is the payload uploaded?
No. Formatting stays on your device, including tokens in debug dumps.
How is this different from a JSON validator?
This page is for reading and compacting. Use the validator when you only care whether the document is legal JSON.
Are comments or trailing commas allowed?
Not in standard JSON. Those documents will fail until you strip comments and extra commas.
Back to JSON Tools Hub
Guides