HTTP Headers Formatter
Format HTTP headers
What Is This Tool?
The HTTP Headers Formatter takes raw headers — pasted straight from a browser's network tab, an API doc, or a curl -v dump — and parses each "Header-Name: value" line into a neatly aligned list, plus an equivalent JSON object. It's useful when you need to quickly review, tidy up, or convert a block of headers. Everything runs locally in your browser.
How to Use
Paste raw headers, one "Header-Name: value" pair per line.
Click Format.
Review the aligned list and the equivalent JSON object.
Copy whichever view you need.
Features
- Splits on the first colon only, so values containing colons (like URLs) parse correctly
- Aligns header names for easy visual scanning
- Generates a pretty-printed JSON object view
- Duplicate header names are collected into a JSON array
- Clear errors for lines missing a colon or header name
- 100% client-side — nothing is uploaded anywhere
Examples
Input:
Host: api.example.com Content-Type: application/json Location: https://example.com/redirect?next=1
JSON output:
{
"Host": "api.example.com",
"Content-Type": "application/json",
"Location": "https://example.com/redirect?next=1"
}
Common Use Cases
- Cleaning up headers copied from a browser's network inspector
- Converting header lists into a JSON object for use in code
- Reviewing headers documented in an API reference
- Spotting duplicate or malformed header lines
Frequently Asked Questions
How are header values with colons in them handled?
Each line is split on the first colon only, so a value like a URL (e.g. Location: https://example.com) parses correctly even though it contains additional colons.
What happens with duplicate header names?
In the JSON view, repeated header names are collected into an array of values under that key, since a single JSON object can't have duplicate keys. The aligned list view keeps every line separately.
Why do I get a "missing a colon separator" error?
Every non-blank line must be in "Header-Name: value" form. A line without any colon (like stray text or an HTTP status line) can't be parsed as a header and triggers this error.
Are header names or values validated against HTTP rules?
No. This tool only parses the text structure (name, colon, value); it doesn't check whether a header name or value is valid per the HTTP specification.
Is my header data uploaded anywhere?
No. Parsing and formatting happen entirely in your browser using JavaScript. Nothing is sent to a server.
Can I paste headers copied straight from browser dev tools?
Yes, as long as each header is on its own "Name: value" line. Extra blank lines are ignored automatically.