ISO-3166 defines two-letter, three-letter and numeric standard abbreviations for each country. These are
always written in upper case, e. g. Australia is AU, AUS or 036. The two letter country codes are also used as
TLD (Top Level Domain)s
TLD s) in domain names,
usually written in lower case, e.g. kangaroo. au.
You can find out the country where the user is by interrogating the system property user.country, e.g.String country = System.getProperty( "user.country" );
String country = Locale.getDefault().getCountry();
You can override such system properties on the command line like this:
java -Duser.language=de -Duser.country=DE -Duser.variant=EURO MainClass
For a definitive list see ISO-3166.
| Country Codes |
| By country |
| flag |
country |
code |
 | Åland Islands | AX |
 | Afghanistan | AF |
 | Albania | AL |
 | Algeria | DZ |
 | American Samoa | AS |
 | Andorra | AD |
 | Angola | AO |
 | Anguilla | AI |
 | Antarctica | AQ |
 | Antigua and Barbuda | AG |
 | Argentina | AR |
 | Armenia | AM |
 | Aruba | AW |
 | Ascension | SH |
 | Australia | AU |
 | Australian Antarctic Territory | AU |
 | Austria | AT |
 | Azerbaijan | AZ |
 | Bahamas | BS |
 | Bahrain | BH |
 | Bangladesh | BD |
 | Barbados | BB |
 | Belarus | BY |
 | Belgium | BE |
 | Belize | BZ |
 | Benin | BJ |
 | Bermuda | BM |
 | Bhutan | BT |
 | Bolivia | BO |
 | Bonaire | BQ |
 | Bosnia and Herzegovina | BA |
 | Botswana | BW |
 | Bouvet Island | BV |
 | Brazil | BR |
 | British Indian Ocean Territory | IO |
 | British. Virgin Islands | VG |
 | Brunei | BN |
 | Bulgaria | BG |
 | Burkina Faso | BF |
 | Burundi | BI |
 | Côte d’Ivoire | CI |
 | Cambodia | KH |
 | Cameroon | CM |
 | Canada | CA |
 | Cape Verde | CV |
 | Caribbean Netherlands | BQ |
 | Cayman Islands | KY |
 | Central African Republic | CF |
 | Chad | TD |
 | Channel Islands | GB |
 | Chile | CL |
 | China (Mainland) | CN |
 | Christmas Island | CX |
 | Cocos (Keeling) Islands | CC |
 | Colombia | CO |
 | Comoros | KM |
 | Cook Islands | CK |
 | Costa Rica | CR |
 | Croatia | HR |
 | Cuba | CU |
 | Curaçao | CW |
 | Cyprus | CY |
 | Czech Republic | CZ |
 | Czech Republic (obsolete) | CS |
 | Democratic Republic of Congo | CD |
 | Denmark | DK |
 | Djibouti | DJ |
 | Dominica | DM |
 | Dominican Republic | DO |
 | Ecuador | EC |
 | Egypt | EG |
 | El Salvador | SV |
 | Equatorial Guinea | GQ |
 | Eritrea | ER |
 | Estonia | EE |
 | Ethiopia | ET |
 | Falkland Islands (Malvinas) | FK |
 | Faroe Islands | FO |
 | Fiji | FJ |
 | Finland | FI |
 | France | FR |
 | France metropolitan | FX |
 | French Guiana | GF |
 | French Polynesia | PF |
 | French Southern Territories | TF |
 | Gabon | GA |
 | Gambia | GM |
 | Georgia | GE |
 | Germany | DE |
 | Ghana | GH |
 | Gibraltar | GI |
 | Greece | GR |
 | Greenland | GL |
 | Grenada | GD |
 | Guadeloupe | GP |
 | Guam | GU |
 | Guatemala | GT |
 | Guernsey | GG |
 | Guinea | GN |
 | Guinea-Bissau | GW |
 | Guyana | GY |
 | Haiti | HT |
 | Heard and McDonald Islands | HM |
 | Honduras | HN |
 | Hong Kong | HK |
 | Hungary | HU |
 | Iceland | IS |
 | India | IN |
 | Indonesia | ID |
 | Iran | IR |
 | Iraq | IQ |
 | Ireland | IE |
 | Isle of Man | IM |
 | Israel | IL |
 | Italy | IT |
 | Jamaica | JM |
 | Jan Mayen | SJ |
 | Japan | JP |
 | Jersey | JE |
 | Jordan | JO |
 | Kazakhstan | KZ |
 | Kenya | KE |
 | Kiribati | KI |
 | Kuwait | KW |
 | Kyrgyzstan | KG |
 | Laos | LA |
 | Latvia | LV |
 | Lebanon | LB |
 | Lesotho | LS |
 | Liberia | LR |
 | Libya | LY |
 | Liechtenstein | LI |
 | Lithuania | LT |
 | Luxembourg | LU |
 | Macau | MO |
 | Macedonia | MK |
 | Madagascar | MG |
 | Malawi | MW |
 | Malaysia | MY |
 | Maldives | MV |
 | Mali | ML |
 | Malta | MT |
 | Marshall Islands | MH |
 | Martinique | MQ |
 | Mauritania | MR |
 | Mauritius | MU |
 | Mayotte | YT |
 | Mexico | MX |
 | Micronesia | FM |
 | Moldova | MD |
 | Monaco | MC |
 | Mongolia | MN |
 | Montenegro | ME |
 | Montserrat | MS |
 | Morocco | MA |
 | Mozambique | MZ |
 | Myanmar | MM |
 | Namibia | NA |
 | Nauru | NR |
 | Nepal | NP |
 | Netherlands | NL |
 | Netherlands Antilles | AN |
 | New Caledonia | NC |
 | New Zealand | NZ |
 | Nicaragua | NI |
 | Niger | NE |
 | Nigeria | NG |
 | Niue | NU |
 | Norfolk Island | NF |
 | North Korea | KP |
 | Northern Mariana Islands | MP |
 | Norway | NO |
 | Oman | OM |
 | Pakistan | PK |
 | Palau | PW |
 | Palestinian territory | PS |
 | Panama | PA |
 | Papua New Guinea | PG |
 | Paraguay | PY |
 | Peru | PE |
 | Philippines | PH |
 | Pitcairn | PN |
 | Poland | PL |
 | Portugal | PT |
 | Puerto Rico | PR |
 | Qatar | QA |
 | Réunion | RE |
 | Republic of the Congo | CG |
 | Romania | RO |
 | Russian Federation | RU |
 | Rwanda | RW |
 | São Tomé and and Príncipe | ST |
 | Saba | BQ |
 | Saint Barthélemy | BL |
 | Saint Eustatius | BQ |
 | Saint Helena | SH |
 | Saint Kitts and Nevis | KN |
 | Saint Lucia | LC |
 | Saint Vincent and the Grenadines | VC |
 | Samoa | WS |
 | San Marino | SM |
 | Saudi Arabia | SA |
 | Senegal | SN |
 | Serbia and Montenegro | RS |
 | Seychelles | SC |
 | Sierra Leone | SL |
 | Singapore | SG |
 | Sint Maarten (Dutch Part) | SX |
 | Slovakia | SK |
 | Slovenia | SI |
 | Solomon Islands | SB |
 | Somalia (except Somaliland) | SO |
 | South Africa | ZA |
 | South Georgia | GS |
 | South Korea | KR |
 | South Sandwich Islands | GS |
 | Spain | ES |
 | Sri Lanka | LK |
 | St. Martin (French half) | MF |
 | St. Pierre and Miquelon | PM |
 | Sudan | SD |
 | Suriname | SR |
 | Svalbard | SJ |
 | Swaziland | SZ |
 | Sweden | SE |
 | Switzerland | CH |
 | Syria | SY |
 | Taiwan | TW |
 | Tajikistan | TJ |
 | Tanzania | TZ |
 | Thailand | TH |
 | Timor-Leste | TL |
 | Togo | TG |
 | Tokelau | TK |
 | Tonga | TO |
 | Trinidad and Tobago | TT |
 | Tristan da Cunha | SH |
 | Tunisia | TN |
 | Turkey | TR |
 | Turkmenistan | TM |
 | Turks and Caicos Islands | TC |
 | Tuvalu | TV |
 | U.S. Virgin Islands | VI |
 | Uganda | UG |
 | Ukraine | UA |
 | United Arab Emirates | AE |
 | United Kingdom | GB |
 | United States | US |
 | United States (minor outlying islands) | UM |
 | Uruguay | UY |
 | Uzbekistan | UZ |
 | Vanuatu | VU |
 | Vatican | VA |
 | Venezuela | VE |
 | Vietnam | VN |
 | Wallis and Futuna Islands | WF |
 | Western Sahara | EH |
 | Yemen | YE |
 | Zambia | ZM |
 | Zimbabwe | ZW |
|
|
| By code |
| flag |
code |
country |
 | AD | Andorra |
 | AE | United Arab Emirates |
 | AF | Afghanistan |
 | AG | Antigua and Barbuda |
 | AI | Anguilla |
 | AL | Albania |
 | AM | Armenia |
 | AN | Netherlands Antilles |
 | AO | Angola |
 | AQ | Antarctica |
 | AR | Argentina |
 | AS | American Samoa |
 | AT | Austria |
 | AU | Australia |
 | AU | Australian Antarctic Territory |
 | AW | Aruba |
 | AX | Åland Islands |
 | AZ | Azerbaijan |
 | BA | Bosnia and Herzegovina |
 | BB | Barbados |
 | BD | Bangladesh |
 | BE | Belgium |
 | BF | Burkina Faso |
 | BG | Bulgaria |
 | BH | Bahrain |
 | BI | Burundi |
 | BJ | Benin |
 | BL | Saint Barthélemy |
 | BM | Bermuda |
 | BN | Brunei |
 | BO | Bolivia |
 | BQ | Bonaire |
 | BQ | Caribbean Netherlands |
 | BQ | Saba |
 | BQ | Saint Eustatius |
 | BR | Brazil |
 | BS | Bahamas |
 | BT | Bhutan |
 | BV | Bouvet Island |
 | BW | Botswana |
 | BY | Belarus |
 | BZ | Belize |
 | CA | Canada |
 | CC | Cocos (Keeling) Islands |
 | CD | Democratic Republic of Congo |
 | CF | Central African Republic |
 | CG | Republic of the Congo |
 | CH | Switzerland |
 | CI | Côte d’Ivoire |
 | CK | Cook Islands |
 | CL | Chile |
 | CM | Cameroon |
 | CN | China (Mainland) |
 | CO | Colombia |
 | CR | Costa Rica |
 | CS | Czech Republic (obsolete) |
 | CU | Cuba |
 | CV | Cape Verde |
 | CW | Curaçao |
 | CX | Christmas Island |
 | CY | Cyprus |
 | CZ | Czech Republic |
 | DE | Germany |
 | DJ | Djibouti |
 | DK | Denmark |
 | DM | Dominica |
 | DO | Dominican Republic |
 | DZ | Algeria |
 | EC | Ecuador |
 | EE | Estonia |
 | EG | Egypt |
 | EH | Western Sahara |
 | ER | Eritrea |
 | ES | Spain |
 | ET | Ethiopia |
 | FI | Finland |
 | FJ | Fiji |
 | FK | Falkland Islands (Malvinas) |
 | FM | Micronesia |
 | FO | Faroe Islands |
 | FR | France |
 | FX | France metropolitan |
 | GA | Gabon |
 | GB | Channel Islands |
 | GB | United Kingdom |
 | GD | Grenada |
 | GE | Georgia |
 | GF | French Guiana |
 | GG | Guernsey |
 | GH | Ghana |
 | GI | Gibraltar |
 | GL | Greenland |
 | GM | Gambia |
 | GN | Guinea |
 | GP | Guadeloupe |
 | GQ | Equatorial Guinea |
 | GR | Greece |
 | GS | South Georgia |
 | GS | South Sandwich Islands |
 | GT | Guatemala |
 | GU | Guam |
 | GW | Guinea-Bissau |
 | GY | Guyana |
 | HK | Hong Kong |
 | HM | Heard and McDonald Islands |
 | HN | Honduras |
 | HR | Croatia |
 | HT | Haiti |
 | HU | Hungary |
 | ID | Indonesia |
 | IE | Ireland |
 | IL | Israel |
 | IM | Isle of Man |
 | IN | India |
 | IO | British Indian Ocean Territory |
 | IQ | Iraq |
 | IR | Iran |
 | IS | Iceland |
 | IT | Italy |
 | JE | Jersey |
 | JM | Jamaica |
 | JO | Jordan |
 | JP | Japan |
 | KE | Kenya |
 | KG | Kyrgyzstan |
 | KH | Cambodia |
 | KI | Kiribati |
 | KM | Comoros |
 | KN | Saint Kitts and Nevis |
 | KP | North Korea |
 | KR | South Korea |
 | KW | Kuwait |
 | KY | Cayman Islands |
 | KZ | Kazakhstan |
 | LA | Laos |
 | LB | Lebanon |
 | LC | Saint Lucia |
 | LI | Liechtenstein |
 | LK | Sri Lanka |
 | LR | Liberia |
 | LS | Lesotho |
 | LT | Lithuania |
 | LU | Luxembourg |
 | LV | Latvia |
 | LY | Libya |
 | MA | Morocco |
 | MC | Monaco |
 | MD | Moldova |
 | ME | Montenegro |
 | MF | St. Martin (French half) |
 | MG | Madagascar |
 | MH | Marshall Islands |
 | MK | Macedonia |
 | ML | Mali |
 | MM | Myanmar |
 | MN | Mongolia |
 | MO | Macau |
 | MP | Northern Mariana Islands |
 | MQ | Martinique |
 | MR | Mauritania |
 | MS | Montserrat |
 | MT | Malta |
 | MU | Mauritius |
 | MV | Maldives |
 | MW | Malawi |
 | MX | Mexico |
 | MY | Malaysia |
 | MZ | Mozambique |
 | NA | Namibia |
 | NC | New Caledonia |
 | NE | Niger |
 | NF | Norfolk Island |
 | NG | Nigeria |
 | NI | Nicaragua |
 | NL | Netherlands |
 | NO | Norway |
 | NP | Nepal |
 | NR | Nauru |
 | NU | Niue |
 | NZ | New Zealand |
 | OM | Oman |
 | PA | Panama |
 | PE | Peru |
 | PF | French Polynesia |
 | PG | Papua New Guinea |
 | PH | Philippines |
 | PK | Pakistan |
 | PL | Poland |
 | PM | St. Pierre and Miquelon |
 | PN | Pitcairn |
 | PR | Puerto Rico |
 | PS | Palestinian territory |
 | PT | Portugal |
 | PW | Palau |
 | PY | Paraguay |
 | QA | Qatar |
 | RE | Réunion |
 | RO | Romania |
 | RS | Serbia and Montenegro |
 | RU | Russian Federation |
 | RW | Rwanda |
 | SA | Saudi Arabia |
 | SB | Solomon Islands |
 | SC | Seychelles |
 | SD | Sudan |
 | SE | Sweden |
 | SG | Singapore |
 | SH | Ascension |
 | SH | Saint Helena |
 | SH | Tristan da Cunha |
 | SI | Slovenia |
 | SJ | Jan Mayen |
 | SJ | Svalbard |
 | SK | Slovakia |
 | SL | Sierra Leone |
 | SM | San Marino |
 | SN | Senegal |
 | SO | Somalia (except Somaliland) |
 | SR | Suriname |
 | ST | São Tomé and and Príncipe |
 | SV | El Salvador |
 | SX | Sint Maarten (Dutch Part) |
 | SY | Syria |
 | SZ | Swaziland |
 | TC | Turks and Caicos Islands |
 | TD | Chad |
 | TF | French Southern Territories |
 | TG | Togo |
 | TH | Thailand |
 | TJ | Tajikistan |
 | TK | Tokelau |
 | TL | Timor-Leste |
 | TM | Turkmenistan |
 | TN | Tunisia |
 | TO | Tonga |
 | TR | Turkey |
 | TT | Trinidad and Tobago |
 | TV | Tuvalu |
 | TW | Taiwan |
 | TZ | Tanzania |
 | UA | Ukraine |
 | UG | Uganda |
 | UM | United States (minor outlying islands) |
 | US | United States |
 | UY | Uruguay |
 | UZ | Uzbekistan |
 | VA | Vatican |
 | VC | Saint Vincent and the Grenadines |
 | VE | Venezuela |
 | VG | British. Virgin Islands |
 | VI | U.S. Virgin Islands |
 | VN | Vietnam |
 | VU | Vanuatu |
 | WF | Wallis and Futuna Islands |
 | WS | Samoa |
 | YE | Yemen |
 | YT | Mayotte |
 | ZA | South Africa |
 | ZM | Zambia |
 | ZW | Zimbabwe |
|
Country codes overlap province and states codes. For example ca means both
Canada and California and sk means both Slovakia and Saskatchewan.
Most of the flags came compliments of icondrawer.com. Bonaire, Curaçao,
St. Maarten, Serbia and Montenegro came from Wikipedia.