Home/SEO Guide/Reference/Language and region codes
Reference · 8 sources · last reviewed 26 Oct 2026

Valid language and region codes

Three ISO standards answer three different questions. The same codes drive both the lang attribute on every page you publish and the hreflang annotations on a translated one, and using the wrong code is the most common reason either is silently ignored [5]. This page covers which standard applies where, what a valid value looks like, the lookalikes that fail without warning, and the full list of all 184 language and 259 region codes.

CHECK YOUR OWNThe hreflang checker validates the codes on a live URL, along with return tags and canonical conflicts.Open the hreflang checker →

Three standards, three questions

A language code and a country code are different things from different lists. An hreflang value is built from both, language first [5].

ISO 639-1

two letters

names languages

en, de, zh

The one hreflang expects. About 180 languages, which covers every language a commercial site is likely to publish in.

ISO 639-2 / 639-3

three letters

names languages

eng, deu, cmn

Far wider coverage, including languages with no two-letter code. Valid in HTML lang, but use the two-letter form where one exists.

ISO 3166-1 alpha-2

two letters

names countries and regions

GB, US, BR

The region half of an hreflang value. Always a country or territory, never a language and never a continent.

Full lists live with the registries that maintain them [1][2] rather than in a copy here, because they are revised and a stale mirror is worse than no mirror.

What a valid value looks like

The language is required and the region is optional. A region on its own is never valid, and the two halves come from different standards [3].

hreflang="en" → language only, valid
hreflang="en-gb" → language + region, valid
hreflang="gb" → region only, INVALID
hreflang="x-default" → the fallback, valid
CASE AND SEPARATOR

Codes are case-insensitive, so en-GB and en-gb are the same value. A hyphen separates the halves; an underscore (en_GB) is a programming locale convention and is not valid here [3].

Codes that look right and are not

Every one of these parses as a string and fails as an annotation. The first is the expensive one: it sends British visitors a Ukrainian page.

The same codes in lang

Hreflang is the reason most people look these codes up, but the lang attribute uses the same two lists and applies to every page, multilingual or not. It is what tells a screen reader how to pronounce the text and a browser whether to offer a translation [6].

On every page

<html lang="en">

Declares the language of the document. Required for WCAG 2.2 success criterion 3.1.1, and the single most common accessibility failure in an otherwise careful build [7].

On a passage that switches

<p lang="fr">…</p>

Any run of text in another language gets its own annotation, which is criterion 3.1.2. Without it a screen reader pronounces French with English phonetics [6].

Not the same as a link hreflang

<a hreflang="de">

On a link, hreflang describes what is at the other end. lang describes the element it sits on. Different questions [8].

Where the two differ

THE COMMON MISTAKE

A template that ships <html lang="en"> on every page of a translated site. The German page then declares itself English, so it is read aloud in English phonetics and offered for translation into the language it is already in. The hreflang annotations can be perfect and this will still be wrong, because they answer different questions [7].

Every ISO 639-1 language code

All 184 two-letter codes currently in the registry. These are the values the language half of an hreflang may take; anything not on this list is either a three-letter 639-2 code, a region code, or not a language at all.

184

Every ISO 3166-1 alpha-2 region code

All 259 codes, countries and territories alike. One of these may follow a language code, never precede it and never stand alone. The reserved private-use ranges are excluded because they name no place.

259

Both lists generated from the IANA Language Subtag Registry [2], file dated 17 September 2026. The registry is revised as languages and territories change, so check the source before relying on an unusual code.

References

  1. [1]ISO 639-2 Registration Authority — code list · Library of Congressloc.gov/standards/iso639-2/php/code_list.php
  2. [2]Language Subtag Registry · IANAiana.org/assignments/language-subtag-registry
  3. [3]RFC 5646: Tags for Identifying Languages · IETFrfc-editor.org/rfc/rfc5646
  4. [4]Standard country or area codes (M49) · UN Statistics Divisionunstats.un.org/unsd/methodology/m49
  5. [5]Localized versions of your pages · Google Search Centraldevelopers.google.com/search/docs/specialty/international/localized-versions
  6. [6]Declaring language in HTML · W3C Internationalizationw3.org/International/questions/qa-html-language-declarations
  7. [7]Understanding SC 3.1.1: Language of Page · W3C WCAG 2.2w3.org/TR/WCAG22/#language-of-page
  8. [8]The lang and xml:lang attributes · HTML Living Standardhtml.spec.whatwg.org/multipage/dom.html