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 URLs and currencies to IBAN accounts and Olympic uniforms.

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:

  • Top-level domains (.us, .de, .jp).
  • HTML lang attributes when combined with a language code (en-US, pt-BR).
  • Telephone numbering plans.
  • 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. Three letters give 17,576 possible codes versus the two-letter system’s 676, which makes alpha-3 codes more memorable when displayed in tables and harder to confuse with each other. They appear in:

  • Olympic and FIFA team designations.
  • IBAN bank account numbers (within country-specific extensions).
  • Drivers’ licenses and vehicle registration plates.
  • Currency codes (the first two letters are the alpha-2 country, the third indicates the currency).

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 appear in:

  • The United Nations statistical division.
  • Some bank routing systems.
  • 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 issued when a sovereign state is recognized.
  • 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 — Great Britain Pound (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, so the code starts with EU and uses R from “euRo.” Other supranational and exceptional currencies (CFA franc, special drawing rights) follow similar conventions.

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).

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