ISO 3166-1 Country Codes

All ISO 3166-1 alpha-2, alpha-3, numeric codes with country name and region.

Searchable ISO 3166-1 country code reference: two-letter alpha-2, three-letter alpha-3 and three-digit numeric codes for each country, with UN region grouping and worked examples like GB, GBR and 826. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is the difference between alpha-2 and alpha-3 country codes?

Alpha-2 codes are two letters (GB, US) and are the most common, used in domains and locales. Alpha-3 codes are three letters (GBR, USA) and are more human-readable and collision-resistant, used in passports and some standards.

ISO 3166-1 country code reference

ISO 3166-1 assigns each country and dependent territory three standardized codes: a two-letter alpha-2, a three-letter alpha-3, and a three-digit numeric code. These codes power locale identifiers, ccTLDs, currency tables, shipping systems and statistical datasets. This reference lets you search by country name or any code form and shows all three side by side.

How the three ISO code forms relate

Each country has one of each code type, kept in sync by the ISO 3166 Maintenance Agency:

  • Alpha-2 — two uppercase letters (GB, US, AM). Most widely used; the basis for ccTLDs and BCP 47 region subtags.
  • Alpha-3 — three uppercase letters (GBR, USA, ARM). More mnemonic and less prone to collision; used in passports and ISO 4217 currency codes (the first two letters of a currency code are the country’s alpha-2).
  • Numeric — three digits (826, 840, 051). Identical to the UN M.49 country code; script-neutral, which is useful where letters cannot be used.

To convert between forms you simply look the country up in the registry — there is no algorithm, the mapping is a fixed table. The region column groups countries by UN M.49 continental area for coarse segmentation.

Where each code type gets used in practice

Knowing which code form a specific system expects saves integration headaches:

System or standardCode type used
HTML lang attribute, BCP 47 localeAlpha-2 region subtag (en-GB)
Country code top-level domainAlpha-2 (mostly; see exceptions)
Passport Machine Readable ZoneAlpha-3
ISO 4217 currency codesFirst two chars of currency code = alpha-2 of issuing country
UN statistical databases, M.49Numeric
Financial messaging (SWIFT, ISO 20022)Alpha-2 or Alpha-3 depending on field
IANA language subtag registryAlpha-2

Known exceptions and edge cases

A handful of codes trip up developers because the ISO registration and the real-world usage diverge:

  • United Kingdom is GB / GBR / 826 in ISO but .uk as a country domain (the .gb ccTLD was registered but has never been widely used).
  • Switzerland is CH / CHE / 756, from the Latin Confoederatio Helvetica — nothing to do with the English name.
  • Greece is GR but .gr — straightforward, but the alpha-3 is GRC, not GRE.
  • Kosovo has no ISO 3166-1 entry as of recent years (recognition is not universal). It is commonly assigned XK / XKX as a user-assigned code, not an official ISO one.
  • Timor-Leste is TL in ISO, not TP (the old Portuguese Timor code).
  • Retired codes like CS (Serbia and Montenegro) or YU (Yugoslavia) are reserved and will not be reused, but can still appear in old data.

Reading one country across all three forms

The United Kingdom illustrates every trap at once: ISO assigns GB / GBR / 826, yet the domain is .uk, licence plates use UK (since 2021), and UK itself is an exceptionally reserved ISO code — reserved so nobody else can take it, but not the official assignment. Armenia shows the numeric-code gotcha: its numeric code is 051, and systems that store numeric codes as integers silently turn it into 51, which then fails string comparisons. Store numeric ISO codes as zero-padded three-character strings, never as numbers.

Codes you can use without colliding with ISO

ISO 3166-1 deliberately sets aside user-assigned code space that the Maintenance Agency promises never to allocate. If you need internal placeholders (test data, “unknown country”, multi-country groupings), draw from these ranges and nowhere else:

FormUser-assigned range
Alpha-2AA, QMQZ, XAXZ, ZZ
Alpha-3AAAAAZ, QMAQZZ, XAAXZZ, ZZAZZZ
Numeric900999

This is exactly why Kosovo is conventionally XK: it sits in the user-assigned XAXZ block, so the (unofficial) convention cannot collide with a future official assignment. The same logic makes ZZ a common “unknown/unspecified” sentinel in address and payment systems.

Separately, ISO keeps a small set of exceptionally reserved codes that appear in the wild but are not country assignments: EU (used in ISO 4217 for the euro and in TIN/VAT contexts), UK (reserved for the United Kingdom), SU (legacy Soviet Union, still seen in the .su ccTLD), and FX (historical “metropolitan France”). Accept them where your upstream data uses them, but map them explicitly rather than treating them as ordinary entries.

Tips and notes

  • The alpha-2 code is your safest default for web and locale work because it matches BCP 47 region subtags and most ccTLDs.
  • For language tags, combine a language subtag with the alpha-2 region: en-GB, hy-AM, pt-BR.
  • When building a shipping or payment form, confirm whether the API expects alpha-2 or numeric — both are common and confusing them causes silent validation failures.
  • Reserved or transitional codes (EU, UK, XK) appear in many datasets; treat anything outside the official list as user-defined or exceptional, and document the choice explicitly.

Sources and references

Maintained by the Gera Tools editorial team. Codes are reassigned when countries form, dissolve, or rename; treat historical data with its date in mind and confirm current assignments on the ISO OBP. Last reviewed 2026-07-02.