Skip to content

Instantly share code, notes, and snippets.

@jasonbyrne
Last active August 20, 2023 00:29
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jasonbyrne/db6a7e25a1b8a552d22d3602f319fe15 to your computer and use it in GitHub Desktop.
Three character country code to country name object for JavaScript
const countriesArray = [
{ name: "Aruba", value: "ABW" },
{ name: "Afghanistan", value: "AFG" },
{ name: "Angola", value: "AGO" },
{ name: "Anguilla", value: "AIA" },
{ name: "Åland Islands", value: "ALA" },
{ name: "Albania", value: "ALB" },
{ name: "Andorra", value: "AND" },
{ name: "Netherlands Antilles", value: "ANT" },
{ name: "United Arab Emirates", value: "ARE" },
{ name: "Argentina", value: "ARG" },
{ name: "Armenia", value: "ARM" },
{ name: "American Samoa", value: "ASM" },
{ name: "Antarctica", value: "ATA" },
{ name: "French Southern Territories", value: "ATF" },
{ name: "Antigua and Barbuda", value: "ATG" },
{ name: "Australia", value: "AUS" },
{ name: "Austria", value: "AUT" },
{ name: "Azerbaijan", value: "AZE" },
{ name: "Burundi", value: "BDI" },
{ name: "Belgium", value: "BEL" },
{ name: "Benin", value: "BEN" },
{ name: "Burkina Faso", value: "BFA" },
{ name: "Bangladesh", value: "BGD" },
{ name: "Bulgaria", value: "BGR" },
{ name: "Bahrain", value: "BHR" },
{ name: "Bahamas", value: "BHS" },
{ name: "Bosnia and Herzegovina", value: "BIH" },
{ name: "Saint Barthélemy", value: "BLM" },
{ name: "Belarus", value: "BLR" },
{ name: "Belize", value: "BLZ" },
{ name: "Bermuda", value: "BMU" },
{ name: "Bolivia, Plurinational State of", value: "BOL" },
{ name: "Brazil", value: "BRA" },
{ name: "Barbados", value: "BRB" },
{ name: "Brunei Darussalam", value: "BRN" },
{ name: "Bhutan", value: "BTN" },
{ name: "Bouvet Island", value: "BVT" },
{ name: "Botswana", value: "BWA" },
{ name: "Central African Republic", value: "CAF" },
{ name: "Canada", value: "CAN" },
{ name: "Cocos (Keeling) Islands", value: "CCK" },
{ name: "Switzerland", value: "CHE" },
{ name: "Chile", value: "CHL" },
{ name: "China", value: "CHN" },
{ name: "Côte d'Ivoire", value: "CIV" },
{ name: "Cameroon", value: "CMR" },
{ name: "Congo, the Democratic Republic of the", value: "COD" },
{ name: "Congo", value: "COG" },
{ name: "Cook Islands", value: "COK" },
{ name: "Colombia", value: "COL" },
{ name: "Comoros", value: "COM" },
{ name: "Cape Verde", value: "CPV" },
{ name: "Costa Rica", value: "CRI" },
{ name: "Cuba", value: "CUB" },
{ name: "Christmas Island", value: "CXR" },
{ name: "Cayman Islands", value: "CYM" },
{ name: "Cyprus", value: "CYP" },
{ name: "Czech Republic", value: "CZE" },
{ name: "Germany", value: "DEU" },
{ name: "Djibouti", value: "DJI" },
{ name: "Dominica", value: "DMA" },
{ name: "Denmark", value: "DNK" },
{ name: "Dominican Republic", value: "DOM" },
{ name: "Algeria", value: "DZA" },
{ name: "Ecuador", value: "ECU" },
{ name: "Egypt", value: "EGY" },
{ name: "Eritrea", value: "ERI" },
{ name: "Western Sahara", value: "ESH" },
{ name: "Spain", value: "ESP" },
{ name: "Estonia", value: "EST" },
{ name: "Ethiopia", value: "ETH" },
{ name: "Finland", value: "FIN" },
{ name: "Fiji", value: "FJI" },
{ name: "Falkland Islands (Malvinas)", value: "FLK" },
{ name: "France", value: "FRA" },
{ name: "Faroe Islands", value: "FRO" },
{ name: "Micronesia, Federated States of", value: "FSM" },
{ name: "Gabon", value: "GAB" },
{ name: "United Kingdom", value: "GBR" },
{ name: "Georgia", value: "GEO" },
{ name: "Guernsey", value: "GGY" },
{ name: "Ghana", value: "GHA" },
{ name: "Gibraltar", value: "GIB" },
{ name: "Guinea", value: "GIN" },
{ name: "Guadeloupe", value: "GLP" },
{ name: "Gambia", value: "GMB" },
{ name: "Guinea-Bissau", value: "GNB" },
{ name: "Equatorial Guinea", value: "GNQ" },
{ name: "Greece", value: "GRC" },
{ name: "Grenada", value: "GRD" },
{ name: "Greenland", value: "GRL" },
{ name: "Guatemala", value: "GTM" },
{ name: "French Guiana", value: "GUF" },
{ name: "Guam", value: "GUM" },
{ name: "Guyana", value: "GUY" },
{ name: "Hong Kong", value: "HKG" },
{ name: "Heard Island and McDonald Islands", value: "HMD" },
{ name: "Honduras", value: "HND" },
{ name: "Croatia", value: "HRV" },
{ name: "Haiti", value: "HTI" },
{ name: "Hungary", value: "HUN" },
{ name: "Indonesia", value: "IDN" },
{ name: "Isle of Man", value: "IMN" },
{ name: "India", value: "IND" },
{ name: "British Indian Ocean Territory", value: "IOT" },
{ name: "Ireland", value: "IRL" },
{ name: "Iran, Islamic Republic of", value: "IRN" },
{ name: "Iraq", value: "IRQ" },
{ name: "Iceland", value: "ISL" },
{ name: "Israel", value: "ISR" },
{ name: "Italy", value: "ITA" },
{ name: "Jamaica", value: "JAM" },
{ name: "Jersey", value: "JEY" },
{ name: "Jordan", value: "JOR" },
{ name: "Japan", value: "JPN" },
{ name: "Kazakhstan", value: "KAZ" },
{ name: "Kenya", value: "KEN" },
{ name: "Kyrgyzstan", value: "KGZ" },
{ name: "Cambodia", value: "KHM" },
{ name: "Kiribati", value: "KIR" },
{ name: "Saint Kitts and Nevis", value: "KNA" },
{ name: "Korea, Republic of", value: "KOR" },
{ name: "Kuwait", value: "KWT" },
{ name: "Lao People's Democratic Republic", value: "LAO" },
{ name: "Lebanon", value: "LBN" },
{ name: "Liberia", value: "LBR" },
{ name: "Libyan Arab Jamahiriya", value: "LBY" },
{ name: "Saint Lucia", value: "LCA" },
{ name: "Liechtenstein", value: "LIE" },
{ name: "Sri Lanka", value: "LKA" },
{ name: "Lesotho", value: "LSO" },
{ name: "Lithuania", value: "LTU" },
{ name: "Luxembourg", value: "LUX" },
{ name: "Latvia", value: "LVA" },
{ name: "Macao", value: "MAC" },
{ name: "Saint Martin (French part)", value: "MAF" },
{ name: "Morocco", value: "MAR" },
{ name: "Monaco", value: "MCO" },
{ name: "Moldova, Republic of", value: "MDA" },
{ name: "Madagascar", value: "MDG" },
{ name: "Maldives", value: "MDV" },
{ name: "Mexico", value: "MEX" },
{ name: "Marshall Islands", value: "MHL" },
{ name: "Macedonia, the former Yugoslav Republic of", value: "MKD" },
{ name: "Mali", value: "MLI" },
{ name: "Malta", value: "MLT" },
{ name: "Myanmar", value: "MMR" },
{ name: "Montenegro", value: "MNE" },
{ name: "Mongolia", value: "MNG" },
{ name: "Northern Mariana Islands", value: "MNP" },
{ name: "Mozambique", value: "MOZ" },
{ name: "Mauritania", value: "MRT" },
{ name: "Montserrat", value: "MSR" },
{ name: "Martinique", value: "MTQ" },
{ name: "Mauritius", value: "MUS" },
{ name: "Malawi", value: "MWI" },
{ name: "Malaysia", value: "MYS" },
{ name: "Mayotte", value: "MYT" },
{ name: "Namibia", value: "NAM" },
{ name: "New Caledonia", value: "NCL" },
{ name: "Niger", value: "NER" },
{ name: "Norfolk Island", value: "NFK" },
{ name: "Nigeria", value: "NGA" },
{ name: "Nicaragua", value: "NIC" },
{ name: "Niue", value: "NIU" },
{ name: "Netherlands", value: "NLD" },
{ name: "Norway", value: "NOR" },
{ name: "Nepal", value: "NPL" },
{ name: "Nauru", value: "NRU" },
{ name: "New Zealand", value: "NZL" },
{ name: "Oman", value: "OMN" },
{ name: "Pakistan", value: "PAK" },
{ name: "Panama", value: "PAN" },
{ name: "Pitcairn", value: "PCN" },
{ name: "Peru", value: "PER" },
{ name: "Philippines", value: "PHL" },
{ name: "Palau", value: "PLW" },
{ name: "Papua New Guinea", value: "PNG" },
{ name: "Poland", value: "POL" },
{ name: "Puerto Rico", value: "PRI" },
{ name: "Korea, Democratic People's Republic of", value: "PRK" },
{ name: "Portugal", value: "PRT" },
{ name: "Paraguay", value: "PRY" },
{ name: "Palestinian Territory, Occupied", value: "PSE" },
{ name: "French Polynesia", value: "PYF" },
{ name: "Qatar", value: "QAT" },
{ name: "Réunion", value: "REU" },
{ name: "Romania", value: "ROU" },
{ name: "Russian Federation", value: "RUS" },
{ name: "Rwanda", value: "RWA" },
{ name: "Saudi Arabia", value: "SAU" },
{ name: "Sudan", value: "SDN" },
{ name: "Senegal", value: "SEN" },
{ name: "Singapore", value: "SGP" },
{ name: "South Georgia and the South Sandwich Islands", value: "SGS" },
{ name: "Saint Helena, Ascension and Tristan da Cunha", value: "SHN" },
{ name: "Svalbard and Jan Mayen", value: "SJM" },
{ name: "Solomon Islands", value: "SLB" },
{ name: "Sierra Leone", value: "SLE" },
{ name: "El Salvador", value: "SLV" },
{ name: "San Marino", value: "SMR" },
{ name: "Somalia", value: "SOM" },
{ name: "Saint Pierre and Miquelon", value: "SPM" },
{ name: "Serbia", value: "SRB" },
{ name: "Sao Tome and Principe", value: "STP" },
{ name: "Suriname", value: "SUR" },
{ name: "Slovakia", value: "SVK" },
{ name: "Slovenia", value: "SVN" },
{ name: "Sweden", value: "SWE" },
{ name: "Swaziland", value: "SWZ" },
{ name: "Seychelles", value: "SYC" },
{ name: "Syrian Arab Republic", value: "SYR" },
{ name: "Turks and Caicos Islands", value: "TCA" },
{ name: "Chad", value: "TCD" },
{ name: "Togo", value: "TGO" },
{ name: "Thailand", value: "THA" },
{ name: "Tajikistan", value: "TJK" },
{ name: "Tokelau", value: "TKL" },
{ name: "Turkmenistan", value: "TKM" },
{ name: "Timor-Leste", value: "TLS" },
{ name: "Tonga", value: "TON" },
{ name: "Trinidad and Tobago", value: "TTO" },
{ name: "Tunisia", value: "TUN" },
{ name: "Turkey", value: "TUR" },
{ name: "Tuvalu", value: "TUV" },
{ name: "Taiwan, Province of China", value: "TWN" },
{ name: "Tanzania, United Republic of", value: "TZA" },
{ name: "Uganda", value: "UGA" },
{ name: "Ukraine", value: "UKR" },
{ name: "United States Minor Outlying Islands", value: "UMI" },
{ name: "Uruguay", value: "URY" },
{ name: "United States", value: "USA" },
{ name: "Uzbekistan", value: "UZB" },
{ name: "Holy See (Vatican City State)", value: "VAT" },
{ name: "Saint Vincent and the Grenadines", value: "VCT" },
{ name: "Venezuela, Bolivarian Republic of", value: "VEN" },
{ name: "Virgin Islands, British", value: "VGB" },
{ name: "Virgin Islands, U.S.", value: "VIR" },
{ name: "Viet Nam", value: "VNM" },
{ name: "Vanuatu", value: "VUT" },
{ name: "Wallis and Futuna", value: "WLF" },
{ name: "Samoa", value: "WSM" },
{ name: "Yemen", value: "YEM" },
{ name: "South Africa", value: "ZAF" },
{ name: "Zambia", value: "ZMB" },
{ name: "Zimbabwe", value: "ZWE" }
];
{
"ABW": "Aruba",
"AFG": "Afghanistan",
"AGO": "Angola",
"AIA": "Anguilla",
"ALA": "Åland Islands",
"ALB": "Albania",
"AND": "Andorra",
"ANT": "Netherlands Antilles",
"ARE": "United Arab Emirates",
"ARG": "Argentina",
"ARM": "Armenia",
"ASM": "American Samoa",
"ATA": "Antarctica",
"ATF": "French Southern Territories",
"ATG": "Antigua and Barbuda",
"AUS": "Australia",
"AUT": "Austria",
"AZE": "Azerbaijan",
"BDI": "Burundi",
"BEL": "Belgium",
"BEN": "Benin",
"BFA": "Burkina Faso",
"BGD": "Bangladesh",
"BGR": "Bulgaria",
"BHR": "Bahrain",
"BHS": "Bahamas",
"BIH": "Bosnia and Herzegovina",
"BLM": "Saint Barthélemy",
"BLR": "Belarus",
"BLZ": "Belize",
"BMU": "Bermuda",
"BOL": "Bolivia, Plurinational State of",
"BRA": "Brazil",
"BRB": "Barbados",
"BRN": "Brunei Darussalam",
"BTN": "Bhutan",
"BVT": "Bouvet Island",
"BWA": "Botswana",
"CAF": "Central African Republic",
"CAN": "Canada",
"CCK": "Cocos (Keeling) Islands",
"CHE": "Switzerland",
"CHL": "Chile",
"CHN": "China",
"CIV": "Côte d'Ivoire",
"CMR": "Cameroon",
"COD": "Congo, the Democratic Republic of the",
"COG": "Congo",
"COK": "Cook Islands",
"COL": "Colombia",
"COM": "Comoros",
"CPV": "Cape Verde",
"CRI": "Costa Rica",
"CUB": "Cuba",
"CXR": "Christmas Island",
"CYM": "Cayman Islands",
"CYP": "Cyprus",
"CZE": "Czech Republic",
"DEU": "Germany",
"DJI": "Djibouti",
"DMA": "Dominica",
"DNK": "Denmark",
"DOM": "Dominican Republic",
"DZA": "Algeria",
"ECU": "Ecuador",
"EGY": "Egypt",
"ERI": "Eritrea",
"ESH": "Western Sahara",
"ESP": "Spain",
"EST": "Estonia",
"ETH": "Ethiopia",
"FIN": "Finland",
"FJI": "Fiji",
"FLK": "Falkland Islands (Malvinas)",
"FRA": "France",
"FRO": "Faroe Islands",
"FSM": "Micronesia, Federated States of",
"GAB": "Gabon",
"GBR": "United Kingdom",
"GEO": "Georgia",
"GGY": "Guernsey",
"GHA": "Ghana",
"GIB": "Gibraltar",
"GIN": "Guinea",
"GLP": "Guadeloupe",
"GMB": "Gambia",
"GNB": "Guinea-Bissau",
"GNQ": "Equatorial Guinea",
"GRC": "Greece",
"GRD": "Grenada",
"GRL": "Greenland",
"GTM": "Guatemala",
"GUF": "French Guiana",
"GUM": "Guam",
"GUY": "Guyana",
"HKG": "Hong Kong",
"HMD": "Heard Island and McDonald Islands",
"HND": "Honduras",
"HRV": "Croatia",
"HTI": "Haiti",
"HUN": "Hungary",
"IDN": "Indonesia",
"IMN": "Isle of Man",
"IND": "India",
"IOT": "British Indian Ocean Territory",
"IRL": "Ireland",
"IRN": "Iran, Islamic Republic of",
"IRQ": "Iraq",
"ISL": "Iceland",
"ISR": "Israel",
"ITA": "Italy",
"JAM": "Jamaica",
"JEY": "Jersey",
"JOR": "Jordan",
"JPN": "Japan",
"KAZ": "Kazakhstan",
"KEN": "Kenya",
"KGZ": "Kyrgyzstan",
"KHM": "Cambodia",
"KIR": "Kiribati",
"KNA": "Saint Kitts and Nevis",
"KOR": "Korea, Republic of",
"KWT": "Kuwait",
"LAO": "Lao People's Democratic Republic",
"LBN": "Lebanon",
"LBR": "Liberia",
"LBY": "Libyan Arab Jamahiriya",
"LCA": "Saint Lucia",
"LIE": "Liechtenstein",
"LKA": "Sri Lanka",
"LSO": "Lesotho",
"LTU": "Lithuania",
"LUX": "Luxembourg",
"LVA": "Latvia",
"MAC": "Macao",
"MAF": "Saint Martin (French part)",
"MAR": "Morocco",
"MCO": "Monaco",
"MDA": "Moldova, Republic of",
"MDG": "Madagascar",
"MDV": "Maldives",
"MEX": "Mexico",
"MHL": "Marshall Islands",
"MKD": "Macedonia, the former Yugoslav Republic of",
"MLI": "Mali",
"MLT": "Malta",
"MMR": "Myanmar",
"MNE": "Montenegro",
"MNG": "Mongolia",
"MNP": "Northern Mariana Islands",
"MOZ": "Mozambique",
"MRT": "Mauritania",
"MSR": "Montserrat",
"MTQ": "Martinique",
"MUS": "Mauritius",
"MWI": "Malawi",
"MYS": "Malaysia",
"MYT": "Mayotte",
"NAM": "Namibia",
"NCL": "New Caledonia",
"NER": "Niger",
"NFK": "Norfolk Island",
"NGA": "Nigeria",
"NIC": "Nicaragua",
"NIU": "Niue",
"NLD": "Netherlands",
"NOR": "Norway",
"NPL": "Nepal",
"NRU": "Nauru",
"NZL": "New Zealand",
"OMN": "Oman",
"PAK": "Pakistan",
"PAN": "Panama",
"PCN": "Pitcairn",
"PER": "Peru",
"PHL": "Philippines",
"PLW": "Palau",
"PNG": "Papua New Guinea",
"POL": "Poland",
"PRI": "Puerto Rico",
"PRK": "Korea, Democratic People's Republic of",
"PRT": "Portugal",
"PRY": "Paraguay",
"PSE": "Palestinian Territory, Occupied",
"PYF": "French Polynesia",
"QAT": "Qatar",
"REU": "Réunion",
"ROU": "Romania",
"RUS": "Russian Federation",
"RWA": "Rwanda",
"SAU": "Saudi Arabia",
"SDN": "Sudan",
"SEN": "Senegal",
"SGP": "Singapore",
"SGS": "South Georgia and the South Sandwich Islands",
"SHN": "Saint Helena, Ascension and Tristan da Cunha",
"SJM": "Svalbard and Jan Mayen",
"SLB": "Solomon Islands",
"SLE": "Sierra Leone",
"SLV": "El Salvador",
"SMR": "San Marino",
"SOM": "Somalia",
"SPM": "Saint Pierre and Miquelon",
"SRB": "Serbia",
"STP": "Sao Tome and Principe",
"SUR": "Suriname",
"SVK": "Slovakia",
"SVN": "Slovenia",
"SWE": "Sweden",
"SWZ": "Swaziland",
"SYC": "Seychelles",
"SYR": "Syrian Arab Republic",
"TCA": "Turks and Caicos Islands",
"TCD": "Chad",
"TGO": "Togo",
"THA": "Thailand",
"TJK": "Tajikistan",
"TKL": "Tokelau",
"TKM": "Turkmenistan",
"TLS": "Timor-Leste",
"TON": "Tonga",
"TTO": "Trinidad and Tobago",
"TUN": "Tunisia",
"TUR": "Turkey",
"TUV": "Tuvalu",
"TWN": "Taiwan, Province of China",
"TZA": "Tanzania, United Republic of",
"UGA": "Uganda",
"UKR": "Ukraine",
"UMI": "United States Minor Outlying Islands",
"URY": "Uruguay",
"USA": "United States",
"UZB": "Uzbekistan",
"VAT": "Holy See (Vatican City State)",
"VCT": "Saint Vincent and the Grenadines",
"VEN": "Venezuela, Bolivarian Republic of",
"VGB": "Virgin Islands, British",
"VIR": "Virgin Islands, U.S.",
"VNM": "Viet Nam",
"VUT": "Vanuatu",
"WLF": "Wallis and Futuna",
"WSM": "Samoa",
"YEM": "Yemen",
"ZAF": "South Africa",
"ZMB": "Zambia",
"ZWE": "Zimbabwe"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment