API Response Formatter

Beautify or minify a messy API payload without choosing a format first. JSON and XML are both detected and re-indented in your browser, with parse errors called out by line and column.

Paste the raw response your API just returned and this formatter turns it into clean, indented JSON or XML, or minifies it back into a compact one-line payload. It checks the first character to tell JSON from XML, so there is no mode to pick: a curl dump, a webhook body, or a response copied from the browser Network tab all work. When the payload is malformed it points at the line and column where parsing broke instead of a vague 'invalid' message. Choose two-space, four-space, or tab indentation, sort JSON keys when you want to diff two responses, then copy or download the output.

JSON
Valid JSON · 145 B in · 270 B formatted
Raw response
Beautified

How it works

  1. 1

    Paste the raw response

    Drop the JSON or XML your API returned into the left pane. The badge in the toolbar shows whether it read the payload as JSON or XML.

  2. 2

    Set indentation and toggles

    Pick 2 spaces, 4 spaces, or tabs. Turn on Minify for a compact payload, or Sort keys to put JSON object fields in alphabetical order for easy diffing.

  3. 3

    Copy or download the result

    The right pane rewrites as you type. Copy it or save it as response.json or response.xml; if the input is broken, the exact line and column of the error appear above the panes.

Instant & 100% private — nothing is uploaded

Everything runs locally in your browser. Your code, text and files are processed on your own device and are never sent to a server — so there are no upload waits, no size limits from us, and nothing is ever stored or logged.

Frequently asked questions

How do I format a JSON API response?
Paste it into the left pane and it is pretty-printed on the right as you type. The compact body {"id":42,"tags":["a","b"]} becomes: { "id": 42, "tags": [ "a", "b" ] } Switch the indent to 4 spaces or tabs if your codebase uses those.
Can it format XML as well as JSON?
Yes. It detects XML from a leading < and re-indents the tags with its own formatter, so <user><name>Ada</name></user> becomes a nested, readable block. A simple element like <name>Ada</name> stays on one line rather than splitting across three.
What does the minify option do?
It strips the whitespace back out. Minified JSON drops every space and newline, turning a formatted object back into {"id":42}, and minified XML removes the gaps between tags. That is what you want before sending a payload over the wire or measuring its real byte size.
Why does it show a line and column number?
When the parser cannot read the input it reports where it gave up. A trailing comma in {"a":1,} flags line 1, column 8, so you jump straight to the character to fix instead of scanning the whole blob.