apyhub
Cover illustration for Two-Letter Abbreviations for Countries (ISO 3166-1 Alpha-2 Codes) Explained
Change-log

Two-Letter Abbreviations for Countries (ISO 3166-1 Alpha-2 Codes) Explained

TL;DR: A two-letter country code is an ISO 3166-1 alpha-2 code, a two-character identifier assigned by the ISO 3166 Maintenance Agency to represent a country, dependent territory, or special area of geographic interest. There are 249 currently assigned codes. US is the United States, DE is Germany, JP is Japan. The full list is below, along with the exceptions that break integrations.

Updated 26 August 2026. Verified against ISO 3166-1 as maintained by the ISO 3166/MA. 249 assigned codes.

01What Is a Two-Letter Country Code?

A two-letter country code is a two-character identifier defined by ISO 3166-1, published by the International Organization for Standardization. The formal name is ISO 3166-1 alpha-2.

Codes were first included in the standard's first edition in 1974. ISO does not invent country names: those come from United Nations sources, specifically the UN Terminology Bulletin Country Names and the Country and Region Codes for Statistical Use. When the UN notifies ISO of a new member state, the ISO 3166 Maintenance Agency assigns it a code.

There are 249 currently assigned alpha-2 codes. That number is larger than the count of sovereign countries because the standard also covers dependent territories and special areas of geographic interest. Antarctica has a code (AQ). So does the Vatican (VA), Åland (AX), and Bouvet Island (BV), which is uninhabited.

ISO 3166-1 defines three code formats for each entry:

FormatExample (United States)Typical use
Alpha-2USGeneral purpose. ccTLDs, locales, shipping, forms
Alpha-3USAWhere the code should resemble the name. Sport, customs, aid
Numeric-3840Script-independent. Statistics, banking, UN systems

ISO recommends alpha-2 as the general-purpose code, which is why it is the one you meet most often.

02The Exceptions That Break Integrations

This is the section worth reading before the table. Every one of these has caused a production bug somewhere.

The European Commission does not use GR or GB. It uses EL for Greece and UK for the United Kingdom. Neither is a valid ISO 3166-1 alpha-2 code. If you are parsing EU documents, VAT numbers, or Eurostat data, you will meet both, and a strict ISO validator will reject them.

GB is the code, .uk is the domain. The ISO code for the United Kingdom is GB. The country code top-level domain is .uk. UK is reserved in ISO 3166-1 at the request of the UK government, but it is not the assigned code. Both exist and they are not the same thing.

Kosovo has no ISO code. It is not a UN member state, so the ISO 3166 Maintenance Agency has not assigned it one. In practice many systems use XK, which is a user-assigned code adopted by the European Commission, the IMF, and SWIFT. It will fail any validator checking against the official list. If you accept addresses from the Balkans, decide deliberately how to handle this.

Some ccTLDs are not their country's code. .eu is not a country. .io belongs to the British Indian Ocean Territory. .tv is Tuvalu. .ai is Anguilla. .me is Montenegro. Treating a domain suffix as a country code will misroute traffic.

You can safely invent codes, in a defined range. ISO reserves AA, QM to QZ, XA to XZ, and ZZ as user-assigned. The Maintenance Agency will never assign these, so they are safe for internal entities that need a slot. That is where XK for Kosovo comes from.

Codes get retired, and reused. ISO 3166-3 exists to track former countries. Czechoslovakia is CSHH, Yugoslavia is YUCS, East Germany is DDDE. More dangerously, retired alpha-2 codes can be reassigned after a waiting period. If you store a country code as your primary key rather than as a display value, this eventually breaks.

Currency codes are built from them. The first two characters of an ISO 4217 currency code are the country's alpha-2 code. USD, GBP, JPY, CHF. Currencies that belong to no single country start with X: XAU for gold, XDR for IMF special drawing rights.

Case is technically insensitive. ISO 3166-1 alpha-2 codes should be treated as case-insensitive, though convention is uppercase. Locale identifiers follow a different convention: lowercase language, uppercase region, as in en-US or pt-BR.

Taiwan's entry is politically formatted. The ISO short name is "Taiwan, Province of China." If you render ISO names directly in a user-facing dropdown, you will get complaints. Most teams maintain a display-name override layer.

03Where Two-Letter Country Codes Are Used

  • Country code top-level domains. .de, .fr, .jp, with the exceptions noted above.
  • Locale and language tags. BCP 47 combines a language subtag with a region subtag: en-GB, fr-CA, zh-CN.
  • HTML. The lang attribute, as in <html lang="en-US">.
  • ISO 4217 currency codes, where the first two letters are the country.
  • ISO 3166-2 subdivision codes, which prefix the country code: ID-RI is Riau in Indonesia, NG-RI is Rivers in Nigeria.
  • International shipping and postal exchange, where containers are labelled by country code.
  • Machine-readable passports, which use alpha-3.
  • IBAN, where the first two characters are the country's alpha-2 code.
  • Phone number metadata, where libraries key on alpha-2 rather than dialling code, since dialling codes are shared.

04The Complete List: All 249 ISO 3166-1 Alpha-2 Codes

Sorted alphabetically by official ISO short name in English. Current as of 26 August 2026.

CountryAlpha-2Alpha-3Numeric
AfghanistanAFAFG004
AlbaniaALALB008
AlgeriaDZDZA012
American SamoaASASM016
AndorraADAND020
AngolaAOAGO024
AnguillaAIAIA660
AntarcticaAQATA010
Antigua and BarbudaAGATG028
ArgentinaARARG032
ArmeniaAMARM051
ArubaAWABW533
AustraliaAUAUS036
AustriaATAUT040
AzerbaijanAZAZE031
BahamasBSBHS044
BahrainBHBHR048
BangladeshBDBGD050
BarbadosBBBRB052
BelarusBYBLR112
BelgiumBEBEL056
BelizeBZBLZ084
BeninBJBEN204
BermudaBMBMU060
BhutanBTBTN064
Bolivia, Plurinational State ofBOBOL068
Bonaire, Sint Eustatius and SabaBQBES535
Bosnia and HerzegovinaBABIH070
BotswanaBWBWA072
Bouvet IslandBVBVT074
BrazilBRBRA076
British Indian Ocean TerritoryIOIOT086
Brunei DarussalamBNBRN096
BulgariaBGBGR100
Burkina FasoBFBFA854
BurundiBIBDI108
Cabo VerdeCVCPV132
CambodiaKHKHM116
CameroonCMCMR120
CanadaCACAN124
Cayman IslandsKYCYM136
Central African RepublicCFCAF140
ChadTDTCD148
ChileCLCHL152
ChinaCNCHN156
Christmas IslandCXCXR162
Cocos (Keeling) IslandsCCCCK166
ColombiaCOCOL170
ComorosKMCOM174
CongoCGCOG178
Congo, The Democratic Republic of theCDCOD180
Cook IslandsCKCOK184
Costa RicaCRCRI188
CroatiaHRHRV191
CubaCUCUB192
CuraçaoCWCUW531
CyprusCYCYP196
CzechiaCZCZE203
Côte d'IvoireCICIV384
DenmarkDKDNK208
DjiboutiDJDJI262
DominicaDMDMA212
Dominican RepublicDODOM214
EcuadorECECU218
EgyptEGEGY818
El SalvadorSVSLV222
Equatorial GuineaGQGNQ226
EritreaERERI232
EstoniaEEEST233
EswatiniSZSWZ748
EthiopiaETETH231
Falkland Islands (Malvinas)FKFLK238
Faroe IslandsFOFRO234
FijiFJFJI242
FinlandFIFIN246
FranceFRFRA250
French GuianaGFGUF254
French PolynesiaPFPYF258
French Southern TerritoriesTFATF260
GabonGAGAB266
GambiaGMGMB270
GeorgiaGEGEO268
GermanyDEDEU276
GhanaGHGHA288
GibraltarGIGIB292
GreeceGRGRC300
GreenlandGLGRL304
GrenadaGDGRD308
GuadeloupeGPGLP312
GuamGUGUM316
GuatemalaGTGTM320
GuernseyGGGGY831
GuineaGNGIN324
Guinea-BissauGWGNB624
GuyanaGYGUY328
HaitiHTHTI332
Heard Island and McDonald IslandsHMHMD334
Holy See (Vatican City State)VAVAT336
HondurasHNHND340
Hong KongHKHKG344
HungaryHUHUN348
IcelandISISL352
IndiaININD356
IndonesiaIDIDN360
Iran, Islamic Republic ofIRIRN364
IraqIQIRQ368
IrelandIEIRL372
Isle of ManIMIMN833
IsraelILISR376
ItalyITITA380
JamaicaJMJAM388
JapanJPJPN392
JerseyJEJEY832
JordanJOJOR400
KazakhstanKZKAZ398
KenyaKEKEN404
KiribatiKIKIR296
Korea, Democratic People's Republic ofKPPRK408
Korea, Republic ofKRKOR410
KuwaitKWKWT414
KyrgyzstanKGKGZ417
Lao People's Democratic RepublicLALAO418
LatviaLVLVA428
LebanonLBLBN422
LesothoLSLSO426
LiberiaLRLBR430
LibyaLYLBY434
LiechtensteinLILIE438
LithuaniaLTLTU440
LuxembourgLULUX442
MacaoMOMAC446
MadagascarMGMDG450
MalawiMWMWI454
MalaysiaMYMYS458
MaldivesMVMDV462
MaliMLMLI466
MaltaMTMLT470
Marshall IslandsMHMHL584
MartiniqueMQMTQ474
MauritaniaMRMRT478
MauritiusMUMUS480
MayotteYTMYT175
MexicoMXMEX484
Micronesia, Federated States ofFMFSM583
Moldova, Republic ofMDMDA498
MonacoMCMCO492
MongoliaMNMNG496
MontenegroMEMNE499
MontserratMSMSR500
MoroccoMAMAR504
MozambiqueMZMOZ508
MyanmarMMMMR104
NamibiaNANAM516
NauruNRNRU520
NepalNPNPL524
NetherlandsNLNLD528
New CaledoniaNCNCL540
New ZealandNZNZL554
NicaraguaNINIC558
NigerNENER562
NigeriaNGNGA566
NiueNUNIU570
Norfolk IslandNFNFK574
North MacedoniaMKMKD807
Northern Mariana IslandsMPMNP580
NorwayNONOR578
OmanOMOMN512
PakistanPKPAK586
PalauPWPLW585
Palestine, State ofPSPSE275
PanamaPAPAN591
Papua New GuineaPGPNG598
ParaguayPYPRY600
PeruPEPER604
PhilippinesPHPHL608
PitcairnPNPCN612
PolandPLPOL616
PortugalPTPRT620
Puerto RicoPRPRI630
QatarQAQAT634
RomaniaROROU642
Russian FederationRURUS643
RwandaRWRWA646
RéunionREREU638
Saint BarthélemyBLBLM652
Saint Helena, Ascension and Tristan da CunhaSHSHN654
Saint Kitts and NevisKNKNA659
Saint LuciaLCLCA662
Saint Martin (French part)MFMAF663
Saint Pierre and MiquelonPMSPM666
Saint Vincent and the GrenadinesVCVCT670
SamoaWSWSM882
San MarinoSMSMR674
Sao Tome and PrincipeSTSTP678
Saudi ArabiaSASAU682
SenegalSNSEN686
SerbiaRSSRB688
SeychellesSCSYC690
Sierra LeoneSLSLE694
SingaporeSGSGP702
Sint Maarten (Dutch part)SXSXM534
SlovakiaSKSVK703
SloveniaSISVN705
Solomon IslandsSBSLB090
SomaliaSOSOM706
South AfricaZAZAF710
South Georgia and the South Sandwich IslandsGSSGS239
South SudanSSSSD728
SpainESESP724
Sri LankaLKLKA144
SudanSDSDN729
SurinameSRSUR740
Svalbard and Jan MayenSJSJM744
SwedenSESWE752
SwitzerlandCHCHE756
Syrian Arab RepublicSYSYR760
Taiwan, Province of ChinaTWTWN158
TajikistanTJTJK762
Tanzania, United Republic ofTZTZA834
ThailandTHTHA764
Timor-LesteTLTLS626
TogoTGTGO768
TokelauTKTKL772
TongaTOTON776
Trinidad and TobagoTTTTO780
TunisiaTNTUN788
TurkmenistanTMTKM795
Turks and Caicos IslandsTCTCA796
TuvaluTVTUV798
TürkiyeTRTUR792
UgandaUGUGA800
UkraineUAUKR804
United Arab EmiratesAEARE784
United KingdomGBGBR826
United StatesUSUSA840
United States Minor Outlying IslandsUMUMI581
UruguayUYURY858
UzbekistanUZUZB860
VanuatuVUVUT548
Venezuela, Bolivarian Republic ofVEVEN862
Viet NamVNVNM704
Virgin Islands, BritishVGVGB092
Virgin Islands, U.S.VIVIR850
Wallis and FutunaWFWLF876
Western SaharaEHESH732
YemenYEYEM887
ZambiaZMZMB894
ZimbabweZWZWE716
Åland IslandsAXALA248

05Former Country Codes (ISO 3166-3)

When a country ceases to exist, changes its name, or splits, its entry moves to ISO 3166-3 and receives a four-letter code. The first two letters are usually the old alpha-2 code. There are 31 such entries.

Former countryAlpha-4 codeWithdrawn
British Antarctic TerritoryBQAQ1979
Burma, Socialist Republic of the Union ofBUMM1989-12-05
Byelorussian SSR Soviet Socialist RepublicBYAA1992-06-15
Canton and Enderbury IslandsCTKI1984
Czechoslovakia, Czechoslovak Socialist RepublicCSHH1993-06-15
DahomeyDYBJ1977
Dronning Maud LandNQAQ1983
East TimorTPTL2002-05-20
France, MetropolitanFXFR1997-07-14
French Afars and IssasAIDJ1977
French Southern and Antarctic TerritoriesFQHH1979
German Democratic RepublicDDDE1990-10-30
Gilbert and Ellice IslandsGEHH1979
Johnston IslandJTUM1986
Midway IslandsMIUM1986
Netherlands AntillesANHH2010-12-15
Neutral ZoneNTHH1993-07-12
New HebridesNHVU1980
Pacific Islands (trust territory)PCHH1986
Panama Canal ZonePZPA1980
Serbia and MontenegroCSXX2006-09-26
SikkimSKIN1975
Southern RhodesiaRHZW1980
US Miscellaneous Pacific IslandsPUUM1986
USSR, Union of Soviet Socialist RepublicsSUHH1992-08-30
Upper Volta, Republic ofHVBF1984
Viet-Nam, Democratic Republic ofVDVN1977
Wake IslandWKUM1986
Yemen, Democratic, People's Democratic Republic ofYDYE1990-08-14
Yugoslavia, (Socialist) Federal Republic ofYUCS2003-07-23
Zaire, Republic ofZRCD1997-07-14

06Working With Country Codes in Code

Three rules that prevent most country code bugs.

1. Store the code, display the name separately. Country names change (Turkey to Türkiye, Swaziland to Eswatini, Macedonia to North Macedonia). Codes are more stable, but not permanent. Keep an internal identifier as your key, the ISO code as an attribute, and the display name in a layer you control.

2. Validate against a current list, not a hardcoded one. A country list copied into a constants file in 2019 is wrong. South Sudan (SS) was assigned in 2011, Curaçao (CW) and Sint Maarten (SX) in 2010, Bonaire, Sint Eustatius and Saba (BQ) the same year.

3. Decide your policy on non-ISO codes before you meet them. EL, UK, and XK will arrive in real data. Silently rejecting them produces support tickets. Silently accepting them corrupts your data. Map them explicitly.

07Getting Country Codes Programmatically

If you would rather not maintain a country list, two endpoints in the ApyHub catalog cover it.

The Countries Dictionary API returns a mapping of alpha-2 codes to country names:

json

{ "US": "United States", "AU": "Australia", "IN": "India" }

The Country Information API returns fuller detail for a single country: flags, calling codes, currencies, and administrative subdivisions.

Both run on the free plan, which requires no credit card and allows 5 calls a day. For a country list you fetch once and cache, that is genuinely enough. Related endpoints include the Language Dictionary API and the Phone Number Formatter API, which keys on alpha-2 rather than dialling code for the reason described above.

Browse standard data APIs →

08Comparing Country Data APIs

ProviderCoverageStrengthsLimitations
REST CountriesNames, codes, flags, currencies, languagesFree, open source, no key requiredCommunity-maintained, update cadence varies
ApyHubCodes, names, flags, calling codes, subdivisionsOne key across a wider catalog, EU-hosted, no card requiredFree tier is 5 calls a day, so it suits cached lookups rather than per-request calls
CountryLayerCountry data including currencies and languagesFocused product, establishedFree tier is limited, pricing tiers are involved
DataHub / WikipediaThe raw listFree, authoritative, no integration neededStatic files or scraping. No API, no versioning, no uptime guarantee

For a static list that rarely changes, a bundled dataset is genuinely fine and cheaper than an API call. An API earns its place when you need the surrounding metadata, when you want the update problem to be someone else's, or when the same key already covers other things you call.

09Sources

10FAQ

How many two-letter country codes are there? There are 249 currently assigned ISO 3166-1 alpha-2 codes. That exceeds the number of sovereign states because the standard also covers dependent territories and special areas of geographic interest, including Antarctica (AQ) and uninhabited islands like Bouvet Island (BV).

What is a two-letter country code? A two-letter country code, formally an ISO 3166-1 alpha-2 code, is a two-character identifier assigned by the ISO 3166 Maintenance Agency to represent a country, dependent territory, or special area. US is the United States, DE is Germany, JP is Japan.

What is the difference between alpha-2, alpha-3, and numeric country codes? Alpha-2 uses two letters (US) and is ISO's recommended general-purpose code. Alpha-3 uses three letters (USA) and more closely resembles the country name. Numeric-3 uses three digits (840) and is script-independent, which matters for systems not using the Latin alphabet.

Why does the EU use EL for Greece and UK for the United Kingdom? Both are European Commission conventions that predate or diverge from ISO. The ISO codes are GR and GB. Neither EL nor UK is valid ISO 3166-1 alpha-2, so a strict validator will reject them even though they appear throughout EU documents and VAT numbers.

What is the country code for Kosovo? Kosovo has no official ISO 3166-1 code, because it is not a UN member state. XK is widely used in practice and has been adopted by the European Commission, the IMF, and SWIFT, but it is a user-assigned code and will fail validation against the official list.

Is the UK's country code UK or GB? GB is the ISO 3166-1 alpha-2 code. UK is reserved at the request of the UK government and is used as the country code top-level domain, but it is not the assigned ISO code.

Can I make up my own country codes? Yes, within a defined range. ISO reserves AA, QM to QZ, XA to XZ, and ZZ for user assignment and will never allocate them officially. XK for Kosovo is the best-known example of this in practice.

Are two-letter country codes case-sensitive? No. ISO 3166-1 alpha-2 codes should be treated as case-insensitive, though they are conventionally written in uppercase. Locale identifiers use a mixed convention: lowercase language, uppercase region, as in en-US.

What happens when a country changes its name or ceases to exist? Its entry moves to ISO 3166-3 and receives a four-letter code, usually built from the old alpha-2 code. Czechoslovakia is CSHH and Yugoslavia is YUCS. Retired alpha-2 codes can be reassigned later, which is why storing a country code as a database primary key is risky.

Are ccTLDs the same as country codes? Usually, but not always. Most ccTLDs derive from alpha-2 codes, but .uk differs from GB, .eu is not a country at all, and several small territories license their domains commercially, which is why .io, .tv, and .ai appear on sites with no connection to those places.

Where do currency codes come from? The first two characters of an ISO 4217 currency code are the country's alpha-2 code: USD, GBP, JPY. Currencies not tied to one country begin with X, such as XAU for gold and XDR for IMF special drawing rights.

How do I get country codes programmatically? Either bundle a maintained dataset in your application, or call an API. ApyHub's Countries Dictionary API returns alpha-2 codes mapped to names, and the Country Information API returns fuller detail per country. Both are available on a free plan with no credit card.

Should I use an API or a static list? For a list that changes roughly once a year, a bundled dataset is fine and faster. An API is worth it when you need the surrounding metadata like flags, calling codes, and subdivisions, when you would rather not own the update problem, or when the same credential already covers other services you call.

11About ApyHub

ApyHub is a curated API catalog for developers, teams, and AI agents, covering standard data, file conversion, validation, AI, extraction, and more. One subscription covers the whole catalog, billed in atoms, with headroom pooled across every API rather than locked to individual services.

Every service carries machine-readable certification covering data handling, retention, and standards alignment including GDPR, SOC 2, and ISO 27001. Every endpoint is MCP-ready by default.

ApyHub is headquartered in Amsterdam, with offices in the Netherlands, Greece, and India, and runs on EU infrastructure. The catalog holds 450+ services and 1,500+ endpoints, with new APIs and providers onboarded continuously. The free tier requires no credit card.