Flag | Code | Country Name | Capital |
 |
AD |
Andorra |
Andorra la Vella
|
 |
AE |
United Arab Emirates |
Abu Dhabi
|
 |
AF |
Afghanistan |
Kabul
|
 |
AG |
Antigua and Barbuda |
St. John's
|
 |
AI |
Anguilla |
The Valley
|
 |
AL |
Albania |
Tirana
|
 |
AM |
Armenia |
Yerevan
|
 |
AO |
Angola |
Luanda
|
 |
AQ |
Antarctica |
|
 |
AR |
Argentina |
Buenos Aires
|
 |
AS |
American Samoa |
Pago Pago
|
 |
AT |
Austria |
Vienna
|
 |
AU |
Australia |
Canberra
|
 |
AW |
Aruba |
Oranjestad
|
 |
AX |
Ã
land Islands |
Mariehamn
|
 |
AZ |
Azerbaijan |
Baku
|
 |
BA |
Bosnia and Herzegovina |
Sarajevo
|
 |
BB |
Barbados |
Bridgetown
|
 |
BD |
Bangladesh |
Dhaka
|
 |
BE |
Belgium |
Brussels
|
 |
BF |
Burkina Faso |
Ouagadougou
|
 |
BG |
Bulgaria |
Sofia
|
 |
BH |
Bahrain |
Manama
|
 |
BI |
Burundi |
Bujumbura
|
 |
BJ |
Benin |
Porto-Novo
|
 |
BL |
Saint Barthélemy |
Gustavia
|
 |
BM |
Bermuda |
Hamilton
|
 |
BN |
Brunei Darussalam |
Bandar Seri Begawan
|
 |
BO |
Bolivia (Plurinational State of) |
Sucre
|
 |
BQ |
Bonaire - Sint Eustatius and Saba |
|
 |
BR |
Brazil |
Brasilia
|
 |
BS |
Bahamas |
Nassau
|
 |
BT |
Bhutan |
Thimphu
|
 |
BV |
Bouvet Island |
|
 |
BW |
Botswana |
Gaborone
|
 |
BY |
Belarus |
Minsk
|
 |
BZ |
Belize |
Belmopan
|
 |
CA |
Canada |
Ottawa
|
 |
CC |
Cocos (Keeling) Islands |
West Island
|
 |
CD |
Democratic Republic of the Congo |
Kinshasa
|
 |
CF |
Central African Republic |
Bangui
|
 |
CG |
Congo |
Brazzaville
|
 |
CH |
Switzerland |
Bern
|
 |
CI |
Côte d'Ivoire |
Yamoussoukro
|
 |
CK |
Cook Islands |
Avarua
|
 |
CL |
Chile |
Santiago
|
 |
CM |
Cameroon |
Yaounde
|
 |
CN |
China |
Beijing
|
 |
CO |
Colombia |
Bogota
|
 |
CR |
Costa Rica |
San Jose
|
 |
CU |
Cuba |
Havana
|
 |
CV |
Cabo Verde |
Praia
|
 |
CW |
Curaçao |
Willemstad
|
 |
CX |
Christmas Island |
Flying Fish Cove
|
 |
CY |
Cyprus |
Nicosia
|
 |
CZ |
Czechia |
Prague
|
 |
DE |
Germany |
Berlin
|
 |
DJ |
Djibouti |
Djibouti
|
 |
DK |
Denmark |
Copenhagen
|
 |
DM |
Dominica |
Roseau
|
 |
DO |
Dominican Republic |
Santo Domingo
|
 |
DZ |
Algeria |
Algiers
|
 |
EC |
Ecuador |
Quito
|
 |
EE |
Estonia |
Tallinn
|
 |
EG |
Egypt |
Cairo
|
 |
EH |
Western Sahara |
El-Aaiun
|
 |
ER |
Eritrea |
Asmara
|
 |
ES |
Spain |
Madrid
|
 |
ET |
Ethiopia |
Addis Ababa
|
 |
FI |
Finland |
Helsinki
|
 |
FJ |
Fiji |
Suva
|
 |
FK |
Falkland Islands (Malvinas) |
Stanley
|
 |
FM |
Micronesia (Federated States of) |
Palikir
|
 |
FO |
Faroe Islands |
Torshavn
|
 |
FR |
France |
Paris
|
 |
GA |
Gabon |
Libreville
|
 |
GB |
United Kingdom of Great Britain and Northern Ireland |
London
|
 |
GD |
Grenada |
St. George's
|
 |
GE |
Georgia |
Tbilisi
|
 |
GF |
French Guiana |
Cayenne
|
 |
GG |
Guernsey |
St Peter Port
|
 |
GH |
Ghana |
Accra
|
 |
GI |
Gibraltar |
Gibraltar
|
 |
GL |
Greenland |
Nuuk
|
 |
GM |
Gambia |
Banjul
|
 |
GN |
Guinea |
Conakry
|
 |
GP |
Guadeloupe |
Basse-Terre
|
 |
GQ |
Equatorial Guinea |
Malabo
|
 |
GR |
Greece |
Athens
|
 |
GS |
South Georgia and the South Sandwich Islands |
Grytviken
|
 |
GT |
Guatemala |
Guatemala City
|
 |
GU |
Guam |
Hagatna
|
 |
GW |
Guinea-Bissau |
Bissau
|
 |
GY |
Guyana |
Georgetown
|
 |
HK |
China - Hong Kong Special Administrative Region |
Hong Kong
|
 |
HM |
Heard Island and McDonald Islands |
|
 |
HN |
Honduras |
Tegucigalpa
|
 |
HR |
Croatia |
Zagreb
|
 |
HT |
Haiti |
Port-au-Prince
|
 |
HU |
Hungary |
Budapest
|
 |
HULK-SMASH |
Unavailable |
Unavailable |
 |
ID |
Indonesia |
Jakarta
|
 |
IE |
Ireland |
Dublin
|
 |
IL |
Israel |
Jerusalem
|
 |
IM |
Isle of Man |
Douglas
|
 |
IN |
India |
New Delhi
|
 |
IO |
British Indian Ocean Territory |
Diego Garcia
|
 |
IQ |
Iraq |
Baghdad
|
 |
IR |
Iran (Islamic Republic of) |
Tehran
|
 |
IS |
Iceland |
Reykjavik
|
 |
IT |
Italy |
Rome
|
 |
JE |
Jersey |
Saint Helier
|
 |
JM |
Jamaica |
Kingston
|
 |
JO |
Jordan |
Amman
|
 |
JP |
Japan |
Tokyo
|
 |
KE |
Kenya |
Nairobi
|
 |
KG |
Kyrgyzstan |
Bishkek
|
 |
KH |
Cambodia |
Phnom Penh
|
 |
KI |
Kiribati |
Tarawa
|
 |
KM |
Comoros |
Moroni
|
 |
KN |
Saint Kitts and Nevis |
Basseterre
|
 |
KP |
Democratic People's Republic of Korea |
Pyongyang
|
 |
KR |
Republic of Korea |
Seoul
|
 |
KW |
Kuwait |
Kuwait City
|
 |
KY |
Cayman Islands |
George Town
|
 |
KZ |
Kazakhstan |
Astana
|
 |
LA |
Lao People's Democratic Republic |
Vientiane
|
 |
LB |
Lebanon |
Beirut
|
 |
LC |
Saint Lucia |
Castries
|
 |
LI |
Liechtenstein |
Vaduz
|
 |
LK |
Sri Lanka |
Colombo
|
 |
LR |
Liberia |
Monrovia
|
 |
LS |
Lesotho |
Maseru
|
 |
LT |
Lithuania |
Vilnius
|
 |
LU |
Luxembourg |
Luxembourg
|
 |
LV |
Latvia |
Riga
|
 |
LY |
Libya |
Tripoli
|
 |
MA |
Morocco |
Rabat
|
 |
MC |
Monaco |
Monaco
|
 |
MD |
Republic of Moldova |
Chisinau
|
 |
ME |
Montenegro |
Podgorica
|
 |
MF |
Saint Martin (French Part) |
Marigot
|
 |
MG |
Madagascar |
Antananarivo
|
 |
MH |
Marshall Islands |
Majuro
|
 |
MK |
The former Yugoslav Republic of Macedonia |
Skopje
|
 |
ML |
Mali |
Bamako
|
 |
MM |
Myanmar |
Nay Pyi Taw
|
 |
MN |
Mongolia |
Ulan Bator
|
 |
MO |
China - Macao Special Administrative Region |
Macao
|
 |
MP |
Northern Mariana Islands |
Saipan
|
 |
MQ |
Martinique |
Fort-de-France
|
 |
MR |
Mauritania |
Nouakchott
|
 |
MS |
Montserrat |
Plymouth
|
 |
MT |
Malta |
Valletta
|
 |
MU |
Mauritius |
Port Louis
|
 |
MV |
Maldives |
Male
|
 |
MW |
Malawi |
Lilongwe
|
 |
MX |
Mexico |
Mexico City
|
 |
MY |
Malaysia |
Kuala Lumpur
|
 |
MZ |
Mozambique |
Maputo
|
 |
NA |
Namibia |
Windhoek
|
 |
NC |
New Caledonia |
Noumea
|
 |
NE |
Niger |
Niamey
|
 |
NF |
Norfolk Island |
Kingston
|
 |
NG |
Nigeria |
Abuja
|
 |
NI |
Nicaragua |
Managua
|
 |
NL |
Netherlands |
Amsterdam
|
 |
NO |
Norway |
Oslo
|
 |
NP |
Nepal |
Kathmandu
|
 |
NR |
Nauru |
Yaren
|
 |
NU |
Niue |
Alofi
|
 |
NZ |
New Zealand |
Wellington
|
 |
OM |
Oman |
Muscat
|
 |
PA |
Panama |
Panama City
|
 |
PE |
Peru |
Lima
|
 |
PF |
French Polynesia |
Papeete
|
 |
PG |
Papua New Guinea |
Port Moresby
|
 |
PH |
Philippines |
Manila
|
 |
PK |
Pakistan |
Islamabad
|
 |
PL |
Poland |
Warsaw
|
 |
PM |
Saint Pierre and Miquelon |
Saint-Pierre
|
 |
PN |
Pitcairn |
Adamstown
|
 |
PR |
Puerto Rico |
San Juan
|
 |
PS |
State of Palestine |
East Jerusalem
|
 |
PT |
Portugal |
Lisbon
|
 |
PW |
Palau |
Melekeok
|
 |
PY |
Paraguay |
Asuncion
|
 |
QA |
Qatar |
Doha
|
 |
RE |
Réunion |
Saint-Denis
|
 |
RO |
Romania |
Bucharest
|
 |
RS |
Serbia |
Belgrade
|
 |
RU |
Russian Federation |
Moscow
|
 |
RW |
Rwanda |
Kigali
|
 |
SA |
Saudi Arabia |
Riyadh
|
 |
SB |
Solomon Islands |
Honiara
|
 |
SC |
Seychelles |
Victoria
|
 |
SD |
Sudan |
Khartoum
|
 |
SE |
Sweden |
Stockholm
|
 |
SG |
Singapore |
Singapore
|
 |
SH |
Saint Helena |
Jamestown
|
 |
SI |
Slovenia |
Ljubljana
|
 |
SJ |
Svalbard and Jan Mayen Islands |
Longyearbyen
|
 |
SK |
Slovakia |
Bratislava
|
 |
SL |
Sierra Leone |
Freetown
|
 |
SM |
San Marino |
San Marino
|
 |
SN |
Senegal |
Dakar
|
 |
SO |
Somalia |
Mogadishu
|
 |
SR |
Suriname |
Paramaribo
|
 |
SS |
South Sudan |
Juba
|
 |
ST |
Sao Tome and Principe |
Sao Tome
|
 |
SV |
El Salvador |
San Salvador
|
 |
SX |
Sint Maarten (Dutch part) |
Philipsburg
|
 |
SY |
Syrian Arab Republic |
Damascus
|
 |
SZ |
Eswatini |
Mbabane
|
 |
TC |
Turks and Caicos Islands |
Cockburn Town
|
 |
TD |
Chad |
N'Djamena
|
 |
TF |
French Southern Territories |
Port-aux-Francais
|
 |
TG |
Togo |
Lome
|
 |
TH |
Thailand |
Bangkok
|
 |
TJ |
Tajikistan |
Dushanbe
|
 |
TK |
Tokelau |
|
 |
TL |
Timor-Leste |
Dili
|
 |
TM |
Turkmenistan |
Ashgabat
|
 |
TN |
Tunisia |
Tunis
|
 |
TO |
Tonga |
Nuku'alofa
|
 |
TR |
Turkey |
Ankara
|
 |
TT |
Trinidad and Tobago |
Port of Spain
|
 |
TV |
Tuvalu |
Funafuti
|
 |
TW |
Taiwan (Republic of China) |
Taipei
|
 |
TZ |
United Republic of Tanzania |
Dodoma
|
 |
UA |
Ukraine |
Kyiv
|
 |
UG |
Uganda |
Kampala
|
 |
UM |
United States Minor Outlying Islands |
|
 |
US |
United States of America |
Washington
|
 |
UY |
Uruguay |
Montevideo
|
 |
UZ |
Uzbekistan |
Tashkent
|
 |
VA |
Holy See |
Vatican City
|
 |
VC |
Saint Vincent and the Grenadines |
Kingstown
|
 |
VE |
Venezuela (Bolivarian Republic of) |
Caracas
|
 |
VG |
British Virgin Islands |
Road Town
|
 |
VI |
United States Virgin Islands |
Charlotte Amalie
|
 |
VN |
Viet Nam |
Hanoi
|
 |
VU |
Vanuatu |
Port Vila
|
 |
WF |
Wallis and Futuna Islands |
Mata Utu
|
 |
WS |
Samoa |
Apia
|
 |
XK |
Unavailable |
Unavailable |
 |
YE |
Yemen |
Sanaa
|
 |
YT |
Mayotte |
Mamoudzou
|
 |
ZA |
South Africa |
Pretoria
|
 |
ZM |
Zambia |
Lusaka
|
 |
ZW |
Zimbabwe |
Harare
|
First, it uses various HTTP variables to find the browser language,
type, where you surfed from - i.e. what your IP address is (plus the referrer)
- DNS is used to lookup the hostname from the later. Note that if you are using
a web proxy (quite common in Corporate Environments), that IP address and
hostname is what will be shown/used.
It then uses the Perl Module GeoIP2 and the MaxMind database
to lookup the country and city information based on the IP address.
Note that you can enter
a domain name or IP address manually. BTW, there are more
extensive databases that will provide more precise location data, but
those cost dollars and this is meant just as quick-n-simple demo.
Javascript is used to determine all of the values from timezone on down.
BTW, the images of the flags came from the CIA Factbook web site and
here's a nifty map of the world.
Please do not Email me asking for a copy of the code or more pointers
on how to do this - use the resources mentioned above. Also, please do not
use automated scripts to access this page.