Reference FIELD NOTES · 4 MIN READ
Country Codes Explained: Alpha-2, Alpha-3 and Numeric
Why every country has three ISO codes, what each is for, and why the UK’s official code is GB.
Type UK into a government form and it may bounce; type GB and it sails through. Nothing is wrong with either — they are just different things. One is a proud national habit, the other is what the ISO standard actually assigned, and the gap between the two is a good tour of how international country codes really work.
Three codes, one country
ISO 3166-1 gives every entry three interchangeable identifiers. The alpha-2 code is two letters (GB), the alpha-3 code is three (GBR), and the numeric code is three digits (826). All three name the same entity, and any of them can be translated to the others mechanically. The two-letter codes are the ones you meet constantly: they underpin country-code top-level domains (.de, .jp), they appear in locale tags like en-GB and fr-CA, and they are the default in payment forms and address pickers. Three-letter codes show up where documents are read by people — customs paperwork, shipping manifests, ticketing systems — and the digits exist for the cases where letters are the problem.
Why three digits matter
Letters drift with language and alphabet. A numeric code survives every script: China is 156 whether the surrounding record is written in Chinese, Arabic or Cyrillic, and 826 stays 826 in any font or encoding. That script-independence is why UN trade databases, bibliographic standards and several banking formats prefer numeric codes. The numeric system has one more valuable property: a code is never reassigned to a different entity. When Zaire dissolved, its code ZR was withdrawn and the Democratic Republic of the Congo took a new code (CD, 180) — the old records stay unambiguous forever, which is exactly what archives need.
The list is bigger than the map
The standard counts 249 entries, not 193. ISO assigns codes to "countries and dependent territories that are well defined geographically", so Greenland (GL), Hong Kong (HK), Puerto Rico (PR) and even Antarctica (AQ) carry codes. That is not bureaucratic drift: shipping forms, SIM registration, domain delegations and payment cards all treat these territories as separate code spaces. Special cases sit in the list too — the Holy See (VA) and the United States Minor Outlying Islands (UM), a catch-all for specks of reef with no permanent population. Any drop-down built on ISO codes will include territories by design, and filtering them out breaks more than it fixes.
Names move; codes mostly stay
Entries get renamed — Swaziland became Eswatini, Macedonia became North Macedonia, Turkey became Türkiye, the Czech Republic became Czechia — but the codes themselves rarely change, because changing them would break every dataset that mentions the country. Names follow a formal UN-style convention, which is why official lists read oddly: "Korea, Republic of", "Bolivia, Plurinational State of", "Taiwan, Province of China". Informal names still resolve — South Korea, Holland, Burma, Ivory Coast — through alias tables like the one built into our Country Code Lookup. The alias layer is doing real work: ISO assigns UK only as an "exceptionally reserved" code, yet the letters remain what millions of people type first.
Using the codes in software
Practical rules follow from the design. Store alpha-2 as the canonical form: it is the shortest, it matches domain conventions, and most APIs and locale libraries expect it. Accept either case on input — gb, DE and dEu are the same code — and tolerate the famous aliases (UK for GB, UAE for AE) while flagging them. Validate against the full 249-entry list, not just UN members, or you will reject Curaçao (CW) and Gibraltar (GI) as typos. When records must cross script boundaries — multilingual archives, financial messaging, treaty documents — store the numeric code instead, because digits carry no alphabet with them.
Try it yourself
Look up a handful of codes in the Country Code Lookup: try GB and then UK to see the alias note, 076 to watch zero-padding work, and "united" to see how exact matches sort to the top. To meet another code system that outlives the language around it, read how Unicode assigns code points to every character, or see how time zones slice the same territory along completely different lines.