API Response Formatter
Processed Client SidePaste a raw API response and it is auto-detected as JSON or XML and pretty-printed with clean indentation — ideal for reading minified payloads.
Bookmark this tool now — skip the search next time you need it.
About API Response Formatter
This tool runs entirely in your browser. Whatever you paste is processed on your own device and is never uploaded, logged, or sent to any server.
Paste a raw API response and it is detected as JSON or XML and pretty-printed automatically, with no need to say which one it is. Real API responses arrive minified onto a single line, which is fine for the wire and useless for a human trying to find one field. This formats the payload with proper indentation and syntax colouring so the structure becomes visible, and it reports a parse error with the underlying message when the response is malformed — which is itself useful, because a response that will not parse is often the actual bug you are chasing.
Key features
- Automatic format detection — paste JSON or XML without choosing a mode first
- Pretty-prints JSON with a choice of 2-space, 4-space, or tab indentation
- Pretty-prints XML with consistent nesting and indentation
- Badge showing which format was detected, so you can tell malformed JSON from XML at a glance
- Parse errors report the underlying message rather than silently returning nothing
- Syntax-highlighted output, so keys, values, tags, and attributes are visually distinct
- Handles large minified payloads without a size limit
- One-click copy of the formatted result
- Runs entirely in your browser — responses containing tokens or customer data are never uploaded
How to use it
- Paste the raw response into the input pane.
- The format is detected and the payload is pretty-printed immediately.
- Pick 2 spaces, 4 spaces, or tabs for the indentation you prefer.
- Read the structure, then copy the formatted output if you need it.
Tips & common mistakes
- If detection reports neither JSON nor XML, you have probably captured an HTML error page. A 500 page starts with a < character and will be read as malformed XML.
- A response that fails to parse is a finding, not an obstacle — truncated JSON usually means the connection dropped or the server hit a timeout mid-write.
- Capture the raw body with curl -s, or use Copy as cURL from your browser network panel and add -s, so you paste exactly what the server sent rather than what a viewer re-rendered.
- Beware of viewers that pretty-print for you. Both Firefox and Chrome display JSON responses formatted, which hides whether the server actually sent minified content.
- For a payload you need to explore rather than read top to bottom, the JSON Viewer collapsible tree is faster than scrolling formatted text.
- XML with a namespace prefix still formats correctly here, but remember that the prefix is part of the tag name when you write a selector against it.