Skip to content

SEOPart of: International SEO

hreflang language and region codes: the reference table

hreflang language codes are ISO 639-1 two-letter codes, optionally followed by an ISO 3166-1 country code or an ISO 15924 script. A reference of valid codes for Spanish, English and other common languages, the look-alikes Google ignores, and how to choose.

getReport teamUpdated 26 Sept 202611 min read

hreflang language codes follow one pattern: a two-letter ISO 639-1 language code, optionally followed by a hyphen and a two-letter ISO 3166-1 alpha-2 country code (es, es-MX, en-GB), or, for languages written in more than one script, an ISO 15924 script code (zh-Hant). The value x-default is the only exception. Anything else, including popular codes such as es-419 and en-UK, is not supported by Google, and a set with invalid codes can be ignored. This page is the lookup table: valid codes for Spanish, English and other common languages, the look-alikes that fail, and how to decide between language-only and language-country codes. It belongs to our guide to international SEO: site structure, hreflang and language targeting.

Quick answer

  • Format: language, language-COUNTRY or language-Script, joined with a hyphen, never an underscore.
  • Language: ISO 639-1, two letters: en, es, de, ja, zh.
  • Country: ISO 3166-1 alpha-2, two letters: GB (not UK), MX, AT.
  • Script: ISO 15924, four letters: Hans, Hant, Latn, Cyrl.
  • Never a country alone. hreflang="de" means German; there is no way to say "Germany" without a language.
  • Unsupported: es-419 (Latin America), en-UK, en-EU, jp, cn, en_GB.
  • Build sets with the free hreflang generator, which names each code as you type and flags common mistakes.

The format Google supports

Google's localized versions documentation defines the value of the hreflang attribute:

PartStandardLettersExamplesRequired?
LanguageISO 639-12en, es, pt, zhYes
ScriptISO 159244Hans, Hant, Latn, CyrlOptional
RegionISO 3166-1 alpha-22US, GB, MX, BROptional
Fallback––x-defaultOptional, once per set

Order matters: language first, then script, then region (zh-Hant-TW). Case does not: en-gb and en-GB are read the same way, but the convention is lowercase language, capitalised script and uppercase region, and a consistent style makes mistakes easier to spot.

The complete hreflang reference covers where the tags go and how to implement a set; this page is only about the codes.

Language-only or language-country?

Use a language-only code when one version serves every speaker of that language, wherever they are: de for a German translation, fr for French. That is the right default for most sites, because it matches every searcher who reads the language.

Use a language-country code only where something real differs by country: price and currency, stock and delivery, legal terms, or spelling and vocabulary your visitors notice. de-DE, de-AT and de-CH make sense for a shop with three price lists; they add nothing for a blog.

You can mix them. A common pattern is a general version plus local ones:

HTML
<link rel="alternate" hreflang="es" href="https://example.com/es/">
<link rel="alternate" hreflang="es-ES" href="https://example.com/es-es/">
<link rel="alternate" hreflang="es-MX" href="https://example.com/es-mx/">
<link rel="alternate" hreflang="x-default" href="https://example.com/">

Here Spanish speakers in Spain and Mexico get their local pages, and Spanish speakers anywhere else (Argentina, Colombia, the US) get the general es page. Google matches the most specific code first and falls back to the language-only code, so a language-only entry is a useful catch-all whenever you also have country versions.

Spanish hreflang codes

Spanish is where most code mistakes happen, because "Latin America" is a common target and has no ISO country code.

You want to targetUseNot
Spanish speakers everywherees–
Spaines-ESes-SP, sp
Mexicoes-MXmx
United States (Spanish speakers)es-USes-USA
Argentinaes-ARar (that is Arabic)
Colombiaes-COco (that is Corsican)
Chilees-CLcl
Perues-PEpe
Latin America as a wholees, or one code per countryes-419, es-LA, es-LATAM

Why es-419 fails. 419 is a UN M.49 area code for Latin America and the Caribbean. It is valid in the general BCP 47 language-tag standard, and browsers understand it, but Google's hreflang support is limited to ISO 3166-1 alpha-2 regions, so it does not support es-419.

Why es-LA is worse. LA is a valid ISO country code, for Laos. es-LA does not fail quietly; it targets Spanish speakers in Laos.

For one Latin American Spanish version, use es for it (and es-ES for a separate Spain version if you have one), or list the same URL under each country code you care about: es-MX, es-AR, es-CO, es-CL and so on. Listing one URL under several codes is allowed.

English hreflang codes

You want to targetUseNot
English speakers everywhereen–
United Kingdomen-GBen-UK, uk (that is Ukrainian)
United Statesen-USen-USA
Irelanden-IEen-IR (IR is Iran)
Canadaen-CAca (that is Catalan)
Australiaen-AU–
New Zealanden-NZ–
Indiaen-IN–
South Africaen-ZAen-SA (SA is Saudi Arabia)
Europe as a wholeen, or one code per countryen-EU

UK and EU are "exceptionally reserved" codes in ISO 3166-1, not assigned country codes, and Google does not support them. en-GB covers England, Scotland, Wales and Northern Ireland.

A frequent set is en-US, en-GB and en as the catch-all for every other English speaker, often with x-default pointing at the same page as en. Same-language regional pages tend to be near duplicates; hreflang and canonical tags explains how to keep them from being folded together.

Other common languages and their pitfalls

LanguageCodeFrequent mistakeWhy it is wrong
JapanesejajpJP is the country; the language is ja
Chinesezh, zh-Hans, zh-Hantcn, zh-CHSCN is the country; zh-CHS is an old Microsoft code
KoreankokrKR is the country; kr is Kanuri
GreekelgrGR is the country
DanishdadkDK is the country
SwedishsvseSE is the country; se is Northern Sami
CzechcsczCZ is the country
UkrainianukuaUA is the country
EstonianeteeEE is the country; ee is Ewe
SlovenianslsiSI is the country; si is Sinhala
HebrewheilIL is the country
Norwegianno, nb or nn–nb (Bokmål) and nn (Nynorsk) are more specific
Portuguese (Brazil)pt-BRbr, pt-BZbr is Breton; BZ is Belize
Portuguese (Portugal)pt-PTpt-POPO is not a country code
Serbian (Latin script)sr-Latnsr-LTLT is Lithuania
German (Switzerland)de-CHde-SZSZ is Eswatini

The pattern behind most of these: a country code used where the language code belongs. Country and language codes often match (de/DE, fr/FR, it/IT), which makes it easy to assume they always do.

Chinese: script or region?

Chinese can be targeted by writing system or by place:

  • zh-Hans: Simplified Chinese, for readers anywhere who use it.
  • zh-Hant: Traditional Chinese, for readers anywhere who use it.
  • zh-CN, zh-TW, zh-HK, zh-SG: Chinese for one country or territory.
  • zh-Hant-HK: Traditional Chinese in Hong Kong, when you need both.

If your Chinese versions differ by script and not by market, the script codes are the more accurate choice.

Codes that are always invalid

CodeProblemUse instead
en_GBUnderscoreen-GB
de meant as "Germany"A country without a language is impossiblede-DE (German in Germany)
GB, US, MX on their ownCountry onlyen-GB, en-US, es-MX
eng, spa, deuThree-letter ISO 639-2/3 codesen, es, de
en-GBR, es-USAThree-letter country codesen-GB, es-US
es-419UN M.49 area codees or per-country codes
x-default twiceOnly one fallback per setOne x-default

How to check your codes

The hreflang generator validates each code before you copy anything:

It checks that the language is a two-letter ISO 639-1 code, the region a two-letter ISO 3166-1 country code and an optional script four letters, and names the result ("German (Austria)", "Chinese (Hant)"). It flags underscores, three-letter languages, country codes in the language position and look-alikes such as en-UK, es-419 and es-LA, with the likely intended code where there is one.

To check a live page, run the hreflang checker:

It reads every hreflang tag on the page, checks that each code has the right shape (language first, hyphen-separated, no underscores), that the set has at most one x-default, no repeated codes and a self-reference, and then fetches the alternates to confirm the return links. The shape check does not look codes up in the ISO lists, so a well-formed but wrong code such as en-UK passes it; paste your codes into the generator to catch those.

The lang attribute on each page's <html> element should match its hreflang code. Google does not use it for targeting, but screen readers and browsers do, and a mismatch is a quick sign that a template is wrong.

Questions people ask

What is the hreflang code for Latin American Spanish?

There is no supported single code. es-419 uses a UN M.49 area code that Google's hreflang does not support, and es-LA targets Laos. Use es for a Latin American Spanish version that serves all Spanish speakers, and es-ES for a separate Spain version if you have one. Or list the same URL under each country code you target, such as es-MX, es-AR and es-CO.

Should I use en or en-US in hreflang?

Use en unless you have separate English versions for different countries. en matches every English speaker, wherever they are. If you have a US and a UK version, use en-US and en-GB, and add en pointing at one of them, or at an international version, to catch English speakers in all other countries. Many sites point x-default at the same page as en.

Can I use a country code alone in hreflang?

No. The first part of every hreflang value must be a language, and Google does not derive a language from a country. hreflang="mx" is not "Mexico"; mx is not a valid language code, so the entry is ignored. Write the language that page is in, followed by the country: es-MX for Spanish in Mexico, en-CA or fr-CA for Canada.

Is hreflang en-UK valid?

No. The ISO 3166-1 code for the United Kingdom is GB, so the correct value is en-GB. UK is only an exceptionally reserved code in the standard, and Google does not support it in hreflang. Because the tag looks right and nothing on the page breaks, en-UK often survives for years; search your templates and sitemaps for it and replace every occurrence.

Check your site before and after Check