Bounties /Pin to ProfileBookmark

What is the difference between “en-US” and “en” in the HTML tag?

Trying to optimize a website for international audiences and want to make sure we’re using the correct language codes in the HTML tag.

to post a answer
December 13th, 2022HTML

1 Answer(s)

@JaySODec 13, 2022 — The "en-US" and "en" values in the HTML tag are used to indicate the language of the content on a web page. The "en" value is a general indication that the content is in English, while "en-US" specifies that the content is in American English. This can be useful for browsers and other software that can use this information to display the content in the appropriate language for the user. For example, a browser might use this information to automatically translate the page into the user's preferred language, or to correctly pronounce text on the page using text-to-speech.


Help @hq spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with Github
about: ({
version: 0.1.7 BETA 2.4,
whats_new: article editor v2,
up_next: tip code demos,
coming_soon: embeddable tipping,
social: @webDeveloperHQ

legal: ({
terms: of use,
privacy: policy
changelog: (
version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh

version: 0.1.5,
notes: added pins + new badge

version: 0.1.4,
notes: home refresh + tools
recent_tips: (
tipper: @JohnDavis,
amount: 250 SATS,
source: article

tipper: @Megan0910,
amount: 1000 SATS,
source: article

tipper: @JohnDavis,
amount: 250 SATS,
source: article