HTTP Header Parser

Parse a raw HTTP header block into named fields, values, duplicate groups and malformed-line warnings.

  • Runs locally in your browser
  • No upload required

Try it

Paste a raw request or response header block. It is parsed in your browser and never uploaded.

Start line
GET /api/items HTTP/1.1
Fields (4)
Host: example.com Accept: application/json Set-Cookie: a=1; Path=/ Set-Cookie: b=2; Path=/
Duplicate groups
Set-Cookie × 2
Host: example.com
Accept: application/json
Set-Cookie: a=1; Path=/
Set-Cookie: b=2; Path=/

Supported formats

Input
text, boolean
Output
text, json

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

Parsed 4 header field(s) with 1 duplicate group(s) and 1 warning(s).

How it works

  • Read the start line: GET /api/items HTTP/1.1.
  • Split each remaining non-empty line on its first colon, which is the only structural colon in a field line.
  • Preserved the field name's original case.
  • Trimmed optional whitespace from the value and grouped repeated field names.
  • Duplicate field names are legal in HTTP and are reported as groups; combine them per the field's semantics, not blindly.
  • The value is kept as an opaque string; this tool does not interpret cookies, dates or lists.

Methodology

  1. Normalize CRLF and CR line endings to LF and split the block into numbered lines.
  2. If the first non-empty line matches the request-line or status-line grammar, read it as the start line.
  3. Report a leading-whitespace continuation line as obsolete folding rather than joining it.
  4. Split each field line on its first colon; validate the name as an RFC 9110 token; trim optional whitespace from the value.
  5. Group repeated names and record every malformed line with its 1-based line number.

Usage

  1. Paste a raw header block (optionally including the request or status line).
  2. Choose whether to preserve the original field-name case.
  3. Read each field, the duplicate groups and any malformed-line warnings.

Examples

These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.

Request with a duplicate and a malformed line

jsonSelect to copy
{
  "text": "GET /api/items HTTP/1.1\nHost: example.com\nAccept: application/json\nSet-Cookie: a=1; Path=/\nSet-Cookie: b=2; Path=/\nX-Broken line without a colon",
  "preserveCase": true
}

Response status line and headers

jsonSelect to copy
{
  "text": "HTTP/1.1 200 OK\nContent-Type: application/json\nCache-Control:   max-age=60  ",
  "preserveCase": false
}

Limitations

Reading a field line

A field line is a name, a colon and a value. Only the first colon separates them; a colon inside a value (a timestamp, a URL or a media type parameter) belongs to the value. Names are case-insensitive, which is why the duplicate grouping lower-cases them by default, but the tool can preserve the original spelling when you need to inspect what was sent.

Duplicates and folding

A field name may legitimately repeat, so collapsing it to a single value would lose information. The tool instead groups repeats and leaves the interpretation to you. Obsolete line folding was removed from HTTP/1.1 by RFC 9112; a continuation line is therefore surfaced as a warning rather than silently merged into the previous field.

Frequently asked questions

Why is a duplicate header shown as a group instead of one value?
HTTP permits a field name to repeat, and the correct combination rule depends on the field (for example, Set-Cookie must not be joined with a comma). The tool reports the group so you can apply the right rule.
Which line is treated as the start line?
The first non-empty line is treated as the request or status line only when it matches the HTTP/1.x request-line or status-line grammar; otherwise it is parsed as a header field.
Where do my headers go?
Nowhere. Parsing happens entirely in your browser and the value is never collected or transmitted.

Sources

  1. RFC 9110 — HTTP Semantics — IETF
  2. RFC 9112 — HTTP/1.1 — IETF
  3. MDN Web Docs — HTTP headers — MDN