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 it works
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.
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.
- Watch the famous mismatches: the United Kingdom is
GBin ISO but.ukas a domain; Switzerland isCH(from the Latin Confoederatio Helvetica). - For language tags, combine a language subtag with the alpha-2 region:
en-GB,hy-AM,pt-BR. - Reserved or transitional codes exist (
EU,UK,XKfor Kosovo) — treat anything outside the official list as user-defined or exceptional.