---
title: "Are HTTP Headers Case Sensitive? Explained With Examples"
description: "Are HTTP headers case-sensitive? Learn how header names and values differ, why HTTP/2 and HTTP/3 require lowercase names, and how to avoid issues."
url: "https://marsproxies.com/blog/are-http-headers-case-sensitive/"
---

[Skip to content](https://marsproxies.com/blog/are-http-headers-case-sensitive/#page-content)

[Black Friday Offer ends November 29, 2026 at 11:59 PM UTC Buy more, get more free. Up to +25% GB on top. Get the deal ](https://marsproxies.com/black-friday/)[Cyber Monday Offer ends December 6, 2026 at 11:59 PM UTC Buy more, get more free. Up to +25% GB on top. Get the deal](https://marsproxies.com/cyber-monday/)

- [English](https://marsproxies.com/blog/are-http-headers-case-sensitive/)
- [Chinese](https://marsproxies.cn/blog/are-http-headers-case-sensitive/)

[Contact sales](https://marsproxies.com/contact-sales/) [Log in](https://dashboard.marsproxies.com/login/)

[Sign up](https://dashboard.marsproxies.com/register/)

[Contact sales](https://marsproxies.com/contact-sales/) [Log in](https://dashboard.marsproxies.com/login/)

- [English](https://marsproxies.com/blog/are-http-headers-case-sensitive/)
- [Chinese](https://marsproxies.cn/blog/are-http-headers-case-sensitive/)

[Back to blog](https://marsproxies.com/blog/) December 1, 2026

# Are HTTP Headers Case Sensitive? Explained With Examples

[Insights](https://marsproxies.com/blog/category/insights/)

Table of contents

1. [Are HTTP header names case sensitive?](https://marsproxies.com/blog/are-http-headers-case-sensitive/#b-are-http-header-names-case-sensitive)
2. [Are HTTP header values case sensitive?](https://marsproxies.com/blog/are-http-headers-case-sensitive/#b-are-http-header-values-case-sensitive)
3. [HTTP header case sensitivity in HTTP/1.1, HTTP/2, and HTTP/3](https://marsproxies.com/blog/are-http-headers-case-sensitive/#b-http-header-case-sensitivity-in-http11-http2-and-http3)
4. [Common issues with HTTP header capitalization](https://marsproxies.com/blog/are-http-headers-case-sensitive/#b-common-issues-with-http-header-capitalization)
5. [Does header capitalization matter when using proxies?](https://marsproxies.com/blog/are-http-headers-case-sensitive/#b-does-header-capitalization-matter-when-using-proxies)
6. [Conclusion](https://marsproxies.com/blog/are-http-headers-case-sensitive/#b-conclusion)
7. [FAQ](https://marsproxies.com/blog/are-http-headers-case-sensitive/#b-faq)

**Key takeaways:**

- Header names are case-insensitive, but the rules for header values depend on the specific field.

* HTTP/2 and HTTP/3 require lowercase header names, which makes header compression more efficient.

- Reading headers with exact string matches often causes bugs if developers forget to normalize the text first.

Whether [HTTP headers](https://marsproxies.com/blog/http-headers/) are case-sensitive depends on the part of the header you examine. Web standards state that header names are always case-insensitive. In HTTP/1.1, a server will process a request just fine even with mixed capitalization.

The field value after the colon is often case-sensitive, but it depends on how that header is defined. HTTP/1.1 allows mixed-case names, but HTTP/2 and HTTP/3 require lowercase names, which also makes their header compression more efficient.

## Are HTTP header names case sensitive?

The current standard in RFC 9110 states that clients and servers must treat header names, such as Content-Length, as case-insensitive. If you configure an application to send Content-Type, content-type, or CONTENT-TYPE, the receiving server will process all three as the same field.

It also applies to [custom HTTP headers](https://marsproxies.com/blog/curl-send-http-headers/), so any unique fields you create for internal APIs are normalized just like standard headers. Most HTTP libraries and frameworks handle incoming request headers for you, either by storing the names in one consistent case or by matching them case-insensitively.

## Are HTTP header values case sensitive?

Once you look past the colon at the field value, case sensitivity depends on the standard for that specific header. A web server might ignore capitalization for a Cache-Control directive, but it will reject an authentication token if a single letter has the wrong case.

If you send an improperly capitalized string inside a case-sensitive field, the receiving system won’t match it. A changed token fails authentication, an altered cookie value loses the session, and a changed ETag makes the server resend the full response instead of a 304 Not Modified.

| Header | Case sensitivity | Explanation |
| --- | --- | --- |
| Content-Type | Case-insensitive | Systems treat text/html and TEXT/HTML as the same media type, but some parameter values, like a multipart boundary, are case-sensitive |
| Cache-Control | Case-insensitive | Directives like no-cache match regardless of capitalization |
| Authorization | Case-sensitive | Tokens rely on exact character matches to prove identity, though the scheme name, like Bearer, ignores case |
| Cookie | Case-sensitive | Session identifiers fail if you alter their original capitalization |
| ETag | Case-sensitive | Cache validation tokens require strict exact string comparisons |

## HTTP header case sensitivity in HTTP/1.1, HTTP/2, and HTTP/3

While HTTP/1.1 transmits header names exactly as typed, newer versions, namely HTTP/2 and HTTP/3, require lowercase names. Their standards, RFC 9113 and RFC 9114, treat a message with an uppercase header name as malformed.

The lowercase rule exists for efficiency and interoperability. With one fixed case, the header compression formats HPACK (HTTP/2) and QPACK (HTTP/3) can reuse the entries in their built-in tables, which list common names such as *content-type* in lowercase.

| Protocol version | Header name formatting |
| --- | --- |
| HTTP/1.1 | Transmits text exactly as formatted by the client |
| HTTP/2 | Requires lowercase names, so clients convert them before transmission |
| HTTP/3 | Requires lowercase names, so clients convert them before transmission |

## Common issues with HTTP header capitalization

The most common bug is comparing header names as case-sensitive strings. In Node.js, for example, incoming header names are stored in lowercase, so *req.headers\['Content-Type']* returns *undefined*, while *req.headers\['content-type']* returns the value. Code that matches raw header lines against Content-Type fails the same way when a response arrives over HTTP/2.

A second problem appears when code or a proxy rule normalizes more than the header name. Lowercasing a whole header line also changes its value, so a Bearer token or API key no longer matches, and the request fails authentication, usually with a 401 Unauthorized response. Normalize names only and pass values through unchanged.

Duplicate headers cause the third type of issue. Accept and accept are the same field, so a recipient may merge both lines into one comma-separated value, as RFC 9110 allows. Code that stores headers in a plain dictionary keyed by the exact name keeps them as two separate fields instead. Set-Cookie is the exception, since its lines can’t be combined.

HTTP libraries prevent most of these problems for you. Python’s requests library, for example, stores response headers in a case-insensitive dictionary, so both lookups below return the same value:

```python
import requests
 
response = requests.get( 'https://marsproxies.com' )
print (response.headers[ 'Content-Type' ] )
print (response.headers[ 'content-type' ] )
```

Both lines print the same value (for example, *text/html; charset=utf-8*), because the lookup ignores the case of the key.

Other HTTP libraries solve the same problem in their own way. Go’s net/http stores names in a canonical form such as Content-Type, and the Fetch API’s Headers object matches names case-insensitively. Use these built-in lookups instead of comparing header names yourself.

## Does header capitalization matter when using proxies?

When traffic passes through a proxy, the intermediary server often inspects and modifies the data before forwarding it. Many proxies normalize this traffic by rewriting header names into strict lowercase or standard title case. HAProxy, for example, sends all header names in lowercase, regardless of the HTTP version.

HTTPS works differently. When you request an HTTPS page through a forward proxy, your client opens a tunnel with the CONNECT method, so the proxy only relays encrypted data and can’t read, add, or change the headers inside it.

Keep in mind, however, that reverse proxies or CDNs that terminate your TLS connection can still normalize your headers before sending them to the backend server.

If you build web scrapers or troubleshoot networks, remember this behavior: on plain HTTP or behind a TLS-terminating proxy, the casing you see may differ from the casing that was sent, so compare both request and response headers case-insensitively.

Build web scrapers that handle HTTP headers right

[Start scraping](https://dashboard.marsproxies.com/products/datacenter-proxies#buy-now)

## Conclusion

To build reliable web applications, remember that header names are case-insensitive, while the case sensitivity of header values depends on the specific field: Cache-Control directives ignore case, but tokens, cookies, and ETags don’t.

Although newer protocols like HTTP/2 and HTTP/3 require lowercase header names, modern client libraries handle this conversion automatically.

As long as your code compares header names case-insensitively and passes values through unchanged, your software will interact smoothly with modern web infrastructure.

## FAQ

Is the Content-Type header case-sensitive?

No. Both the header name and the media type field value (like *text/html*) are case-insensitive.

Is the Authorization header case-sensitive?

The header name and the authorization scheme are case-insensitive, but the credentials that follow it, such as a Bearer token, are strictly case-sensitive.

Why are HTTP header names sometimes converted to lowercase?

HTTP/2 and HTTP/3 require lowercase header names, so clients convert them before sending. Some libraries, such as Node.js, also lowercase every incoming header name, even over HTTP/1.1.

Are custom HTTP headers case-sensitive?

No. Custom header names are case-insensitive and follow the exact same normalization rules as standard headers. Whether their values are case-sensitive is up to the application that defines them.

Are HTTP methods case-sensitive?

Yes. Unlike header names, HTTP methods like GET and POST are strictly case-sensitive. By convention, standardized methods are written in uppercase.

[Learn more](https://dashboard.marsproxies.com/register/)

Author

[Lukas Tilkevicius Growth & Partnerships Manager](https://marsproxies.com/blog/authors/lukas-tilkevicius/)

Table of contents

1. [Are HTTP header names case sensitive?](https://marsproxies.com/blog/are-http-headers-case-sensitive/#b-are-http-header-names-case-sensitive)
2. [Are HTTP header values case sensitive?](https://marsproxies.com/blog/are-http-headers-case-sensitive/#b-are-http-header-values-case-sensitive)
3. [HTTP header case sensitivity in HTTP/1.1, HTTP/2, and HTTP/3](https://marsproxies.com/blog/are-http-headers-case-sensitive/#b-http-header-case-sensitivity-in-http11-http2-and-http3)
4. [Common issues with HTTP header capitalization](https://marsproxies.com/blog/are-http-headers-case-sensitive/#b-common-issues-with-http-header-capitalization)
5. [Does header capitalization matter when using proxies?](https://marsproxies.com/blog/are-http-headers-case-sensitive/#b-does-header-capitalization-matter-when-using-proxies)
6. [Conclusion](https://marsproxies.com/blog/are-http-headers-case-sensitive/#b-conclusion)
7. [FAQ](https://marsproxies.com/blog/are-http-headers-case-sensitive/#b-faq)

Categories

- [Antidetect solutions](https://marsproxies.com/blog/category/antidetect-solution/)

  [3](https://marsproxies.com/blog/category/antidetect-solution/)
- [Comparisons](https://marsproxies.com/blog/category/comparisons/)

  [11](https://marsproxies.com/blog/category/comparisons/)
- [How to](https://marsproxies.com/blog/category/how-to/)

  [133](https://marsproxies.com/blog/category/how-to/)
- [Insights](https://marsproxies.com/blog/category/insights/)

  [96](https://marsproxies.com/blog/category/insights/)
- [Product news](https://marsproxies.com/blog/category/product-news/)

  [5](https://marsproxies.com/blog/category/product-news/)
- [Sneaker Bots](https://marsproxies.com/blog/category/sneaker-bots/)

  [2](https://marsproxies.com/blog/category/sneaker-bots/)

## Related articles

[Insights](https://marsproxies.com/blog/category/insights/)

### [Proxy Chaining: How It Works, Setup & Use Cases](https://marsproxies.com/blog/proxy-chaining/)

Learn what proxy chaining is, how multi-hop proxies work, and how to configure them. Explore benefits, limitations, tools, and use cases.

[Dalius Pamedytis Software Engineer](https://marsproxies.com/blog/authors/dalius-pamedytis/)

November 30, 2026

[Insights](https://marsproxies.com/blog/category/insights/)

### [505 Error: What It Means, Causes, and How to Fix It](https://marsproxies.com/blog/505-error/)

Getting a 505 error? Learn what HTTP Version Not Supported means, what causes it, and how to fix it in browsers, APIs, servers, and proxy setups.

[Lukas Tilkevicius Growth & Partnerships Manager](https://marsproxies.com/blog/authors/lukas-tilkevicius/)

November 27, 2026

[Insights](https://marsproxies.com/blog/category/insights/)

### [Error 1005 (Cloudflare): Causes and How to Fix It](https://marsproxies.com/blog/error-1005/)

Seeing Error 1005 Access Denied? Learn what causes Cloudflare ASN bans and how to fix the issue as a website visitor or website owner.

[Lukas Tilkevicius Growth & Partnerships Manager](https://marsproxies.com/blog/authors/lukas-tilkevicius/)

November 20, 2026
