Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
EU (European Union) country codes, ISO 3166-1 alpha-2. (This Gist is from 2012. Please see comments for updates.)
# Note: VAT identification numbers for Greece use "EL", not "GR".
COUNTRY_CODES_EU = %w[
AT BE BG CY CZ DK EE FI FR DE GR HU IE IT
LV LT LU MT NL PL PT RO SK SI ES SE GB
]
@generalconsensus

This comment has been minimized.

Copy link

@generalconsensus generalconsensus commented Jun 1, 2012

Thanks for that!

@mattwynne

This comment has been minimized.

Copy link

@mattwynne mattwynne commented Mar 6, 2014

Thanks!

@josephsellers

This comment has been minimized.

Copy link

@josephsellers josephsellers commented Nov 24, 2014

I believe this is missing Croatia which joined in 2013. Their code is: HR

@hussainrmdxb

This comment has been minimized.

Copy link

@hussainrmdxb hussainrmdxb commented Jan 30, 2016

Thakyou this was helpful but you missed "Croatia" - the code is HR

here is my array in PHP
$eu_countries = array(
'AT', 'BE', 'HR', 'BG', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE',
'IT', 'LV', 'LT', 'LU', 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'GB'
);

@hussainrmdxb

This comment has been minimized.

Copy link

@hussainrmdxb hussainrmdxb commented Jan 30, 2016

COUNTRY_CODES_EU = %w[
AT BE BG HR CY CZ DK EE FI FR DE GR HU IE
IT LV LT LU MT NL PL PT RO SK SI ES SE GB
]

@makroma

This comment has been minimized.

Copy link

@makroma makroma commented Mar 3, 2016

I think this list also misses Åland islands which is autonomical part of Finland, but it´s also listed as EU member with coutrycode is AX.

@judgej

This comment has been minimized.

Copy link

@judgej judgej commented Dec 22, 2016

This is nice, a list that is immediately wrong, not in alphabetical order for easy checking, and not maintained.

Even after five years nobody has noticed that Greece is missing (EL). Somebody kill this thing, please!

Try this: https://www.gov.uk/guidance/vat-eu-country-codes-vat-numbers-and-vat-in-other-languages

@tgarnett

This comment has been minimized.

Copy link

@tgarnett tgarnett commented Mar 2, 2017

The ISO 3166-1 alpha-2 code for Greece is GR not EL (which is used by the EU VAT) as is noted (at least now) in the comment. Similarly the EU VAT uses UK instead of the ISO 3166-1 alpha-2GB for Great Britain. They are otherwise in agreement. The link above is to the EU VAT codes.

@roydejong

This comment has been minimized.

Copy link

@roydejong roydejong commented May 23, 2017

Here's a slightly more usable list using the proper ISO codes (in PHP though sorry):

$codeList = [
    "BE", "BG", "CZ", "DK", "DE", "EE", "IE", "EL", "ES", "FR", "HR", "IT", "CY",
    "LV", "LT", "LU", "HU", "MT", "NL", "AT", "PL", "PT", "RO", "SI", "SK", "FI",
    "SE", "UK"
];    

Source is http://ec.europa.eu/eurostat/statistics-explained/index.php/Glossary:Country_codes

@gitaarik

This comment has been minimized.

Copy link

@gitaarik gitaarik commented Jun 2, 2017

The list @roydejong posted doesn't use all correct ISO 3166-1 alpha-2 codes. Common mistake is "UK" for United Kingdom, the correct code is "GB" (Great Brittan). Also Greece is wrongly listed as "EL" and should be "GR".

Here is the list in JSON with ISO 3166-1 alpha-2 codes in alphabetic order:

["AT", "BE", "BG", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GB", "GR", "HR", "HU", "IE", "IT", "LT", "LU", "LV", "MT", "NL", "PL", "PT", "RO", "SE", "SI", "SK"]
@brondsem

This comment has been minimized.

Copy link

@brondsem brondsem commented Aug 31, 2017

Per https://en.wikipedia.org/wiki/Special_member_state_territories_and_the_European_Union there are additional countries/territories/regions to include as well:

"Outermost regions" that have their own ISO-1366-1 country code:

"ME",
"YT",
"RE",
"MF",
"MQ",
"GP",
"GF"

Overseas countries and territories (OCT), seem to have varying relationships with the EU, its laws, citizenship, etc. May need to analyze on a case-by-case basis depending on your use case. If you want include them:

"PM",
"GL",
"BL",
"SX",
"AW",
"CW",
"WF",
"PF",
"NC",
"TF",
"AI",
"BM",
"IO",
"VG",
"KY",
"FK",
"MS",
"PN",
"SH",
"GS",
"TC"

"Special Cases" similarly may depend on your use case:

"AX",
"JE",
"GG",
"GI"
@sumanthkumarc

This comment has been minimized.

Copy link

@sumanthkumarc sumanthkumarc commented Nov 15, 2017

Here is the list of EU countries with country codes and names in PHP. https://gist.github.com/sumanthkumarc/3204c761eaa1646f3a4fd6cb1cf99e7c

function get_eu_countries() {
$countries = [];

$countries['AT'] = ['name' => 'Austria',];
$countries['BE'] = ['name' => 'Belgium',];
$countries['BG'] = ['name' => 'Bulgaria',];
$countries['CY'] = ['name' => 'Cyprus',];
$countries['CZ'] = ['name' => 'Czech Republic',];
$countries['DE'] = ['name' => 'Germany',];
$countries['DK'] = ['name' => 'Denmark',];
$countries['EE'] = ['name' => 'Estonia',];
$countries['ES'] = ['name' => 'Spain',];
$countries['FI'] = ['name' => 'Finland',];
$countries['FR'] = ['name' => 'France',];
$countries['GB'] = ['name' => 'United Kingdom',];
$countries['GR'] = ['name' => 'Greece',];
$countries['HU'] = ['name' => 'Hungary',];
$countries['HR'] = ['name' => 'Croatia',];
$countries['IE'] = ['name' => 'Ireland, Republic of (EIRE)',];
$countries['IT'] = ['name' => 'Italy',];
$countries['LT'] = ['name' => 'Lithuania',];
$countries['LU'] = ['name' => 'Luxembourg',];
$countries['LV'] = ['name' => 'Latvia',];
$countries['MT'] = ['name' => 'Malta',];
$countries['NL'] = ['name' => 'Netherlands',];
$countries['PL'] = ['name' => 'Poland',];
$countries['PT'] = ['name' => 'Portugal',];
$countries['RO'] = ['name' => 'Romania',];
$countries['SE'] = ['name' => 'Sweden',];
$countries['SI'] = ['name' => 'Slovenia',];
$countries['SK'] = ['name' => 'Slovakia',];

return $countries;
}

@petervcook

This comment has been minimized.

Copy link

@petervcook petervcook commented Mar 30, 2018

Thanks. Here is the array in SQL Including 'HR'

WHERE geo_country IN ('AT', 'BE', 'BG', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'HR', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'GB')

@mizterp

This comment has been minimized.

Copy link

@mizterp mizterp commented Apr 18, 2018

Following is for GDPR (EU countries and EFTA States):
PHP:

//GDPR source: https://europa.eu/european-union/about-eu/countries_en#tab-0-0
//Country codes source: https://www.iso.org/obp/ui/#search
$countries_gdpr_numeric = [
    '040' =>  ['name' => 'Austria', 'alpha2' => 'AT', 'alpha3' => 'AUT'],
    '056' =>  ['name' => 'Belgium', 'alpha2' => 'BE', 'alpha3' => 'BEL'],
    '100' =>  ['name' => 'Bulgaria', 'alpha2' => 'BG', 'alpha3' => 'BGR'],
    '191' =>  ['name' => 'Croatia', 'alpha2' => 'HR', 'alpha3' => 'HRV'],
    '196' =>  ['name' => 'Cyprus', 'alpha2' => 'CY', 'alpha3' => 'CYP'],
    '203' =>  ['name' => 'Czechia', 'alpha2' => 'CZ', 'alpha3' => 'CZE'],//Czech Republic
    '208' =>  ['name' => 'Denmark', 'alpha2' => 'DK', 'alpha3' => 'DNK'],
    '233' =>  ['name' => 'Estonia', 'alpha2' => 'EE', 'alpha3' => 'EST'],
    '246' =>  ['name' => 'Finland', 'alpha2' => 'FI', 'alpha3' => 'FIN'],
    '250' =>  ['name' => 'France', 'alpha2' => 'FR', 'alpha3' => 'FRA'],
    '276' =>  ['name' => 'Germany', 'alpha2' => 'DE', 'alpha3' => 'DEU'],
    '300' =>  ['name' => 'Greece', 'alpha2' => 'GR', 'alpha3' => 'GRC'],
    '348' =>  ['name' => 'Hungary', 'alpha2' => 'HU', 'alpha3' => 'HUN'],
    '372' =>  ['name' => 'Ireland', 'alpha2' => 'IE', 'alpha3' => 'IRL'],
    '380' =>  ['name' => 'Italy', 'alpha2' => 'IT', 'alpha3' => 'ITA'],
    '428' =>  ['name' => 'Latvia', 'alpha2' => 'LV', 'alpha3' => 'LVA'],
    '440' =>  ['name' => 'Lithuania', 'alpha2' => 'LT', 'alpha3' => 'LTU'],
    '442' =>  ['name' => 'Luxembourg', 'alpha2' => 'LU', 'alpha3' => 'LUX'],
    '470' =>  ['name' => 'Malta', 'alpha2' => 'MT', 'alpha3' => 'MLT'],
    '528' =>  ['name' => 'Netherlands', 'alpha2' => 'NL', 'alpha3' => 'NLD'],
    '616' =>  ['name' => 'Poland', 'alpha2' => 'PL', 'alpha3' => 'POL'],
    '620' =>  ['name' => 'Portugal', 'alpha2' => 'PT', 'alpha3' => 'PRT'],
    '642' =>  ['name' => 'Romania', 'alpha2' => 'RO', 'alpha3' => 'ROU'],
    '703' =>  ['name' => 'Slovakia', 'alpha2' => 'SK', 'alpha3' => 'SVK'],
    '705' =>  ['name' => 'Slovenia', 'alpha2' => 'SI', 'alpha3' => 'SVN'],
    '724' =>  ['name' => 'Spain', 'alpha2' => 'ES', 'alpha3' => 'ESP'],
    '752' =>  ['name' => 'Sweden', 'alpha2' => 'SE', 'alpha3' => 'SWE'],
    '826' =>  ['name' => 'United Kingdom', 'alpha2' => 'GB', 'alpha3' => 'GBR'],
];
$countries_gdpr_alpha2 = [
    'AT'  =>  ['name' => 'Austria', 'number' => '040', 'alpha3' => 'AUT'],
    'BE'  =>  ['name' => 'Belgium', 'number' => '056', 'alpha3' => 'BEL'],
    'BG'  =>  ['name' => 'Bulgaria', 'number' => '100', 'alpha3' => 'BGR'],
    'HR'  =>  ['name' => 'Croatia', 'number' => '191', 'alpha3' => 'HRV'],
    'CY'  =>  ['name' => 'Cyprus', 'number' => '196', 'alpha3' => 'CYP'],
    'CZ'  =>  ['name' => 'Czechia', 'number' => '203', 'alpha3' => 'CZE'],//Czech Republic
    'DK'  =>  ['name' => 'Denmark', 'number' => '208', 'alpha3' => 'DNK'],
    'EE'  =>  ['name' => 'Estonia', 'number' => '233', 'alpha3' => 'EST'],
    'FI'  =>  ['name' => 'Finland', 'number' => '246', 'alpha3' => 'FIN'],
    'FR'  =>  ['name' => 'France', 'number' => '250', 'alpha3' => 'FRA'],
    'DE'  =>  ['name' => 'Germany', 'number' => '276', 'alpha3' => 'DEU'],
    'GR'  =>  ['name' => 'Greece', 'number' => '300', 'alpha3' => 'GRC'],
    'HU'  =>  ['name' => 'Hungary', 'number' => '348', 'alpha3' => 'HUN'],
    'IE'  =>  ['name' => 'Ireland', 'number' => '372', 'alpha3' => 'IRL'],
    'IT'  =>  ['name' => 'Italy', 'number' => '380', 'alpha3' => 'ITA'],
    'LV'  =>  ['name' => 'Latvia', 'number' => '428', 'alpha3' => 'LVA'],
    'LT'  =>  ['name' => 'Lithuania', 'number' => '440', 'alpha3' => 'LTU'],
    'LU'  =>  ['name' => 'Luxembourg', 'number' => '442', 'alpha3' => 'LUX'],
    'MT'  =>  ['name' => 'Malta', 'number' => '470', 'alpha3' => 'MLT'],
    'NL'  =>  ['name' => 'Netherlands', 'number' => '528', 'alpha3' => 'NLD'],
    'PL'  =>  ['name' => 'Poland', 'number' => '616', 'alpha3' => 'POL'],
    'PT'  =>  ['name' => 'Portugal', 'number' => '620', 'alpha3' => 'PRT'],
    'RO'  =>  ['name' => 'Romania', 'number' => '642', 'alpha3' => 'ROU'],
    'SK'  =>  ['name' => 'Slovakia', 'number' => '703', 'alpha3' => 'SVK'],
    'SI'  =>  ['name' => 'Slovenia', 'number' => '705', 'alpha3' => 'SVN'],
    'ES'  =>  ['name' => 'Spain', 'number' => '724', 'alpha3' => 'ESP'],
    'SE'  =>  ['name' => 'Sweden', 'number' => '752', 'alpha3' => 'SWE'],
    'GB'  =>  ['name' => 'United Kingdom', 'number' => '826', 'alpha3' => 'GBR'],
];
$countries_gdpr_alpha3 = [
    'AUT' =>  ['name' => 'Austria', 'number' => '040', 'alpha2' => 'AT'],
    'BEL' =>  ['name' => 'Belgium', 'number' => '056', 'alpha2' => 'BE'],
    'BGR' =>  ['name' => 'Bulgaria', 'number' => '100', 'alpha2' => 'BG'],
    'HRV' =>  ['name' => 'Croatia', 'number' => '191', 'alpha2' => 'HR'],
    'CYP' =>  ['name' => 'Cyprus', 'number' => '196', 'alpha2' => 'CY'],
    'CZE' =>  ['name' => 'Czechia', 'number' => '203', 'alpha2' => 'CZ'],//Czech Republic
    'DNK' =>  ['name' => 'Denmark', 'number' => '208', 'alpha2' => 'DK'],
    'EST' =>  ['name' => 'Estonia', 'number' => '233', 'alpha2' => 'EE'],
    'FIN' =>  ['name' => 'Finland', 'number' => '246', 'alpha2' => 'FI'],
    'FRA' =>  ['name' => 'France', 'number' => '250', 'alpha2' => 'FR'],
    'DEU' =>  ['name' => 'Germany', 'number' => '276', 'alpha2' => 'DE'],
    'GRC' =>  ['name' => 'Greece', 'number' => '300', 'alpha2' => 'GR'],
    'HUN' =>  ['name' => 'Hungary', 'number' => '348', 'alpha2' => 'HU'],
    'IRL' =>  ['name' => 'Ireland', 'number' => '372', 'alpha2' => 'IE'],
    'ITA' =>  ['name' => 'Italy', 'number' => '380', 'alpha2' => 'IT'],
    'LVA' =>  ['name' => 'Latvia', 'number' => '428', 'alpha2' => 'LV'],
    'LTU' =>  ['name' => 'Lithuania', 'number' => '440', 'alpha2' => 'LT'],
    'LUX' =>  ['name' => 'Luxembourg', 'number' => '442', 'alpha2' => 'LU'],
    'MLT' =>  ['name' => 'Malta', 'number' => '470', 'alpha2' => 'MT'],
    'NLD' =>  ['name' => 'Netherlands', 'number' => '528', 'alpha2' => 'NL'],
    'POL' =>  ['name' => 'Poland', 'number' => '616', 'alpha2' => 'PL'],
    'PRT' =>  ['name' => 'Portugal', 'number' => '620', 'alpha2' => 'PT'],
    'ROU' =>  ['name' => 'Romania', 'number' => '642', 'alpha2' => 'RO'],
    'SVK' =>  ['name' => 'Slovakia', 'number' => '703', 'alpha2' => 'SK'],
    'SVN' =>  ['name' => 'Slovenia', 'number' => '705', 'alpha2' => 'SI'],
    'ESP' =>  ['name' => 'Spain', 'number' => '724', 'alpha2' => 'ES'],
    'SWE' =>  ['name' => 'Sweden', 'number' => '752', 'alpha2' => 'SE'],
    'GBR' =>  ['name' => 'United Kingdom', 'number' => '826', 'alpha2' => 'GB'],
];

//EFTA States source: http://www.efta.int/about-efta/the-efta-states
$efta_states_numeric = [
    '352' =>  ['name' => 'Iceland', 'alpha2' => 'IS', 'alpha3' => 'ISL'],
    '438' =>  ['name' => 'Liechtenstein', 'alpha2' => 'LI', 'alpha3' => 'LIE'],
    '578' =>  ['name' => 'Norway', 'alpha2' => 'NO', 'alpha3' => 'NOR'],
    '756' =>  ['name' => 'Switzerland', 'alpha2' => 'CH', 'alpha3' => 'CHE'],
];
$efta_states_alpha2 = [
    'IS' =>  ['name' => 'Iceland', 'number' => '352', 'alpha3' => 'ISL'],
    'LI' =>  ['name' => 'Liechtenstein', 'number' => '438', 'alpha3' => 'LIE'],
    'NO' =>  ['name' => 'Norway', 'number' => '578', 'alpha3' => 'NOR'],
    'CH' =>  ['name' => 'Switzerland', 'number' => '756', 'alpha3' => 'CHE'],
];
$efta_states_alpha3 = [
    'ISL' =>  ['name' => 'Iceland', 'number' => '352', 'alpha2' => 'IS'],
    'LIE' =>  ['name' => 'Liechtenstein', 'number' => '438', 'alpha2' => 'LI'],
    'NOR' =>  ['name' => 'Norway', 'number' => '578', 'alpha2' => 'NO'],
    'CHE' =>  ['name' => 'Switzerland', 'number' => '756', 'alpha2' => 'CH'],
];
@tobltobs

This comment has been minimized.

Copy link

@tobltobs tobltobs commented May 16, 2018

At least for the GDPR you should also consider "VA", "SM", "MT", "MK", "MC", "FO"

@MPoorter

This comment has been minimized.

Copy link

@MPoorter MPoorter commented May 18, 2018

In case anyone would ever need them (as I just needed them) (in CSV format though, sorry):

  • A list of European countries (within and outside the EU) with their alpha-2 codes (Kosovo is only partially recognised, its country code is temporarily set to XK):
Albania,AL
Andorra,AD
Austria,AT
Azerbaijan,AZ
Belarus,BY
Belgium,BE
Bosnia and Herzegovina,BA
Bulgaria,BG
Croatia,HR
Cyprus,CY
Czech Republic,CZ
Denmark,DK
Estonia,EE
Finland,FI
France,FR
Georgia,GE
Germany,DE
Greece,GR
Hungary,HU
Iceland,IS
Ireland,IE
Italy,IT
Kazakhstan,KZ
Kosovo,XK
Latvia,LV
Liechtenstein,LI
Lithuania,LT
Luxembourg,LU
Macedonia,MK
Malta,MT
Moldova,MD
Monaco,MC
Montenegro,ME
Netherlands,NL
Norway,NO
Poland,PL
Portugal,PT
Romania,RO
Russia,RU
San Marino,SM
Serbia,RS
Slovakia,SK
Slovenia,SI
Spain,ES
Sweden,SE
Switzerland,CH
Turkey,TR
Ukraine,UA
United Kingdom,GB
Vatican City,VA
@OrderAndCh4oS

This comment has been minimized.

Copy link

@OrderAndCh4oS OrderAndCh4oS commented May 22, 2018

Has anyone got the complete list of European Union country codes? I'm trying to piece together the comments here but I'm getting a bit lost. This what I have so far.

EU 28:

AT, Austria
BE, Belgium
BG, Bulgaria
HR, Croatia
CY, Cyprus
CZ, Czech Republic
DK, Denmark
EE, Estonia
FI, Finland
FR, France
DE, Germany
GR, Greece
HU, Hungary
IE, Ireland, Republic of (EIRE)
IT, Italy
LV, Latvia
LT, Lithuania
LU, Luxembourg
MT, Malta
NL, Netherlands
PL, Poland
PT, Portugal
RO, Romania
SK, Slovakia
SI, Slovenia
ES, Spain
SE, Sweden
GB, United Kingdom (Great Britain)

Outermost Regions (OMR)
https://en.wikipedia.org/wiki/Special_member_state_territories_and_the_European_Union#Outermost_regions

GF, French Guiana
GP, Guadeloupe
MQ, Martinique
ME, Montenegro
YT, Mayotte
RE, Réunion
MF, Saint Martin

No Code, Azores
No Code, Canary Islands
No Code, Madeira

Special Cases: Part of EU
https://en.wikipedia.org/wiki/Special_member_state_territories_and_the_European_Union#Special_cases_in_Europe

GI, Gibraltar
AX, Åland Islands

No Code, Büsingen am Hochrhein
No Code, Campione d'Italia and Livigno
No Code, Ceuta and Melilla
No Code, UN Buffer Zone in Cyprus
No Code, Helgoland
No Code, Mount Athos

Overseas Countries and Territories (OCT)
https://en.wikipedia.org/wiki/Special_member_state_territories_and_the_European_Union#Overseas_countries_and_territories

PM, Saint Pierre and Miquelon
GL, Greenland
BL, Saint Bartelemey
SX, Sint Maarten
AW, Aruba
CW, Curacao
WF, Wallis and Futuna
PF, French Polynesia
NC, New Caledonia
TF, French Southern Territories
AI, Anguilla
BM, Bermuda
IO, British Indian Ocean Territory
VG, Virgin Islands, British
KY, Cayman Islands
FK, Falkland Islands (Malvinas)
MS, Montserrat
PN, Pitcairn
SH, Saint Helena
GS, South Georgia and the South Sandwich Islands
TC, Turks and Caicos Islands

Microstates
https://en.wikipedia.org/wiki/Microstates_and_the_European_Union

AD, Andorra
LI, Liechtenstein
MC, Monaco
SM, San Marino
VA, Vatican City

Other (Not sure how these fit in)
JE, Jersey
GG, Guernsey
GI, Gibraltar

@glesperance

This comment has been minimized.

Copy link

@glesperance glesperance commented May 25, 2018

Here's a JS parsable array; and some snippet to convert it into a countries = [{code, name}] collection.

const list = [
  // EU 28:
  "AT", "Austria",
  "BE", "Belgium",
  "BG", "Bulgaria",
  "HR", "Croatia",
  "CY", "Cyprus",
  "CZ", "Czech Republic",
  "DK", "Denmark",
  "EE", "Estonia",
  "FI", "Finland",
  "FR", "France",
  "DE", "Germany",
  "GR", "Greece",
  "HU", "Hungary",
  "IE", "Ireland, Republic of (EIRE)",
  "IT", "Italy",
  "LV", "Latvia",
  "LT", "Lithuania",
  "LU", "Luxembourg",
  "MT", "Malta",
  "NL", "Netherlands",
  "PL", "Poland",
  "PT", "Portugal",
  "RO", "Romania",
  "SK", "Slovakia",
  "SI", "Slovenia",
  "ES", "Spain",
  "SE", "Sweden",
  "GB", "United Kingdom (Great Britain)",

  // Outermost Regions (OMR)
  // https://en.wikipedia.org/wiki/Special_member_state_territories_and_the_European_Union#Outermost_regions
  "GF", "French Guiana",
  "GP", "Guadeloupe",
  "MQ", "Martinique",
  "ME", "Montenegro",
  "YT", "Mayotte",
  "RE", "Réunion",
  "MF", "Saint Martin",
  // No Code, Azores
  // No Code, Canary Islands
  // No Code, Madeira

  // Special Cases: Part of EU
  // https://en.wikipedia.org/wiki/Special_member_state_territories_and_the_European_Union#Special_cases_in_Europe
  "GI", "Gibraltar",
  "AX", "Åland Islands",
  // No Code, Büsingen am Hochrhein
  // No Code, Campione d'Italia and Livigno
  // No Code, Ceuta and Melilla
  // No Code, UN Buffer Zone in Cyprus
  // No Code, Helgoland
  // No Code, Mount Athos

  // Overseas Countries and Territories (OCT)
  // https://en.wikipedia.org/wiki/Special_member_state_territories_and_the_European_Union#Overseas_countries_and_territories
  "PM", "Saint Pierre and Miquelon",
  "GL", "Greenland",
  "BL", "Saint Bartelemey",
  "SX", "Sint Maarten",
  "AW", "Aruba",
  "CW", "Curacao",
  "WF", "Wallis and Futuna",
  "PF", "French Polynesia",
  "NC", "New Caledonia",
  "TF", "French Southern Territories",
  "AI", "Anguilla",
  "BM", "Bermuda",
  "IO", "British Indian Ocean Territory",
  "VG", "Virgin Islands, British",
  "KY", "Cayman Islands",
  "FK", "Falkland Islands (Malvinas)",
  "MS", "Montserrat",
  "PN", "Pitcairn",
  "SH", "Saint Helena",
  "GS", "South Georgia and the South Sandwich Islands",
  "TC", "Turks and Caicos Islands",

  // Microstates
  // https://en.wikipedia.org/wiki/Microstates_and_the_European_Union
  "AD", "Andorra",
  "LI", "Liechtenstein",
  "MC", "Monaco",
  "SM", "San Marino",
  "VA", "Vatican City",

  // Other (Not sure how these fit in)
  "JE", "Jersey",
  "GG", "Guernsey",
  "GI", "Gibraltar"
]

const countries = []
for (var i = 0; i < list.length; i +=2) countries.push({ code: list[i], name: list[i+1]})
@iamaravi

This comment has been minimized.

Copy link

@iamaravi iamaravi commented May 30, 2018

Thanks!

@bennadel

This comment has been minimized.

Copy link

@bennadel bennadel commented May 31, 2018

This was super helpful, thanks!

@jpriebe

This comment has been minimized.

Copy link

@jpriebe jpriebe commented Jun 4, 2018

Apparently, Switzerland is not subject to GDPR, as it is not an EEA state (https://planit.legal/blog/en/the-applicability-of-the-gdpr-within-the-eea/).

@nicocavallo

This comment has been minimized.

Copy link

@nicocavallo nicocavallo commented Jun 8, 2018

Same information added by @glesperance in json format:

[
  {"isoCode": "AT", "name": "Austria"},
  {"isoCode": "BE", "name": "Belgium"},
  {"isoCode": "BG", "name": "Bulgaria"},
  {"isoCode": "HR", "name": "Croatia"},
  {"isoCode": "CY", "name": "Cyprus"},
  {"isoCode": "CZ", "name": "Czech Republic"},
  {"isoCode": "DK", "name": "Denmark"},
  {"isoCode": "EE", "name": "Estonia"},
  {"isoCode": "FI", "name": "Finland"},
  {"isoCode": "FR", "name": "France"},
  {"isoCode": "DE", "name": "Germany"},
  {"isoCode": "GR", "name": "Greece"},
  {"isoCode": "HU", "name": "Hungary"},
  {"isoCode": "IE", "name": "Ireland, Republic of (EIRE)"},
  {"isoCode": "IT", "name": "Italy"},
  {"isoCode": "LV", "name": "Latvia"},
  {"isoCode": "LT", "name": "Lithuania"},
  {"isoCode": "LU", "name": "Luxembourg"},
  {"isoCode": "MT", "name": "Malta"},
  {"isoCode": "NL", "name": "Netherlands"},
  {"isoCode": "PL", "name": "Poland"},
  {"isoCode": "PT", "name": "Portugal"},
  {"isoCode": "RO", "name": "Romania"},
  {"isoCode": "SK", "name": "Slovakia"},
  {"isoCode": "SI", "name": "Slovenia"},
  {"isoCode": "ES", "name": "Spain"},
  {"isoCode": "SE", "name": "Sweden"},
  {"isoCode": "GB", "name": "United Kingdom (Great Britain)"},

  {"isoCode": "GF", "name": "French Guiana"},
  {"isoCode": "GP", "name": "Guadeloupe"},
  {"isoCode": "MQ", "name": "Martinique"},
  {"isoCode": "ME", "name": "Montenegro"},
  {"isoCode": "YT", "name": "Mayotte"},
  {"isoCode": "RE", "name": "Réunion"},
  {"isoCode": "MF", "name": "Saint Martin"},
  
  {"isoCode": "GI", "name": "Gibraltar"},
  {"isoCode": "AX", "name": "Åland Islands"},
  
  {"isoCode": "PM", "name": "Saint Pierre and Miquelon"},
  {"isoCode": "GL", "name": "Greenland"},
  {"isoCode": "BL", "name": "Saint Bartelemey"},
  {"isoCode": "SX", "name": "Sint Maarten"},
  {"isoCode": "AW", "name": "Aruba"},
  {"isoCode": "CW", "name": "Curacao"},
  {"isoCode": "WF", "name": "Wallis and Futuna"},
  {"isoCode": "PF", "name": "French Polynesia"},
  {"isoCode": "NC", "name": "New Caledonia"},
  {"isoCode": "TF", "name": "French Southern Territories"},
  {"isoCode": "AI", "name": "Anguilla"},
  {"isoCode": "BM", "name": "Bermuda"},
  {"isoCode": "IO", "name": "British Indian Ocean Territory"},
  {"isoCode": "VG", "name": "Virgin Islands, British"},
  {"isoCode": "KY", "name": "Cayman Islands"},
  {"isoCode": "FK", "name": "Falkland Islands (Malvinas)"},
  {"isoCode": "MS", "name": "Montserrat"},
  {"isoCode": "PN", "name": "Pitcairn"},
  {"isoCode": "SH", "name": "Saint Helena"},
  {"isoCode": "GS", "name": "South Georgia and the South Sandwich Islands"},
  {"isoCode": "TC", "name": "Turks and Caicos Islands"},

  {"isoCode": "AD", "name": "Andorra"},
  {"isoCode": "LI", "name": "Liechtenstein"},
  {"isoCode": "MC", "name": "Monaco"},
  {"isoCode": "SM", "name": "San Marino"},
  {"isoCode": "VA", "name": "Vatican City"},

  {"isoCode": "JE", "name": "Jersey"},
  {"isoCode": "GG", "name": "Guernsey"},
  {"isoCode": "GI", "name": "Gibraltar"}
]
@dceddia

This comment has been minimized.

Copy link

@dceddia dceddia commented Jun 8, 2018

Here's the same as @nicocavello as an object, for quick lookups by country code:

{
  "AT": {"isoCode": "AT", "name": "Austria"},
  "BE": {"isoCode": "BE", "name": "Belgium"},
  "BG": {"isoCode": "BG", "name": "Bulgaria"},
  "HR": {"isoCode": "HR", "name": "Croatia"},
  "CY": {"isoCode": "CY", "name": "Cyprus"},
  "CZ": {"isoCode": "CZ", "name": "Czech Republic"},
  "DK": {"isoCode": "DK", "name": "Denmark"},
  "EE": {"isoCode": "EE", "name": "Estonia"},
  "FI": {"isoCode": "FI", "name": "Finland"},
  "FR": {"isoCode": "FR", "name": "France"},
  "DE": {"isoCode": "DE", "name": "Germany"},
  "GR": {"isoCode": "GR", "name": "Greece"},
  "HU": {"isoCode": "HU", "name": "Hungary"},
  "IE": {"isoCode": "IE", "name": "Ireland, Republic of (EIRE)"},
  "IT": {"isoCode": "IT", "name": "Italy"},
  "LV": {"isoCode": "LV", "name": "Latvia"},
  "LT": {"isoCode": "LT", "name": "Lithuania"},
  "LU": {"isoCode": "LU", "name": "Luxembourg"},
  "MT": {"isoCode": "MT", "name": "Malta"},
  "NL": {"isoCode": "NL", "name": "Netherlands"},
  "PL": {"isoCode": "PL", "name": "Poland"},
  "PT": {"isoCode": "PT", "name": "Portugal"},
  "RO": {"isoCode": "RO", "name": "Romania"},
  "SK": {"isoCode": "SK", "name": "Slovakia"},
  "SI": {"isoCode": "SI", "name": "Slovenia"},
  "ES": {"isoCode": "ES", "name": "Spain"},
  "SE": {"isoCode": "SE", "name": "Sweden"},
  "GB": {"isoCode": "GB", "name": "United Kingdom (Great Britain)"},

  "GF": {"isoCode": "GF", "name": "French Guiana"},
  "GP": {"isoCode": "GP", "name": "Guadeloupe"},
  "MQ": {"isoCode": "MQ", "name": "Martinique"},
  "ME": {"isoCode": "ME", "name": "Montenegro"},
  "YT": {"isoCode": "YT", "name": "Mayotte"},
  "RE": {"isoCode": "RE", "name": "Réunion"},
  "MF": {"isoCode": "MF", "name": "Saint Martin"},

  "GI": {"isoCode": "GI", "name": "Gibraltar"},
  "AX": {"isoCode": "AX", "name": "Åland Islands"},

  "PM": {"isoCode": "PM", "name": "Saint Pierre and Miquelon"},
  "GL": {"isoCode": "GL", "name": "Greenland"},
  "BL": {"isoCode": "BL", "name": "Saint Bartelemey"},
  "SX": {"isoCode": "SX", "name": "Sint Maarten"},
  "AW": {"isoCode": "AW", "name": "Aruba"},
  "CW": {"isoCode": "CW", "name": "Curacao"},
  "WF": {"isoCode": "WF", "name": "Wallis and Futuna"},
  "PF": {"isoCode": "PF", "name": "French Polynesia"},
  "NC": {"isoCode": "NC", "name": "New Caledonia"},
  "TF": {"isoCode": "TF", "name": "French Southern Territories"},
  "AI": {"isoCode": "AI", "name": "Anguilla"},
  "BM": {"isoCode": "BM", "name": "Bermuda"},
  "IO": {"isoCode": "IO", "name": "British Indian Ocean Territory"},
  "VG": {"isoCode": "VG", "name": "Virgin Islands, British"},
  "KY": {"isoCode": "KY", "name": "Cayman Islands"},
  "FK": {"isoCode": "FK", "name": "Falkland Islands (Malvinas)"},
  "MS": {"isoCode": "MS", "name": "Montserrat"},
  "PN": {"isoCode": "PN", "name": "Pitcairn"},
  "SH": {"isoCode": "SH", "name": "Saint Helena"},
  "GS": {"isoCode": "GS", "name": "South Georgia and the South Sandwich Islands"},
  "TC": {"isoCode": "TC", "name": "Turks and Caicos Islands"},

  "AD": {"isoCode": "AD", "name": "Andorra"},
  "LI": {"isoCode": "LI", "name": "Liechtenstein"},
  "MC": {"isoCode": "MC", "name": "Monaco"},
  "SM": {"isoCode": "SM", "name": "San Marino"},
  "VA": {"isoCode": "VA", "name": "Vatican City"},

  "JE": {"isoCode": "JE", "name": "Jersey"},
  "GG": {"isoCode": "GG", "name": "Guernsey"},
  "GI": {"isoCode": "GI", "name": "Gibraltar"}
}
@DrLongGhost

This comment has been minimized.

Copy link

@DrLongGhost DrLongGhost commented Jun 19, 2018

For those omitting Switzerland, that's a business decision you may wish to discuss with your lawyers. Be aware that Switzerland is generally pretty in sync with the rest of Europe in things like data privacy and they are expected to come out with their own version of the GDPR in the near future. For the company I work for, we have decided to consider Switzerland as a GDPR country because there is not a compelling reason not to. Better safe than sorry is our thinking.

This is the list I'm using (the list above with Switzerland added then formatted as a compact javascript array):

const EUCountries = [ 'AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'GB', 'GF', 'GP', 'MQ', 'ME', 'YT', 'RE', 'MF', 'GI', 'AX', 'PM', 'GL', 'BL', 'SX', 'AW', 'CW', 'WF', 'PF', 'NC', 'TF', 'AI', 'BM', 'IO', 'VG', 'KY', 'FK', 'MS', 'PN', 'SH', 'GS', 'TC', 'AD', 'LI', 'MC', 'SM', 'VA', 'JE', 'GG', 'GI', 'CH', ];

@aziraphale

This comment has been minimized.

Copy link

@aziraphale aziraphale commented Aug 22, 2018

Is there a reason that no one's including the Isle of Man in these lists? There may be something that I'm missing, but I'd imagine that if we're including Jersey and Guernsey, we should also be including the Isle of Man (code IM).

@Arepo

This comment has been minimized.

Copy link

@Arepo Arepo commented Sep 21, 2018

Not sure if the OP is being updated, but if so it should have 'HR' (Croatia) before Cyprus

@jugmac00

This comment has been minimized.

@ArminCoder

This comment has been minimized.

Copy link

@ArminCoder ArminCoder commented Mar 12, 2019

Here's a list in javascript array :
const europeArray = ['AL','AD','AT','AZ','BY','BE','BA','BG','HR','CY','CZ','DK','EE','FI','FR','GE','DE','GR','HU','IS','IE', 'IT','KZ','XK','LV','LI','LT','LU','MK','MT','MD','MC','ME','NL','NO','PL','PT','RO','RU','SM','RS','SK', 'SI','ES','SE','CH','TR','UA','GB','VA' ];

@maxpelic

This comment has been minimized.

Copy link

@maxpelic maxpelic commented Apr 18, 2019

This is great! Here's a list that can be used with AMP:
["al","ad","at","az","by","be","ba","bg","hr","cy","cz","dk","ee","fi","fr","ge","de","gr","hu","is","ie", "it","kz","xk","lv","li","lt","lu","mk","mt","md","mc","me","nl","no","pl","pt","ro","ru","sm","rs","sk", "si","es","se","ch","tr","ua","gb","va"]

@KevinCuddeback

This comment has been minimized.

Copy link

@KevinCuddeback KevinCuddeback commented Apr 24, 2019

  1. Why isn't this discussion just referenceing ISO-3166 alpha-2? Is the idea that you want to be able to tell from the code whether a jurisdiction is "in" the EU?, and where, for example, "Ceuta and Melilla" == "EA"
    https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Current_codes

  2. Would including "EU" blow people's minds? I ask because I'd be using this list to identify "jurisdiction of incorporation" and the EU now allows pan-European incorporation. See:
    https://en.wikipedia.org/wiki/List_of_legal_entity_types_by_country#European_Economic_Area_(including_the_European_Union)

@AdamGerthel

This comment has been minimized.

Copy link

@AdamGerthel AdamGerthel commented Jul 3, 2019

@ArminCoder that list includes non EU countries as well, which is not what the original gist is about.

@ArminCoder

This comment has been minimized.

Copy link

@ArminCoder ArminCoder commented Jul 3, 2019

@AdamGerthel , yeah I taught it was about Europe countries, not just the ones in European Union. The array I provided are all the countries that are in Europe.

@CErika

This comment has been minimized.

Copy link

@CErika CErika commented Jul 23, 2019

Here it is the EU country on a JSON with the ISO 3166 1 alpha2
{ "Austria": "AT", "Belgium": "BE", "Bulgaria": "BG", "Croatia": "HR", "Cyprus": "CY", "Czech Republic": "CZ", "Denmark": "DK", "Estonia": "EE", "Finland":"FI", "France": "FR", "Germany": "DE", "Greece": "GR", "Hungary": "HU", "Ireland": "IE", "Italy": "IT", "Latvia": "LV", "Lithuania": "LT", "Luxembourg": "LU", "Malta": "MT", "Netherlands": "NL", "Poland": "PL", "Portugal": "PT", "Romania": "RO", "San Marino": "SM", "Slovakia": "SK", "Slovenia": "SI", "Spain": "ES", "Sweden": "SE", "United Kingdom": "GB", "Vatican City": "VA" }

@qmcree

This comment has been minimized.

Copy link

@qmcree qmcree commented Dec 3, 2019

@glesperance's list looked most complete, so here it is as a PHP array:

private const EUROPEAN_COUNTRY_CODES = [
    // -----[ EU 28 ]-----
    "AT", // Austria
    "BE", // Belgium
    "BG", // Bulgaria
    "HR", // Croatia
    "CY", // Cyprus
    "CZ", // Czech Republic
    "DK", // Denmark
    "EE", // Estonia
    "FI", // Finland
    "FR", // France
    "DE", // Germany
    "GR", // Greece
    "HU", // Hungary
    "IE", // Ireland, Republic of (EIRE)
    "IT", // Italy
    "LV", // Latvia
    "LT", // Lithuania
    "LU", // Luxembourg
    "MT", // Malta
    "NL", // Netherlands
    "PL", // Poland
    "PT", // Portugal
    "RO", // Romania
    "SK", // Slovakia
    "SI", // Slovenia
    "ES", // Spain
    "SE", // Sweden
    "GB", // United Kingdom (Great Britain)

    // -----[ Outermost Regions (OMR) ]------
    "GF", // French Guiana
    "GP", // Guadeloupe
    "MQ", // Martinique
    "ME", // Montenegro
    "YT", // Mayotte
    "RE", // Réunion
    "MF", // Saint Martin

    // -----[ Special Cases: Part of EU ]-----
    "GI", // Gibraltar
    "AX", // Åland Islands

    // -----[ Overseas Countries and Territories (OCT) ]-----
    "PM", // Saint Pierre and Miquelon
    "GL", // Greenland
    "BL", // Saint Bartelemey
    "SX", // Sint Maarten
    "AW", // Aruba
    "CW", // Curacao
    "WF", // Wallis and Futuna
    "PF", // French Polynesia
    "NC", // New Caledonia
    "TF", // French Southern Territories
    "AI", // Anguilla
    "BM", // Bermuda
    "IO", // British Indian Ocean Territory
    "VG", // Virgin Islands, British
    "KY", // Cayman Islands
    "FK", // Falkland Islands (Malvinas)
    "MS", // Montserrat
    "PN", // Pitcairn
    "SH", // Saint Helena
    "GS", // South Georgia and the South Sandwich Islands
    "TC", // Turks and Caicos Islands

    // -----[ Microstates ]-----
    "AD", // Andorra
    "LI", // Liechtenstein
    "MC", // Monaco
    "SM", // San Marino
    "VA", // Vatican City

    // -----[ Other ]-----
    "JE", // Jersey
    "GG", // Guernsey
];
@MikeWebMeridianM2

This comment has been minimized.

Copy link

@MikeWebMeridianM2 MikeWebMeridianM2 commented Dec 13, 2019

AL
AD
AT
AZ
BY
BE
BA
BG
HR
CY
CZ
DK
EE
FI
FR
GE
DE
GR
HU
IS
IE
IT
KZ
XK
LV
LI
LT
LU
MK
MT
MD
MC
ME
NL
NO
PL
PT
RO
RU
SM
RS
SK
SI
ES
SE
CH
TR
UA
GB
VA
@plpepin

This comment has been minimized.

Copy link

@plpepin plpepin commented Jan 21, 2020

Based on hussainrmdxb's post, here's one for a shortcode for example:
"AT,BE,HR,BG,CY,CZ,DK,EE,FI,FR,DE,GR,HU,IE,IT,LV,LT,LU,MT,NL,PL,PT,RO,SK,SI,ES,SE,GB"

@josuedjh3

This comment has been minimized.

Copy link

@josuedjh3 josuedjh3 commented Nov 25, 2020

class G8Countries(Countries):
    # fmt: off
    only = [
        "AT", "BE", "BG", "CY", "CZ",
        "DE", "DK", "EE", "ES", "FI",
        "FR", "GR", "HR", "HU", "IE",
        "IT", "LT", "LU", "LV", "MT",
        "NL", "PL", "PT", "RO", "SE",
        "SI", "SK"
    ]
    # fmt: on

Lista de paises de la unión europea. Espero que les sirva.

@bigghe

This comment has been minimized.

Copy link

@bigghe bigghe commented Mar 23, 2021

@glesperance's list looked most complete, so here it is as a PHP array:

private const EUROPEAN_COUNTRY_CODES = [
    // -----[ EU 28 ]-----
    "AT", // Austria
    "BE", // Belgium
    "BG", // Bulgaria
    "HR", // Croatia
    "CY", // Cyprus
    "CZ", // Czech Republic
    "DK", // Denmark
    "EE", // Estonia
    "FI", // Finland
    "FR", // France
    "DE", // Germany
    "GR", // Greece
    "HU", // Hungary
    "IE", // Ireland, Republic of (EIRE)
    "IT", // Italy
    "LV", // Latvia
    "LT", // Lithuania
    "LU", // Luxembourg
    "MT", // Malta
    "NL", // Netherlands
    "PL", // Poland
    "PT", // Portugal
    "RO", // Romania
    "SK", // Slovakia
    "SI", // Slovenia
    "ES", // Spain
    "SE", // Sweden
    "GB", // United Kingdom (Great Britain)

    // -----[ Outermost Regions (OMR) ]------
    "GF", // French Guiana
    "GP", // Guadeloupe
    "MQ", // Martinique
    "ME", // Montenegro
    "YT", // Mayotte
    "RE", // Réunion
    "MF", // Saint Martin

    // -----[ Special Cases: Part of EU ]-----
    "GI", // Gibraltar
    "AX", // Åland Islands

    // -----[ Overseas Countries and Territories (OCT) ]-----
    "PM", // Saint Pierre and Miquelon
    "GL", // Greenland
    "BL", // Saint Bartelemey
    "SX", // Sint Maarten
    "AW", // Aruba
    "CW", // Curacao
    "WF", // Wallis and Futuna
    "PF", // French Polynesia
    "NC", // New Caledonia
    "TF", // French Southern Territories
    "AI", // Anguilla
    "BM", // Bermuda
    "IO", // British Indian Ocean Territory
    "VG", // Virgin Islands, British
    "KY", // Cayman Islands
    "FK", // Falkland Islands (Malvinas)
    "MS", // Montserrat
    "PN", // Pitcairn
    "SH", // Saint Helena
    "GS", // South Georgia and the South Sandwich Islands
    "TC", // Turks and Caicos Islands

    // -----[ Microstates ]-----
    "AD", // Andorra
    "LI", // Liechtenstein
    "MC", // Monaco
    "SM", // San Marino
    "VA", // Vatican City

    // -----[ Other ]-----
    "JE", // Jersey
    "GG", // Guernsey
];

Hi guys,

thanks @henrik for this and everyone that contribute.
Same list from @qmcree but in a yaml list format (with no indent):

- FI
- FR
- DE
- GR
- HU
- IE
- IT
- LV
- LT
- LU
- MT
- NL
- PL
- PT
- RO
- SK
- SI
- ES
- SE
- GB
- GF
- GP
- MQ
- ME
- YT
- RE
- MF
- GI
- AX
- PM
- GL
- BL
- SX
- AW
- CW
- WF
- PF
- NC
- TF
- AI
- BM
- IO
- VG
- KY
- FK
- MS
- PN
- SH
- GS
- TC
- AD
- LI
- MC
- SM
- VA
- JE
- GG
@plpepin

This comment has been minimized.

Copy link

@plpepin plpepin commented Mar 24, 2021

A drop-down in Liquid

{%- capture cntriesList -%}
Austria:AT,Belgium:BE,Bulgaria:BG,Croatia:HR,Cyprus:CY,Czech Republic:CZ,Denmark:DK,Estonia:EE,Finland:FI,France:FR,Germany:DE,Greece:GR,Hungary:HU,Ireland:IE,Italy:IT,Latvia:LV,Lithuania:LT,Luxembourg:LU,Malta:MT,Netherlands:NL,Poland:PL,Portugal:PT,Romania:RO,San Marino:SM,Slovakia:SK,Slovenia:SI,Spain:ES,Sweden:SE,United Kingdom:GB,Vatican City:VA
{%- endcapture -%}

{% assign countries = cntriesList | split: ',' %}

-- select html tag open --
{% for country in countries %}
{% assign cntryName = country | split: ':' | first %}
{% assign cntryCode = country | split: ':' | last %}
-- option name="{{ cntryCode }}">{{ cntryName }} --
{% endfor %}
-- select html tag close --

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