Content-Language: the audience a document is for
Content-Language names the languages the representation is intended for. It describes the audience rather than the language every word on the page is written in.
At a glance
- Direction
- Response mostly, and allowed on a request that carries a body.
- Defined in
- RFC 9110, with language tags from RFC 5646
- When absent
- The language is unstated, and clients fall back to markup such as the lang attribute.
- Value
- One or more language tags, comma separated: en-GB, or en, fr for a bilingual document
- Not the same as
- The lang attribute, which marks the language of specific markup
- Pairs with
- Accept-Language on the request, and Vary: Accept-Language on the response
- Applies to
- Any representation, including a PDF or an image with text in it
In detail
The distinction from the lang attribute is real, not pedantic. The attribute tells a screen reader or a spell checker which language a particular run of text is in. This header tells a recipient who the document is meant for, which is why a Maori language primer written for English speakers can legitimately declare en even though most of the words on the page are not English.
Multiple tags mean a document addressed to several audiences at once, such as a bilingual notice, rather than a set of alternatives to choose from. If you have separate translations at separate URLs, each one declares its own single tag, and the relationships between them are expressed with link relations rather than by listing every language here.
It is the response side counterpart of Accept-Language. A negotiated page should state which language it settled on, so a cache and the client can both see that this body is the French variant rather than assuming it matched the request. Without it, a debugging session over a wrong language page has nothing to inspect.
It applies to any representation, not only HTML. A PDF, a plain text file or a generated image with a caption can all declare a language, and for anything that has no internal way to say so, the header is the only signal a client gets.
Examples
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Content-Language: fr-CA
Vary: Accept-LanguageContent-Language: en, frThis is a bilingual document, not an offer of two alternatives.
Things that catch people out
- Listing several tags does not mean the client may pick one. It means the document is intended for all of those audiences at once.
- Setting it on a response while every translation lives at the same URL, with no Vary: Accept-Language, lets a cache serve the wrong language to the next visitor.
- It is not a search engine signal for regional targeting on its own. That relationship is expressed with alternate link relations between the translated URLs.
Try it: HTTP Headers Checker
Check a live URL or paste headers you already have. It grades six security headers from A+ to F and lists every other header the response returned.
HTTP Headers Checker
LOCAL · Browser-OnlyView HTTP response headers for any URL
Enter any website URL to fetch and analyze its HTTP response headers. We'll automatically add https:// if needed.
Why Check Security Headers?
Security headers protect your website against common attacks like XSS, clickjacking, and MIME sniffing. They're set by your web server and cost nothing to implement. Missing security headers are one of the most common findings in security audits.
Related HTTP headers
All http headers →Accept-Language: language negotiation and its limits
How Accept-Language ranks languages, why matching should fall back from a region to a base tag, and why it is a poor way to pick a currency or a country.
Content-Type: media type, charset and boundary
How Content-Type is structured, why the charset parameter still matters, what boundary does on a multipart upload, and how a wrong type breaks a page.
Vary: which request headers change the response
How Vary extends a cache key, why Vary: User-Agent destroys hit rates, what Vary: * means, and the CORS case where forgetting Vary: Origin causes real bugs.
Link: relationships expressed in a header
How the Link header carries relationships that markup cannot, its use for preload with early hints, and the pagination pattern that APIs build on it.
Content-Disposition: download prompts and file names
How to force a download instead of inline display, how filename and filename* differ, and how to send a non-ASCII file name that survives every browser.
Content-Range: which bytes this partial response holds
How Content-Range describes a byte range, what the total size field means, the unsatisfied form sent with 416, and how multipart ranges are framed.
Tools for this
- HTTP Request Builder Free online HTTP request builder - build and test HTTP requests with custom headers and body
- Meta Tag Generator Free online meta tag generator - generate SEO meta tags, Open Graph, and Twitter Card markup for your website