HTTP Headers Parser

Parse raw HTTP headers into structured JSON, preserving repeated fields and HTTP/2 pseudo-headers. Choose folding and credential masking.

Inspect header structure

Paste a request/response head from a terminal or developer tools. A start line is optional for a single section. Original header spelling and order are preserved, while byName groups repeated names case-insensitively into arrays. Set-Cookie fields remain separate instead of being incorrectly comma-joined.

HTTP/2 pseudo-header text such as :method and :status is supported. CRLF and LF are accepted. Several sections separated by blank lines are supported when each later section starts with an HTTP request or status line; other text after a blank line is treated as body data and ignored.

Folding, masking and limits

Obsolete folded lines are rejected by default; enable unfolding only when inspecting legacy captures. Common credential headers are flagged and masked unless you turn masking off. Nonstandard secrets may not be recognized. This parses text locally and does not send an HTTP request.

Limits: 200,000 input characters, 8,192 characters per header line, 1,000 fields per section and 1,000,000 output characters. Control characters, bare carriage returns and malformed names are rejected. This is an inspection tool, not a complete protocol validator or network scanner.

Questions & answers

Are repeated headers discarded?

No. They remain ordered in headers and grouped as arrays in byName. This preserves distinctions that can matter for Set-Cookie and other fields.

Can I paste a request with a body?

Yes, but the body is not parsed. After a blank line, only an explicit new HTTP start line begins another header section.

Other Languages

HTTP Headers Parser — Base64.sh

HTTP Headers Parser

Parse raw HTTP headers into structured JSON, preserving repeated fields and HTTP/2 pseudo-headers. Choose folding and credential masking.

Share:

References

How we make sure

We check this tool with the automated test suites linked below. Example checks are shown in their original language.

Verification method
Check repeated/pseudo/folded headers, HAR timing phases and credential masking without replaying log URLs.
Comparison reference
Fixed HTTP/HAR fixtures and expected parsed results.
Verification scope
These samples and boundaries do not prove correctness for every input.
Test source and cases (select a file to read it)
  • code-tools.test.js
    • HTTP headers parser preserves repeats and pseudo-headers, supports legacy folding explicitly and ignores bodies

These checks cover the listed examples and boundaries, not every possible input. Round trips and checks using the same library are not independent verification.