DevToolsmith

Accept-Language Header

The Accept-Language request header lists the user’s preferred languages, from the browser or OS settings.

Type
Request header
Category
Content and negotiation
Defined in
RFC 9110

Syntax

Accept-Language: <language>[;q=<weight>], …

How Accept-Language works

A starting point for choosing a language, not a rule: users on shared or work computers may get the wrong one, so always offer a visible language switch and remember the choice. If the response depends on it, send Vary: Accept-Language so caches don’t mix languages.

Examples

Swiss German, then German, then English
Accept-Language: de-CH, de;q=0.9, en;q=0.8

Check it

# Show the request headers curl sends (lines starting with >)
curl -sv -o /dev/null https://example.com 2>&1 | grep '^>'

Paste a full set of response headers into the HTTP header checker to get every header explained and common mistakes flagged.

Related headers

  • Accept: lists the response formats the client prefers, with optional weights.
  • Vary: lists the request headers that change the response, so caches keep a separate copy for each value.
  • Content-Type: states the media type (MIME type) of the body, and for text, its character encoding.

More content and negotiation headers

Content-Disposition , Content-Encoding , Accept-Encoding , Content-Length , Range , Transfer-Encoding .

Sources

Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.

Frequently asked questions

What does the Accept-Language header do?

The Accept-Language request header lists the user’s preferred languages, from the browser or OS settings. A starting point for choosing a language, not a rule: users on shared or work computers may get the wrong one, so always offer a visible language switch and remember the choice. If the response depends on it, send Vary: Accept-Language so caches don’t mix languages.

How do I see the Accept-Language header?

Open your browser’s dev tools, select a request in the Network tab and look under Request Headers. On the command line, "curl -v https://example.com" prints the request headers it sends, marked with ">".