ISO 3166-1 country codes identify countries, dependent territories and areas of special geographic interest. They are among the most widely reused codes in computing: internet country domains, currency codes, BCP 47 language tags, passports and almost every address form rely on them. The table on this page is the full list of all 249 current entries, with alpha-2 and alpha-3 codes side by side.
Alpha-2, alpha-3 and numeric country codes
Every entry in ISO 3166-1 comes in three equivalent forms, and the full list below shows all of them: alpha-2 and alpha-3 letters plus the numeric code. Taking Jamaica as an example, the alpha-2 code is JM, the alpha-3 code is JAM and the numeric code is 388.
- Alpha-2 codes are the most common form. Internet country domains are built from them, and BCP 47 language tags such as
pt-BRuse them for the region. - Alpha-3 codes are easier to recognize at a glance (
NOR,LKA,MUS) and appear in statistical tables, sports results and machine-readable passports. - Numeric codes come from the UN M49 standard. They do not depend on the Latin alphabet and can outlast a change of country name.
Country codes that changed or confuse
The list is stable, but not frozen. When the Netherlands Antilles were dissolved in 2010, three new country codes appeared: BQ for Bonaire, Sint Eustatius and Saba, CW for Curaçao and SX for Sint Maarten, while the old code AN moved to the list of former names in ISO 3166-3. South Sudan received SS in 2011. Records created before such changes keep the code that was valid at the time, so a collection that spans decades needs both lists.
Some country codes are simply easy to misread. DM is Dominica, not the Dominican Republic (DO); MU is Mauritius, not Mauritania (MR); TG is Togo; LK is Sri Lanka. The United Kingdom is GB, with UK reserved only because of the .uk domain.
Country codes in Dublin Core and format metadata
In a Dublin Core record a place goes in dcterms:spatial or the broader dc:coverage. Writing the ISO 3166-1 country code and declaring the ISO3166 encoding scheme tells every system that LK means Sri Lanka and is not an abbreviation of something else. The same codes appear in format metadata when a specification is tied to a jurisdiction, for example a national archival standard, and they combine with the ISO 639-2 language codes in language tags such as fr-CA.
How ISO 3166 is organized
ISO 3166 has three parts, and each answers a different question about a place.
- ISO 3166-1 codes countries, dependent territories and special areas of geographic interest. It is the source of the alpha-2, alpha-3 and numeric codes in the full list on this page.
- ISO 3166-2 codes the principal subdivisions of each entry in part 1: states, provinces, regions, counties and similar units.
- ISO 3166-3 keeps the names and codes of entries that have left part 1, so that older records stay readable.
All three are kept by the ISO 3166 Maintenance Agency, whose secretariat sits at the ISO Central Secretariat in Geneva. The agency decides on new codes and changes, and publishes them through the ISO Online Browsing Platform and its newsletters. Names for countries are taken from United Nations sources; the Maintenance Agency does not decide what is or is not a country. That is why ISO 3166-1 country codes cover places that are not sovereign states, such as Greenland (GL) or the Falkland Islands (FK), and why some disputed places have no code at all.
Officially assigned, user-assigned and reserved codes
Not every two-letter combination is free. ISO 3166-1 sorts the possible codes into classes, and a system that validates country codes needs to know them.
Officially assigned codes are the current entries, the only ones that belong in the main list.
User-assigned codes are set aside for private use and will never be assigned by ISO. For alpha-2 they are AA, QM to QZ, XA to XZ and ZZ; for alpha-3 the ranges AAA to AAZ, QMA to QZZ, XAA to XZZ and ZZA to ZZZ; and for numeric codes 900 to 999. Organizations use them for things ISO does not cover. The best-known example is XK, which the European Commission, many banks and a large share of software use for Kosovo. XK is a user-assigned code, not an official ISO 3166-1 entry, and a record that contains it is only interpretable if the system documents that meaning.
Exceptionally reserved codes exist because some other body asked for them. UK is the best-known case: the United Kingdom’s official code is GB, but UK is reserved because of the .uk internet domain. EU is reserved for the European Union, and AC (Ascension Island), DG (Diego Garcia), IC (Canary Islands) and TA (Tristan da Cunha) are reserved at the request of postal or telecommunications bodies. These codes can appear in real data and are valid in their own context, but they are not country codes in the ISO 3166-1 sense.
Transitionally reserved codes are former codes kept out of circulation for a period after an entry was deleted, so that old data is not misread. BU (Burma), TP (East Timor) and ZR (Zaire) have been held back this way.
Indeterminately reserved codes are kept back because they are in use in other coding systems, notably the distinguishing signs for vehicles in international traffic, and ISO avoids assigning them to something else.
How country codes are assigned and retired
New entries appear when the UN sources list a new country or territory name. The changes since 2010 already listed above (BQ, CW, SX, SS) are typical: a political change happens, the Maintenance Agency assigns codes, and the outgoing entry moves to ISO 3166-3.
Part 3 gives every former entry a four-letter code. The first two letters are the old alpha-2 code; the last two are the new alpha-2 code if the territory passed to a single successor, or HH if it did not.
- CSHH: Czechoslovakia, which split into the Czech Republic (CZ) and Slovakia (SK)
- DDDE: the German Democratic Republic, merged into Germany (DE)
- SUHH: the USSR
- YUCS: Yugoslavia, succeeded by Serbia and Montenegro (CS)
- ANHH: the Netherlands Antilles, divided into BQ, CW and SX
- ZRCD: Zaire, renamed the Democratic Republic of the Congo (CD)
- BUMM: Burma, now Myanmar (MM)
YUCS shows a trap worth remembering. The code CS was first Czechoslovakia, then, after a gap, Serbia and Montenegro, which was itself dissolved into RS and ME. A record that says only CS is ambiguous unless it also carries a date. Reuse of this kind is the reason the agency now keeps retired codes reserved for a long period, and the reason Bonaire, Sint Eustatius and Saba received a fresh code instead of the retired AN.
Country codes in other standards
Many standards borrow ISO 3166-1 country codes, and nearly all of them add exceptions. The table and notes below are the cases that most often cause mismatches when data moves between systems.
| System | Code form | Germany | Switzerland |
|---|---|---|---|
| ISO 3166-1 | alpha-2 and alpha-3 | DE / DEU | CH / CHE |
| ICAO passports (Doc 9303) | alpha-3, with exceptions | D | CHE |
| IOC (Olympics) | own three-letter codes | GER | SUI |
| FIFA | own three-letter codes | GER | SUI |
Internet country domains
Country code top-level domains follow alpha-2 almost everywhere, but the exceptions are real. The United Kingdom uses .uk, not .gb (which exists and is unused); the European Union has .eu; Ascension Island has .ac from its reserved code. The old .su of the USSR is still delegated. A domain extension is therefore a hint, never a substitute for a country code in metadata.
Currency codes
ISO 4217 builds most currency codes from the alpha-2 code plus one letter: USD (United States dollar), CHF (Swiss franc), LKR (Sri Lankan rupee, see Sri Lanka). EUR uses the reserved EU code, and codes starting with X cover supranational currencies and commodities such as XDR and XAU. Deriving a country from the first two letters of a currency code works often enough to be tempting and fails on exactly those cases.
Language tags
BCP 47 uses the alpha-2 code as its region subtag (pt-BR, fr-CA), and also accepts UN M49 numeric codes for areas larger than a country: es-419 is Spanish for Latin America and the Caribbean. The region subtag describes where a language variety is used, which is why the language codes page and this one often meet in the same tag. DCMI’s RFC5646 scheme marks such values in a Dublin Core record.
Passports and travel documents
Machine-readable passports defined in ICAO Doc 9303 use alpha-3 codes for the issuing state and nationality, with a handful of exceptions. Germany is written D, a single letter padded with filler characters. Special codes cover cases ISO does not, such as GBD for British Overseas Territories citizens, UNO for United Nations documents and XXA for stateless persons. Systems that read nationality from passports and store it as ISO 3166-1 alpha-3 need a mapping table, not a direct copy.
Sport
The IOC and FIFA keep their own codes, which predate or ignore ISO choices: GER, SUI, NED (Netherlands, ISO NLD), POR (Portugal, ISO PRT), DEN (Denmark, ISO DNK). FIFA also codes the four home nations of the United Kingdom separately (ENG, SCO, WAL, NIR) because they compete separately. Results data that arrives with these codes looks like alpha-3 and is not.
ISO 3166-2 subdivisions in metadata
ISO 3166-2 combines the alpha-2 code of the country, a hyphen and up to three letters or digits for the subdivision: US-CA (California), DE-BY (Bavaria), CA-QC (Quebec), GB-SCT (Scotland), ES-CT (Catalonia). The prefix makes every subdivision code globally unique, and it lets a system fall back to the country when it only understands part 1.
Subdivision codes change more often than country codes. Countries reorganize regions, merge counties or rename provinces, and the Maintenance Agency publishes these changes as for part 1. A collection that records subdivisions should store the code exactly as it was valid when the record was made and keep a note of the edition or date. A Dublin Core record can carry a subdivision code in dcterms:spatial with the ISO3166 scheme, since ISO 3166-2 is part of the same standard. When precision below the subdivision matters, coordinates or a bounding box in the DCMI Box notation say more than any code.
Practical validation rules for systems that store country codes
The rules below are the ones that prevent most errors in practice. They apply equally to a catalog, a format registry or an e-commerce address table.
- Store uppercase, accept any case. ISO 3166-1 codes are uppercase. Normalize input on entry and compare in uppercase, so lk, Lk and LK do not become three values.
- Keep alpha-2 and alpha-3 in separate fields. A field that sometimes holds DE and sometimes DEU defeats every index. If both forms are needed, store one and derive the other from the official table.
- Never store the numeric code as a number. Numeric codes have leading zeros (004 is Afghanistan). Store them as three-character strings.
- Validate against the current list, and keep the historical one. New records should accept only officially assigned codes. Old records will contain codes from ISO 3166-3 or transitional reservations; flag them for review instead of rejecting the import, and map them to successors only where the succession is clear (ZR to CD, yes; YU to a single successor, no).
- Treat user-assigned codes as local. XK, AA or ZZ may be intentional, but their meaning lives in the local documentation. Accept them only from a documented list and export them with that meaning stated.
- Do not accept reserved codes as countries. UK, EU and the other exceptionally reserved codes should be translated (UK to GB) or rejected, depending on what the field is for.
- Record the version. A changelog entry or a date of the last comparison with the Maintenance Agency publications makes later corrections possible.
Mapping old records
A migration from an older catalog usually turns up three kinds of value in the country field: retired codes, free-text names and codes from other systems. Each needs its own treatment. Retired codes are looked up in ISO 3166-3 and either mapped to a single successor or kept with a historical flag. Free text (“Holland”, “Ceylon”, “West Germany”) goes through a reviewed name table, never an automatic fuzzy match, because a wrong guess is harder to find later than a gap. Values that look like alpha-3 but come from sports or passport data (GER, SUI, D) are recognized by their source and converted through a mapping table. Keeping the original value in a separate note field costs little and lets anyone check the conversion afterwards.
A worked example: country codes in a place record
Consider a digitized photograph taken in Kandy, Sri Lanka, held by an archive that publishes both Dublin Core XML and schema.org JSON-LD. The country goes in as an ISO 3166-1 alpha-2 code with its scheme declared; the city stays as a name, because ISO 3166 does not code cities.
<dcterms:spatial xsi:type="dcterms:ISO3166">LK</dcterms:spatial>
<dcterms:spatial>Kandy</dcterms:spatial>
<dcterms:spatial xsi:type="dcterms:Point">north=7.29; east=80.63; name=Kandy</dcterms:spatial>
The same place in schema.org, where addressCountry accepts the alpha-2 code as text:
{
"@context": "https://schema.org",
"@type": "Photograph",
"name": "Temple of the Tooth, Kandy",
"contentLocation": {
"@type": "Place",
"name": "Kandy",
"address": {
"@type": "PostalAddress",
"addressLocality": "Kandy",
"addressCountry": "LK"
}
}
}
Two details make the records robust. The country is a code, not “Sri Lanka” or the historical “Ceylon”, so it matches every other record in the system regardless of language. And the alpha-2 form is used in both serializations, so a crosswalk between them needs no lookup. If the archive also records the subdivision, LK-2 (Central Province) fits in a second dcterms:spatial element with the same scheme, which is where many records stop needing anything finer. For more on structuring the rest of such a record, see the guide to Dublin Core metadata records, and for other vocabularies with code pages, the vocabulary index.