HTTP Header Parser
Convert raw HTTP headers into structured JSON.
Input
Output
What is HTTP Header Parser?
HTTP Header Parser converts pasted field-name/value lines into a JSON object. Each line is split at its first colon, and outer whitespace around the name and value is removed. This is a small text converter, not a complete HTTP-message parser or a check of whether a server’s headers are correct.
How to use HTTP Header Parser
Paste Content-Type: application/json and choose Parse Headers. Expect {"Content-Type":"application/json"}, formatted across lines. To try a value containing more colons, use Location: https://example.invalid:8443/path. Everything after the first colon should remain in the value; the page does not request that URL.
When is HTTP Header Parser useful?
Use the result to inspect a small selection of copied fields. Header names keep their original spelling. This JavaScript object treats Content-Type and content-type as separate keys, even though HTTP field names are case-insensitive. The output is therefore a literal text mapping, not a normalized HTTP header collection.
Example
Repeated names with exactly the same spelling overwrite earlier values. If separate lines contain X-Mode: first and X-Mode: second, the result keeps only second. This makes the converter unsuitable for preserving repeated Set-Cookie fields or a complete response. Keep the original header block when repeated fields matter.
Practical notes
Lines without a colon, including an ordinary HTTP status line, are skipped. Invalid field names are not rejected, folded lines are not reconstructed and HTTP/2 pseudo-headers are not parsed correctly. An input without recognized lines can return an empty object rather than an error. Pasted content stays local and no request is sent. Refer to HTTP field semantics when interpreting the original response.