b2KIT

API Response Formatter

Format and prettify API responses in JSON, XML, and HTML with syntax highlighting and collapsible sections.

Tested tool guide Tested browser tools Checked August 15, 2026

What API Response Formatter does and how it behaves

API Response Formatter takes a raw JSON, XML, or HTML payload - typically copied from a browser's network tab, a curl response, or a webhook log - and re-serializes it with indentation, color-coded tokens, and collapsible object/array/element sections so a large response can be navigated instead of scrolled as one unbroken line. The most common surprise: for JSON and XML, the pasted text must conform to that format's grammar, so a Python-style dict (single-quoted keys, trailing commas) or a JS object literal with unquoted keys is rejected as invalid JSON rather than silently corrected for you; HTML is handled more leniently, since the standard HTML parsing model applies error recovery to malformed markup instead of rejecting it outright.

How the result is produced

1

Parse before render

The pasted text is parsed against the grammar of the selected format before anything is rendered - JSON per RFC 8259, XML per its tag and attribute well-formedness rules. For JSON and XML, input that breaks the grammar is treated as invalid and the tool will not format it until the underlying issue is fixed. HTML is different: its standard parsing model defines error recovery for malformed markup, so near-miss HTML generally still produces some rendered structure rather than being rejected outright.

2

Indent, highlight, collapse

Once parsed, the structure is re-serialized with indentation and each token - keys, string and number values, booleans, tags, attributes - is colored by type. Objects, arrays, and nested elements can be collapsed via toggles, so a branch you don't need can be folded while the rest stays expanded - the main advantage over a plain-text pretty-printer.

Good uses

  • pasting a response copied from a browser devtools network tab to read it without scrolling one long minified line
  • expanding a minified webhook or log payload to locate one specific field buried several levels deep
  • collapsing sections of a large XML or SOAP response to isolate just the element you're currently debugging

Limits and checks

  • strict validation means near-JSON such as Python dict output (single quotes, trailing commas) or a JS object literal with unquoted keys will error rather than being auto-corrected
  • array element order is preserved as parsed, since JSON and XML sequences are inherently ordered; JSON object key order is not guaranteed by the format itself (RFC 8259 treats objects as unordered), so don't rely on key order surviving a round-trip byte-for-byte
  • parsing and rendering happen entirely in the browser, so a multi-megabyte response can make the page slow or briefly unresponsive

Common questions

Will it fix broken JSON for me?

No. For JSON and XML it parses against the format's grammar and won't render input that breaks it; for near-JSON like a Python dict or a JS object literal, you need to fix the underlying issue - such as unquoted keys, single quotes, or a trailing comma - yourself first. HTML is more forgiving, since malformed markup generally still renders due to HTML's built-in error recovery.

Does my API response get uploaded anywhere?

No, formatting runs in your browser and the pasted response is not sent anywhere else in the process. That makes it usable for responses with internal hostnames or non-public data, though you should still avoid pasting genuine credentials or secrets into any web-based tool.

References and verification

The behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools