How to Read and Parse HTTP Headers
HTTP headers carry the metadata of every request and response — content types, auth tokens, caching rules, cookies. When you copy them out of dev tools or a log, they're a wall of text. Turning them into structured JSON makes them easy to read and compare.
The shape of headers
A raw response looks like this:
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-cache
Set-Cookie: session=abc
The first line is the status line (HTTP/1.1 200 OK); a request instead starts with a request line (GET /users HTTP/1.1). Every line after that is a header: a name, a colon, and a value.
Turning headers into JSON
Parsing splits each Name: Value line into a key and value:
{
"_startLine": "HTTP/1.1 200 OK",
"Content-Type": "application/json",
"Cache-Control": "no-cache",
"Set-Cookie": "session=abc"
}
The status or request line is kept under _startLine so you don't lose it.
Why duplicates become arrays
Some headers legitimately appear more than once — Set-Cookie is the classic case, one per cookie. In JSON a key can't repeat, so repeated headers collapse into an array, preserving order:
"Set-Cookie": ["a=1", "b=2"]
Header names are case-insensitive per the spec, though most tools (including this one) preserve the original casing so what you see matches the source.
Related
Part of The Complete Guide to HTTP. Once you know the response, look up what its status code means, or format the curl command you used to make the request.
Try it
Paste raw request or response headers and get clean JSON instantly — everything runs in your browser, nothing uploaded.