How to Read and Parse HTTP Headers

By Ramanathan Aug 11, 2026 1 min read HTTP Headers Parser

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.

About the author

Ramanathan · Software Engineer & Solutions Architect

I'm a Software Engineer and Solutions Architect with 20+ years of experience building enterprise applications across BFSI, Healthcare, Retail, Manufacturing, and Industrial Automation. I've spent those two decades living in JSON, tokens, regexes, and config files — so I built the fast, private, no-login developer tools I always wanted to reach for myself.

Last updated: Aug 11, 2026