Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Two letter country code mapping, grouped by continent/region
{
"europe": {
"va": "vatican city",
"ch": "switzerland",
"ad": "andorra",
"ee": "estonia",
"is": "iceland",
"am": "armenia",
"al": "albania",
"cz": "czech republic",
"ge": "georgia",
"at": "austria",
"ie": "ireland",
"gi": "gibraltar",
"gr": "greece",
"nl": "netherlands",
"pt": "portugal",
"no": "norway",
"lv": "latvia",
"lt": "lithuania",
"lu": "luxembourg",
"es": "spain",
"it": "italy",
"ro": "romania",
"pl": "poland",
"be": "belgium",
"fr": "france",
"bg": "bulgaria",
"dk": "denmark",
"hr": "croatia",
"de": "germany",
"hu": "hungary",
"ba": "bosnia/herzegovina",
"fi": "finland",
"by": "belarus",
"fo": "faeroe islands",
"mc": "monaco",
"cy": "cyprus",
"mk": "macedonia",
"sk": "slovakia",
"mt": "malta",
"si": "slovenia",
"sm": "san marino",
"se": "sweden",
"gb": "united kingdom"
},
"oceania": {
"ck": "cook islands",
"pw": "palau",
"tv": "tuvalu",
"na": "nauru",
"ki": "kiribati",
"mh": "marshall islands",
"nu": "niue",
"to": "tonga",
"nz": "new zealand",
"au": "australia",
"vu": "vanuatu",
"sb": "solomon islands",
"ws": "samoa",
"fj": "fiji",
"fm": "micronesia"
},
"africa": {
"gw": "guinea-bissau",
"zm": "zambia",
"ci": "ivory coast",
"eh": "western sahara",
"gq": "equatorial guinea",
"eg": "egypt",
"cg": "congo",
"cf": "central african republic",
"ao": "angola",
"ga": "gabon",
"et": "ethiopia",
"gn": "guinea",
"gm": "gambia",
"zw": "zimbabwe",
"cv": "cape verde",
"gh": "ghana",
"rw": "rwanda",
"tz": "tanzania",
"cm": "cameroon",
"na": "namibia",
"ne": "niger",
"ng": "nigeria",
"tn": "tunisia",
"lr": "liberia",
"ls": "lesotho",
"tg": "togo",
"td": "chad",
"er": "eritrea",
"ly": "libya",
"bf": "burkina faso",
"dj": "djibouti",
"sl": "sierra leone",
"bi": "burundi",
"bj": "benin",
"za": "south africa",
"bw": "botswana",
"dz": "algeria",
"sz": "swaziland",
"mg": "madagascar",
"ma": "morocco",
"ke": "kenya",
"ml": "mali",
"km": "comoros",
"st": "sao tome and principe",
"mu": "mauritius",
"mw": "malawi",
"so": "somalia",
"sn": "senegal",
"mr": "mauritania",
"sc": "seychelles",
"ug": "uganda",
"sd": "sudan",
"mz": "mozambique"
},
"asia": {
"mn": "mongolia",
"cn": "china",
"af": "afghanistan",
"am": "armenia",
"vn": "vietnam",
"ge": "georgia",
"in": "india",
"az": "azerbaijan",
"id": "indonesia",
"ru": "russia",
"la": "laos",
"tw": "taiwan",
"tr": "turkey",
"lk": "sri lanka",
"tm": "turkmenistan",
"tj": "tajikistan",
"pg": "papua new guinea",
"th": "thailand",
"np": "nepal",
"pk": "pakistan",
"ph": "philippines",
"bd": "bangladesh",
"ua": "ukraine",
"bn": "brunei",
"jp": "japan",
"bt": "bhutan",
"hk": "hong kong",
"kg": "kyrgyzstan",
"uz": "uzbekistan",
"mm": "burma (myanmar)",
"sg": "singapore",
"mo": "macau",
"kh": "cambodia",
"kr": "korea",
"mv": "maldives",
"kz": "kazakhstan",
"my": "malaysia"
},
"north america": {
"gt": "guatemala",
"ag": "antigua and barbuda",
"vg": "british virgin islands (uk)",
"ai": "anguilla (uk)",
"vi": "virgin island",
"ca": "canada",
"gd": "grenada",
"aw": "aruba (netherlands)",
"cr": "costa rica",
"cu": "cuba",
"pr": "puerto rico (us)",
"ni": "nicaragua",
"tt": "trinidad and tobago",
"gp": "guadeloupe (france)",
"pa": "panama",
"do": "dominican republic",
"dm": "dominica",
"bb": "barbados",
"ht": "haiti",
"jm": "jamaica",
"hn": "honduras",
"bs": "bahamas, the",
"bz": "belize",
"sx": "saint kitts and nevis",
"sv": "el salvador",
"us": "united states",
"mq": "martinique (france)",
"ms": "monsterrat (uk)",
"ky": "cayman islands (uk)",
"mx": "mexico"
},
"south america": {
"gd": "south georgia",
"py": "paraguay",
"co": "colombia",
"ve": "venezuela",
"cl": "chile",
"sr": "suriname",
"bo": "bolivia",
"ec": "ecuador",
"gf": "french guiana",
"ar": "argentina",
"gy": "guyana",
"br": "brazil",
"pe": "peru",
"uy": "uruguay",
"fk": "falkland islands"
},
"middle east": {
"om": "oman",
"lb": "lebanon",
"iq": "iraq",
"ye": "yemen",
"ir": "iran",
"bh": "bahrain",
"sy": "syria",
"qa": "qatar",
"jo": "jordan",
"kw": "kuwait",
"il": "israel",
"ae": "united arab emirates",
"sa": "saudi arabia"
}
}
@damienbenon
Copy link

damienbenon commented Sep 12, 2018

Thanks man you saved me some time 👍 !!

@sikaili99
Copy link

sikaili99 commented Jan 4, 2021

This saved me lots of time, thank you 👍!

@hartleybrody
Copy link

hartleybrody commented Dec 24, 2021

Great list! One issue though, I've never seen "The Middle East" broken out as its own continent (ex on wikipedia), so I copied those countries into Asia.

@Itamal
Copy link

Itamal commented Jan 20, 2022

@hartleybrody Many times in business applications it's considered a unique region (sometimes MENA - Middle East & North Africa is used as well)

@Jamie0
Copy link

Jamie0 commented Jan 24, 2022

This is fantastic! I've noticed the country code for Nauru is wrong: it should be NR, not NA (which is Namibia)

@equalls
Copy link

equalls commented Mar 24, 2022

Since when has Ukraine been in Asia?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment