API Response Formatter
Paste a raw API response and get it formatted. Detects JSON, XML, NDJSON and form data, separates status and headers, and unwraps escaped JSON. Free tool.
Make any raw API response readable
Paste whatever you have: the output of curl -i, a log line or a network capture. The formatter works out what kind of content it is and formats it to match, without you having to pick a format first. Status lines and headers are kept neatly above the body, and a note tells you what was detected.
This differs from a plain JSON formatter, which would reject the input the moment it saw the headers.
Formats it recognises
- JSON, with long numbers preserved exactly as sent.
- Escaped JSON, where a whole document is wrapped in a string, as is common in logs and message queues. It is unwrapped first.
- NDJSON, with one JSON value per line, as used by log streams and bulk APIs.
- XML, and HTML if it happens to be well-formed. Other markup is left unchanged.
- Form data such as
a=1&b=2, shown as JSON. Plus signs and percent codes are decoded. - Anything else is left as plain text.
Example
The output of curl -i with a compact JSON body. The status and headers stay at the top, and the body is expanded.
HTTP/2 200 OK
content-type: application/json
{"data":[{"id":1,"name":"Asha"}],"meta":{"page":1}}
---
HTTP/2 200 OK
content-type: application/json
{
"data": [
{
"id": 1,
"name": "Asha"
}
],
"meta": {
"page": 1
}
}Tips for debugging responses
Use curl -i to include the status line and headers in the output you paste. When a redirect or a 100 Continue block is printed before the real response, the formatter skips to the last one so you see the final answer. Check that content-type matches the body. A JSON API that returns text/html often means a proxy or login page has replied in place of your API. If you need to dig further, send the output to our JSON Viewer to fold large sections, or use the JSONPath Tester to pull out specific values.
Frequently Asked Questions
How is this different from the JSON Minifier and Beautifier?
That tool needs valid JSON. This one accepts a complete HTTP message or other formats, and it detects the type for you.
Why was my HTML not formatted?
HTML is only reformatted when it is also well-formed XML. Real-world pages rarely are, because tags like <br> have no closing tag, so they are left as they are.
Can I paste a response with sensitive data?
Formatting happens in your browser and nothing is uploaded. Even so, remove tokens and cookies before sharing the result with anyone.
What does Detected escaped JSON mean?
The input was a JSON string whose text was itself JSON. The tool decoded the outer layer and formatted the inner document.