consolelog.tools

API Response Formatter

Beautify a raw API response — paste a full HTTP response and the status, headers and body are split out and the body pretty-printed (JSON/XML/HTML), with a live preview.

About this ToolHow it works, benefits & use cases

Paste a raw API response and this formatter splits it into the parts you care about and pretty-prints the body. If you paste a full HTTP response — status line, headers, blank line, then body — it pulls out the status code (colour-coded by class) and lists every header in a table, then beautifies the body on its own. The body type is auto-detected as JSON, XML, HTML or plain text, or you can force a format. JSON is re-indented with 2, 4 or 8 spaces or a tab, can have its keys sorted alphabetically, or be minified to strip whitespace. A summary reports the detected type, byte size and line count, and for JSON adds the root type, total key count and maximum nesting depth. Parse errors come back with a message and a snippet so you can find the problem. The full state is captured in a shareable URL.

How to Use

  1. 1Paste a raw body, or a full HTTP response (status line + headers + blank line + body), into the API response panel.
  2. 2Choose a Format — Auto-detect, JSON, XML, HTML, or Plain text — and an Indentation of 2, 4, 8 spaces, or Tab.
  3. 3Toggle "Sort JSON keys" to alphabetise object keys, or "Minify" to strip whitespace instead of beautifying.
  4. 4Click "Format response"; the status badge and header table appear above, and the pretty-printed body below.
  5. 5Read the stats line for detected type, size, lines and (for JSON) root, keys and depth, then copy, download, or share the result.

Key Benefits

  • Splits a full HTTP response into a colour-coded status badge, a header table, and the body
  • Auto-detects JSON, XML, HTML or plain text, or lets you force the format
  • JSON beautify with 2/4/8-space or tab indentation, optional alphabetical key sorting, or minify
  • Stats summary: detected type, byte size, line count, plus JSON root type, key count and max depth
  • Clear parse errors with a message and an offending-snippet preview
  • Header-only responses are handled gracefully (shows the headers, notes no body)
  • Shareable URL captures input, format and options; runs entirely in the browser

Common Use Cases

  • Making a one-line API response readable to inspect a value while debugging
  • Pasting the raw output of curl -i to separate the status, headers and JSON body at a glance
  • Confirming an endpoint returned the status code and content type you expected
  • Sorting JSON keys before diffing two responses so unrelated ordering does not noise up the diff
  • Minifying a beautified body back down before pasting it into a test fixture

Formatting options

Strip whitespace instead of beautifying

Paste a raw body or a full HTTP response (status line + headers + body)

Run to see the formatted result.

Was this tool helpful?

Share Your Experience

Help others discover this tool!

Related tools