HDR

HTTP Headers Parser (Raw Headers to JSON)

Inspect request or response text while preserving repeated header fields and their order

API & HTTP
🔒 100% client-side — your data never leaves this page
Maintained by Evan•Updated: September 30, 2026
Options
Input

Paste a request, response or fields-only header block, then select Parse. Advanced mode offers examples. Limit: 1 MiB and 2000 lines.

Output
Parsed headers will appear here
🔒 Parsed in your browser without saving input; results do not prove server or browser behavior.
Page reading mode

The full guide also includes pitfalls, worked examples, snippets, FAQs, and related tools for checking results or troubleshooting.

About this tool

HTTP Headers Parser inspects a pasted request, response, or fields-only header block. It keeps the first field when no start line exists, records original field-name casing, and builds a separate case-insensitive index whose values are arrays. Repeated Set-Cookie fields therefore remain separate and in their original order. Select Parse after editing; the previous result clears as soon as the input changes. A blank line ends the header section, so body text is excluded rather than mistaken for another field. One consistent < or > cURL verbose direction is supported; mixed logs, HTTP/2 binary frames, deprecated folded lines, and complete multi-response captures are outside this text inspector. Malformed names or control characters produce errors while extractable fields remain visible with valid: false. This does not verify every field-specific grammar, Host requirements, framing, cache behavior, authentication or CORS policy. LF and CRLF pastes are accepted, but pasted Unicode text cannot prove valid network bytes. Processing stays in this browser tab without saving the input. The limit is 1 MiB and 2000 lines; redact tokens before copying results elsewhere.

Suggested Workflow

Failure Clinic (Common Pitfalls)

A copied log can contain more than one message

Cause: Redirects, proxy CONNECT exchanges and cURL diagnostics may surround the headers. The first blank line ends this parser’s header section.

Fix: Isolate one complete request or response. A single < or > cURL direction is accepted; do not combine request and response directions or concatenate multiple responses.

A header index does not decide field semantics

Cause: Repeated fields have field-specific rules, and Set-Cookie must not be joined by a generic comma rule. A syntactically extracted Host or Content-Length can still be invalid in its message context.

Fix: Use the ordered fields array as evidence. Check framing and each field’s specification against the actual message before drawing conclusions about routing, caching or authentication.

Production Snippets

Three field occurrences, two distinct names

text

Host: example.com
Set-Cookie: a=1
set-cookie: b=2

Expected: headerCount = 3; uniqueNameCount = 2
byName["set-cookie"] = ["a=1", "b=2"]

Scenario Recipes

01

Compare repeated response fields

Goal: Check whether a capture preserved all Set-Cookie lines.

  1. Paste HTTP/1.1 200 OK, then Set-Cookie: a=1 and set-cookie: b=2 on separate lines.
  2. Parse and verify headerCount is 2, fields has two entries, and byName.set-cookie contains both values.
  3. Add a blank line followed by X-Body: ignored; parse again and verify the header count is still 2.

Result: You can distinguish field occurrence count, normalized lookup and body text without joining cookie fields.

Frequently Asked Questions

Can I paste headers without a request or status line?

Yes. A fields-only block starts parsing at its first field. A recognized request or status line is reported separately.

How are duplicate headers represented?

The fields array preserves every occurrence. byName groups values under lowercase names without comma joining; headerCount counts occurrences.

What happens to text after a blank line?

The first empty line ends the header section. Later text is excluded and a diagnostic explains that a body was ignored.

Why can a result contain fields and still be invalid?

Extraction preserves evidence. An invalid name, folded line, mixed log prefix or control character makes the whole inspection invalid even if other fields parse.

Does HTTP/2 in a pasted status line mean binary HTTP/2 is supported?

No. Text status lines such as HTTP/2 200 from logs are recognized; HPACK, binary frames and HTTP/3 transport are not decoded.

Is a valid parse proof that an API or browser will accept it?

No. The output checks a limited text syntax. Field semantics, message framing and recipient policy need the actual request and response context. Input is neither uploaded for parsing nor stored as a draft.

Keep browsing