HTML Language Codes Reference
The HTML lang attribute identifies the language of text content in HTML documents. Using proper language codes helps search engines understand your content, improves accessibility for screen readers, and enables browsers to apply correct typography and hyphenation rules. Language codes follow the ISO 639-1 standard, using two-letter codes to represent different languages.
Declaring the correct language is crucial for international websites and accessibility compliance. Screen readers use language information to apply appropriate pronunciation rules, while search engines use it to serve content to users in their preferred language. Always specify the lang attribute on the html element to declare the primary language of your page.
You can also use the lang attribute on individual elements to mark content in different languages within the same page. For example, if your English page includes a French quote, wrap it in a span or div with lang="fr". This helps assistive technologies switch to the appropriate language pronunciation and maintains proper document semantics.
Usage Example
The lang attribute is used to specify the language of the element's content. It helps search engines and browsers understand the language of your content.
<p lang="fr">Bonjour</p>
Major World Languages
Code | Language |
---|---|
en | English |
zh | Chinese |
es | Spanish |
hi | Hindi |
ar | Arabic |
bn | Bengali |
pt | Portuguese |
ru | Russian |
ja | Japanese |
de | German |
fr | French |
ko | Korean |
it | Italian |
tr | Turkish |
vi | Vietnamese |
European Languages
Code | Language |
---|---|
cs | Czech |
da | Danish |
nl | Dutch |
fi | Finnish |
el | Greek |
hu | Hungarian |
ga | Irish |
no | Norwegian |
pl | Polish |
ro | Romanian |
sv | Swedish |
uk | Ukrainian |
Asian Languages
Code | Language |
---|---|
th | Thai |
id | Indonesian |
ms | Malay |
tl | Tagalog |
ur | Urdu |
fa | Persian |
he | Hebrew |
ta | Tamil |
te | Telugu |
mr | Marathi |
Other Languages
Code | Language |
---|---|
af | Afrikaans |
sq | Albanian |
am | Amharic |
hy | Armenian |
eu | Basque |
be | Belarusian |
bs | Bosnian |
bg | Bulgarian |
ca | Catalan |
hr | Croatian |
eo | Esperanto |
et | Estonian |
is | Icelandic |
la | Latin |
lv | Latvian |
lt | Lithuanian |
mk | Macedonian |
mt | Maltese |
mn | Mongolian |
sr | Serbian |
sk | Slovak |
sl | Slovenian |
sw | Swahili |
cy | Welsh |
yi | Yiddish |