Accept-Language
The HTTP Accept-Language request header indicates the natural languages and regional variants the client prefers.
Usage
The Accept-Language header is part of content negotiation. A client sends a ranked list of language tags, and the server selects the best available translation for the requested resource.
Browsers populate this header from the operating system
language settings. The value follows BCP 47 language tag
syntax, supporting primary language codes (en, de,
fr) and regional subtags (en-US, pt-BR, zh-CN).
Quality values rank the preferences when multiple
languages are listed.
The server communicates the language of the returned content through the Content-Language response header. When no matching translation exists, most servers return the default language rather than responding with 406 Not Acceptable, since serving content in a fallback language is typically more useful than returning an error.
Directives
language-tag
A BCP 47 language tag. A primary subtag like en
matches any regional variant. A tag with a region
subtag like en-GB targets a specific locale.
\*
A wildcard matching any language not already listed.
;q= (quality value)
A weight between 0 and 1 expressing relative
preference. The default is 1.0. A value of 0
marks a language as not acceptable.
Example
A client preferring British English, with generic English as a fallback and German at reduced priority. The server responds with content in generic English.
Request
GET / HTTP/1.1
Host: www.example.re
Accept-Language: en-GB, en;q=0.9, de;q=0.5
Response
HTTP/1.1 200 OK
Content-Language: en
A request from a browser configured for French with a fallback to any language.
Accept-Language: fr-FR, fr;q=0.9, *;q=0.5
A multilingual preference list ordering Spanish first, Portuguese second, and English third.
Accept-Language: es, pt;q=0.8, en;q=0.6
Takeaway
The Accept-Language request header communicates language preferences during content negotiation, enabling servers to return content in the most appropriate language for the client.