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
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
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
- Normalize CRLF and CR line endings to LF and split the block into numbered lines.
- If the first non-empty line matches the request-line or status-line grammar, read it as the start line.
- Report a leading-whitespace continuation line as obsolete folding rather than joining it.
- Split each field line on its first colon; validate the name as an RFC 9110 token; trim optional whitespace from the value.
- Group repeated names and record every malformed line with its 1-based line number.
Usage
- Paste a raw header block (optionally including the request or status line).
- Choose whether to preserve the original field-name case.
- 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
{
"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
{
"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
- RFC 9110 — HTTP Semantics — IETF
- RFC 9112 — HTTP/1.1 — IETF
- MDN Web Docs — HTTP headers — MDN
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.