Skip to content
Countries

ISO Country Codes: Two-Letter, Three-Letter, and Numeric

Every country has three ISO 3166-1 codes — alpha-2, alpha-3, and numeric. You'll see them everywhere from domain names and currencies to IBAN accounts and passports.

Open a passport, a domain registry, or a bank wire form and you are looking at country codes. Most people see them as opaque shorthand, but the codes have an organized structure: there are three official forms, each with its own purpose, and they are almost never used interchangeably without consequence.

The three forms

ISO 3166-1 alpha-2 is the two-letter code: US, GB, JP, DE. These are the most commonly seen — they appear in:

  • Most country-code top-level domains (.us, .de, .jp — though the United Kingdom uses .uk, not .gb).
  • HTML lang attributes when combined with a language code (en-US, pt-BR).
  • IBAN bank account numbers, which begin with the alpha-2 code (DE…, GB…).
  • Currency codes (more on this in a moment).
  • Most software that needs a short country identifier.

ISO 3166-1 alpha-3 is the three-letter code: USA, GBR, JPN, DEU. The extra letter lets the code follow the country’s name more closely, which makes alpha-3 codes easier to recognize in tables. They appear in:

  • The machine-readable zone of passports, where they identify the issuing state and nationality.
  • International statistical datasets, such as those published by the UN and the World Bank.

They are easy to confuse with sports codes, but the Olympic and FIFA codes are separate systems: Germany is GER and Switzerland SUI at the Olympics, versus DEU and CHE in ISO 3166-1. International vehicle registration codes (D, CH) are a different system again.

ISO 3166-1 numeric is a three-digit code: 840 (USA), 826 (GBR), 392 (JPN), 276 (DEU). Numeric codes have no language dependency — they are equally useful in scripts that do not use Latin letters and in systems that prefer integers. They are derived from the UN Statistics Division’s M49 area codes and appear in:

  • United Nations statistical data.
  • Customs and trade documentation.

How to memorize the three forms

A useful pattern: alpha-2 is the most common short identifier, alpha-3 is the most common medium-length one, numeric is the least common but the most stable across language scripts.

For a country with multiple recognizable names, the codes don’t always match the country’s “current” name. Examples:

CountryAlpha-2Alpha-3Numeric
United StatesUSUSA840
United KingdomGBGBR826
GermanyDEDEU276
SwitzerlandCHCHE756
South AfricaZAZAF710
Czech RepublicCZCZE203
South KoreaKRKOR410
VietnamVNVNM704

Switzerland’s CH is the canonical “why does it look like that” code: it stands for Confoederatio Helvetica, the country’s Latin name. The Latin form is used because Switzerland has four official languages and no preferred one.

Subdivisions: ISO 3166-2

ISO 3166-2 codes identify subdivisions within a country: U.S. states, Canadian provinces, German Bundesländer, Indian states. The format is the alpha-2 country code, a hyphen, and a one-to-three-character subdivision identifier.

  • US-CA — California
  • US-NY — New York
  • CA-ON — Ontario, Canada
  • DE-BY — Bavaria, Germany
  • JP-13 — Tokyo Metropolis

These are the codes used by shipping platforms, address verification services, and any application that lets a user pick a state or region from a dropdown.

The “why” of code stability

ISO 3166 is updated periodically as countries form, dissolve, or rename. The codes are intentionally slow to change:

  • A code that has been retired is not reused for at least 50 years, so old data is never silently ambiguous.
  • New codes are generally issued when a new country or territory appears in UN listings — South Sudan received SS in 2011.
  • Spelling changes (e.g., “Czech Republic” → “Czechia”) usually preserve existing codes.

The retired codes for the Soviet Union (SU, SUN, 810), Yugoslavia (YU, YUG, 891), and the German Democratic Republic (DD, DDR, 278) are still reserved and unavailable for reassignment.

Currency codes: ISO 4217

Currency codes are a sister standard. They are also three letters, with the first two letters typically matching the alpha-2 country code and the third letter naming the currency unit:

  • USD — United States Dollar (US + D)
  • GBP — Pound sterling (GB + P)
  • JPY — Japanese Yen (JP + Y)
  • EUR — Euro (no country prefix; supranational)

The Euro is the famous exception. The European Union is not a country, but EU is an exceptionally reserved code, so the currency became EUR. Other supranational currencies and units use codes starting with X — the CFA francs are XOF and XAF, special drawing rights XDR.

Working with country codes in software

Three principles avoid most bugs:

  1. Store alpha-2 as the canonical key. It is the shortest unambiguous code and is the one most APIs accept.
  2. Display alpha-3 in user interfaces when space permits. It is more memorable and harder to mistake.
  3. Use numeric codes for cross-language data exchange (e.g., when communicating with East Asian systems where Latin characters are not preferred).

Country pages on this site, such as Japan or the United Kingdom, list each country’s codes alongside its time zones and capital.

If you are building a form that asks for a country, populate it with alpha-2 codes and human-readable labels. If you are building a data warehouse, store the numeric and alpha-3 alongside the alpha-2 — disk is cheap and you save translation work later.

More related articles