HTTP Headers Parser — Parse HTTP Headers to JSON Online Free
Parse raw HTTP headers to structured JSON. Perfect for debugging APIs — extracts request line, header count, and all key-value pairs. Works entirely in your browser.
Parsing HTTP headers by hand is tedious and error-prone. The format is simple — Name: Value, one per line — but when you have 20 headers from a server response and you need to check what Cache-Control says, whether the right Access-Control-Allow-Origin is set, or if a custom X-Request-Id header is present, scrolling through a text block wastes time. The HTTP Headers Parser takes a raw header block and turns it into a structured JSON object you can search, copy, and reference directly. Every header becomes a key in the JSON; the request line (if present) is captured as a separate field; and the total header count is included so you can confirm nothing was dropped.
The parser handles the three most common header formats: a request line (GET /api/users HTTP/1.1), a response status line (HTTP/1.1 200 OK), or just bare headers with no first line at all. It preserves the exact header name casing — no normalization, no lowercasing — so you see what was actually sent. This matters for debugging because some server frameworks and middleware are case-sensitive in unexpected ways. The output is a clean JSON document, indented and readable, ready to paste into a code review, an incident report, or a documentation page.
The use case that drives the most traffic to this tool: a developer copies a curl command from a colleague’s Slack message, runs it, gets a response, and needs to inspect the headers. The terminal output is wrapped, the headers are interleaved with the body, and finding a specific header value means scrolling and squinting. Pasting the header block into the parser gives you a searchable JSON document where every header is one line. The alternative — writing a one-off script to parse curl -v output — is exactly the kind of friction that a dedicated tool eliminates. Every byte of header data stays in your browser; nothing is transmitted to a server.
How to use
Paste raw HTTP headers
Paste the raw request or response headers from your terminal, browser DevTools, or server logs. The first line (GET/POST/HTTP) is treated as the request line. Each `Key: Value` line is parsed into a structured JSON object with the header name as the key and the value as the string.
Inspect the output
The output shows the request line (if detected), each header as a key-value pair, and a total header count. Copy the JSON for documentation, debugging, or integration into monitoring dashboards and alerting systems.
Copy or download the JSON
Copy the parsed JSON to your clipboard or download it as a file. The output is formatted with 2-space indentation for readability — ready to paste into a code review comment, a diagnostic ticket, or an API documentation page.
Frequently asked
What format should the headers be in?
Standard HTTP/1.x header format — one header per line, each line as `Name: Value`. The first line can be a request line (e.g. `GET /api/users HTTP/1.1`) or a response status line (e.g. `HTTP/1.1 200 OK`). Empty lines are ignored. The parser does not require a request line — a block of bare headers is also accepted.
Does it validate the headers?
The tool parses syntax only — it does not check if header names are valid HTTP header names per RFC 9110, or if values conform to RFC specifications for their field type. It extracts whatever is present in the input. For semantic validation, use a dedicated HTTP library or proxy tool.
Can it parse multi-line header values?
No. Multi-line (folded) header values using the obsolete line-folding syntax (continuation lines starting with whitespace) are deprecated in HTTP/1.1 per RFC 7230 and removed in HTTP/2 and HTTP/3. The parser treats each line independently.
Does it parse Set-Cookie headers correctly?
Set-Cookie headers can contain semicolons and commas, which are structural in HTTP but ambiguous to a line-based parser. The parser captures the full value string — it does not split individual cookie attributes. Use the Query String Parser on the cookie value if you need to decompose individual directives.
How does this compare to HAR to cURL?
HAR to cURL converts a full HAR archive (request/response pairs with timings) to executable code. The HTTP Headers Parser takes just the raw header text and turns it into structured JSON. They serve adjacent purposes: HAR for replay and code generation, raw header parsing for inspection and documentation.
Limitations
- No HTTP semantic validationThe tool does not validate whether headers are semantically correct for HTTP (e.g. required headers for CORS, missing Host header in HTTP/1.1, invalid combinations). Use a full HTTP library or a proxy like Charles or mitmproxy for semantic checks.
- No cookie decompositionSet-Cookie and Cookie headers are returned as single strings. If you need to split individual cookie attributes or values, process the string through a cookie parser or the Query String Parser tool.
- No HTTP/2 or HTTP/3 frame parsingHTTP/2 uses binary frames with HPACK-compressed headers. HTTP/3 uses QPACK. This tool works only with the text representation of HTTP/1.x headers as they appear in terminal output and DevTools.
Platform notes
- macOS
- Use `curl -v https://api.example.com 2>&1 | grep '^[<>]'` to extract the request and response headers, then paste them here. The `-v` flag prints the full header exchange to stderr.
- Windows
- PowerShell's `Invoke-WebRequest` and `Invoke-RestMethod` expose the response headers in `$response.Headers`. Browser DevTools (F12 → Network → Headers tab) is the easiest source. Copy the raw headers and paste them into the parser.
- Linux
- `curl -v`, `wget --debug`, or `tcpdump -A` for raw headers. For live traffic, `ngrep -W byline port 80` captures HTTP headers on the wire. The browser tool post-processes whatever text you give it.
- Web
- Runs entirely in the browser. No header data is sent to a server. Useful for parsing headers from internal API responses, third-party webhook payloads, and authentication tokens without exposing them to an online service.