API Response Formatter

Paste a whole HTTP response โ€” status line, headers and body โ€” and inspect it. Get the status code with its meaning, a categorised header table, a formatted and syntax-highlighted body, a collapsible JSON tree with search and JSONPath queries, duplicate-key and numeric-precision warnings, and a cURL command for the matching request.

Response Input

0 B ยท 0 linesNothing is uploaded โ€” parsing happens in this tab

Load a sample response

Rebuild the request as a cURL command
curl 'https://api.example.com/endpoint'

Values are wrapped in single quotes with POSIX escaping, so tokens and JSON bodies survive a paste into bash or zsh unchanged.

Inspector

Paste a response to inspect it

Status code, headers, formatted body, tree view and JSONPath queries

About API Response Formatter

An API response inspector for the text you already have in your clipboard. Paste a complete raw HTTP response โ€” the status line, the response headers and the body โ€” and the tool splits it apart: the status code is shown with its class and meaning, headers are listed and tagged by role (content, cache, cookie, CORS, rate limit, security), and the body is parsed according to its Content-Type. JSON bodies are re-serialized with JSON.stringify, so backslashes, embedded newlines, tabs and control characters survive untouched, then explored through a collapsible tree with key/value search and JSONPath-style queries. XML bodies go through the browser's own XML parser, which reports real parser errors instead of a tag-shaped guess.

Why use a API Response Formatter?

Most JSON tools only accept a bare body, so the interesting half of a debugging session โ€” why the request returned 429, whether the cache header explains the stale payload, whether Set-Cookie is missing HttpOnly โ€” has to happen somewhere else. Pasting the whole response keeps status, headers and body in one view. The body handling is also stricter than a generic beautifier: duplicate object keys are detected on the raw text (JSON.parse silently keeps only the last one), integers past 2^53-1 are flagged as already-lost precision, and out-of-range numbers such as 1e999 are surfaced before they quietly become null on the way back out.

Who is it for?

Backend and integration developers debugging a failing endpoint from curl or the DevTools Network tab, frontend developers working out why a third-party API's payload does not match its documentation, QA engineers capturing a reproducible response for a bug report, and platform engineers checking that rate-limit, cache and security headers are actually being sent.

How to use the tool

1

Copy the response you want to inspect โ€” 'Copy as cURL' output, curl -i output, or the Response tab in your browser's DevTools Network panel

2

Paste it into the input box: a full raw response (status line, headers, blank line, body) is split automatically, and a bare JSON or XML body works too

3

Read the status badge and the header table โ€” headers are tagged content, cache, cookie, CORS, rate limit or security so the relevant ones stand out

4

Stay on the Formatted tab for a syntax-highlighted body; choose 2 spaces, 4 spaces or Tab, and optionally sort object keys to diff two responses more easily

5

If the JSON is invalid, read the error line, column and caret snippet, fix the source text and click Re-parse

6

Switch to the Tree tab to expand and collapse nodes, filter by key or value, and copy any node's value or its path

7

Type a JSONPath expression such as $.data.items[*].id into the path box to pull one field out of every element

8

Open the Analysis tab for structure counts, duplicate-key warnings and numeric-precision warnings, then copy the formatted or minified body, download it, or build the matching cURL command from the request panel

Frequently Asked Questions

How do I inspect an API response?

Paste the response into the input box. If the text begins with a status line such as 'HTTP/1.1 200 OK', or with header lines followed by a blank line, the tool splits it into status, headers and body; otherwise the whole input is treated as the body. The body is then parsed by Content-Type: JSON is validated and re-indented, XML goes through the browser's XML parser, HTML and plain text are shown verbatim. From there, use the Formatted tab to read it, the Tree tab to explore or filter it, and the Analysis tab for structural and precision warnings.

How is this different from the JSON Formatter?

The JSON Formatter takes a JSON document and pretty-prints, minifies or validates it โ€” that is the right tool when all you have is a body. This one is built around the whole HTTP response: it understands the status line, tags headers by role, analyses Set-Cookie flags, picks a parser from Content-Type, and adds a tree view, key/value search, JSONPath queries and cURL generation on top. If you only need indentation, use JSON Formatter. If you are debugging why an endpoint answered the way it did, paste the entire response here.

Is my API response sent to a server?

No. Parsing, formatting, the tree view, JSONPath evaluation and cURL generation all run in your browser via JavaScript โ€” the response never reaches a Toolsana server and is never logged. You can verify this in DevTools' Network tab: interacting with the tool produces zero HTTP requests. That matters here because API responses routinely carry bearer tokens in Set-Cookie or Authorization echoes, customer records and internal identifiers. Nothing is persisted either: reloading the page clears everything you pasted.

Should I paste the raw response or just the body?

Paste the raw response whenever you have it. `curl -i`, `curl -D -`, HTTPie and DevTools' 'Copy response headers' all give you the status line and headers, and those explain most failures: 429 with Retry-After, 304 with an ETag, a 200 whose Content-Type is text/html because a proxy intercepted the call. A bare body still works โ€” the tool sniffs whether it starts with '{', '[' or '<' โ€” but then it cannot tell you anything about status or headers, and Content-Type-driven parsing falls back to guessing.

Why does the tool warn about numbers and duplicate keys?

Because both destroy data silently. JSON has no integer type: JavaScript parses every number as an IEEE-754 double, so a 19-digit Twitter-style ID loses its last digits the moment JSON.parse runs, and a literal like 1e999 becomes Infinity and is written back as null. Duplicate keys are just as quiet โ€” RFC 8259 calls object names 'unique' but does not forbid repeats, and JSON.parse keeps only the last one. The tool flags unsafe integers and non-finite numbers from the parsed value, and detects duplicate keys by scanning the raw text before parsing.

Can I use this to debug a rate-limited request?

That is the main use case for the raw-response mode. Paste a 429 response and the status badge shows it is a client error, Retry-After and every X-RateLimit-* header is tagged 'rate limit', and the body is parsed so you can read the provider's error code. From there, the values tell you what to change: Retry-After is seconds (or an HTTP-date), X-RateLimit-Reset is usually a Unix timestamp, and X-RateLimit-Remaining at 0 means a retry before the reset will fail again. Load the built-in 'Rate-limited response' sample to see the layout.

Which JSONPath syntax is supported?

A deliberate subset, implemented locally with no external library: the root `$`, dot properties (`$.data.page`), bracketed keys for names with spaces or dots (`$['user name']`), array indexes including negatives counted from the end (`$.items[-1]`), and the wildcard `[*]`, which enumerates array elements or object values. Recursive descent (`..`), filter expressions (`[?(@.id>1)]`) and slices (`[0:2]`) are not supported and are rejected with an explicit message rather than silently returning nothing. For key or value text matching anywhere in the document, use the tree filter box instead.

How large a response can I paste?

Input is capped at 5 MB; above that the tool stops parsing and tells you, because a multi-megabyte tree view will jank any browser tab. Syntax highlighting switches itself off past roughly 80,000 characters and the tree renders at most 2,000 nodes at a time, while copy and download always act on the full document. For genuinely large payloads work locally instead: `jq . response.json` formats, `jq '.data.items[].id'` extracts, and `xmllint --format` handles XML. For converting a large JSON array into a spreadsheet, use [JSON to CSV](/tools/json-to-csv/).

Share This Tool

Found this tool helpful? Share it with others who might benefit from it!

๐Ÿ’ก Help others discover useful tools! Sharing helps us keep these tools free and accessible to everyone.

Support This Project

Buy Me a Coffee