How I Actually Read a Messy API Response
By toolbelt maintainers ·
Updated
You paste a wall of JSON from a network tab and need to see its shape. Here is how formatting helps, and the mistakes I make most often.
What is this tool?
JSON is how almost every API replies. The trouble is that the wire format is a single line with no whitespace, because saving bytes used to matter. A formatter puts the indentation back so you can see what you are dealing with.
How it works
The tool runs your text through the browser's own JSON parser. If it parses, it re-prints the same data with two spaces per level. Nothing is added, removed or reordered — if the values come out different from the values that went in, that is a bug, not a feature. If it does not parse, you get the position where the parser gave up, in line and column, because "Unexpected token" on its own tells you nothing useful.
Example
What you paste:
{"id":42,"user":{"name":"Ada","roles":["admin","dev"]},"ok":true}
What you get back:
{
"id": 42,
"user": {
"name": "Ada",
"roles": [
"admin",
"dev"
]
},
"ok": true
}When to use it
The moment you copy something out of a network tab, a webhook delivery log, or a config file someone else wrote. Also worth doing before you paste JSON into a ticket or a chat message, so the person reading it does not have to reformat it themselves.
Optimization Tips
Reformat first, then read. A surprising number of "the API returned the wrong field" bugs turn out to be a trailing comma or a missing bracket a few hundred characters in. If the formatter fails, jump straight to the reported line rather than scanning the whole payload.
Frequently Asked Questions
Did formatting change my data?
Why does my JSON fail here but work in JavaScript?
Is my payload uploaded anywhere?
What about very large responses?
Related tools
- JSON ValidatorValidate JSON syntax with detailed error messages. Catch trailing commas, missing brackets, and syntax errors instantly before sending payloads to your API.
- JSON MinifierCompress JSON to a single line. Remove all unnecessary whitespace and line breaks to reduce payload size for production APIs without altering the underlying data.
- JSON ViewerView JSON in an interactive, collapsible tree structure. Easily navigate massive API responses, expand specific nodes, and inspect deeply nested objects or arrays.
- XML FormatterFormat and validate XML documents. Add proper indentation, catch malformed tags, and minify XML markup for optimized data transfer in SOAP APIs or RSS feeds.