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
]
@mizterp
Copy link

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
Copy link

tobltobs commented May 16, 2018

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

@MPoorter
Copy link

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
Copy link

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
Copy link

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
Copy link

iamaravi commented May 30, 2018

Thanks!

@bennadel
Copy link

bennadel commented May 31, 2018

This was super helpful, thanks!

@jpriebe
Copy link

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
Copy link

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
Copy link

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"}
}

@dan24678
Copy link

dan24678 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
Copy link

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
Copy link

Arepo commented Sep 21, 2018

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

@jugmac00
Copy link

jugmac00 commented Jan 16, 2019

@ArminCoder
Copy link

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
Copy link

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
Copy link

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
Copy link

AdamGerthel commented Jul 3, 2019

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

@ArminCoder
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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 --

@panoply
Copy link

panoply commented Sep 28, 2021

For those getting here are writing JavaScript/TypeScript. Leverage Set for validating EU member nations by country code, eg:

const EU = new Set([
  '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',
])

const isEU = (code: string): boolean => EU.has(code)

This is the cleanest way to do this. I have seen developers reach for iteration for matches, try not to do this, as a pre-populated Set will suffice nicely and comes at little cost. For some additional helper utils (which might of use to you all) we open sourced a couple little modules, for dealing with i18n aspects that somewhat pertain to this nexus:

Country code to currency code mappings:

Country code to country name (English) mappings:

Hope it helps! Happy coding.

@bradydan
Copy link

bradydan commented Oct 19, 2021

@bigghe @plpepin @panoply the UK (GB) is no longer in the EU, sadly. So your lists are not correct.

The list of EU countries is here courtesy of Eurostat, the "statistical office of the European Union"

Also, note that the European Commission does not always use ISO 3166-1 alpha-2 codes, including at the Eurostat link above. As explained on Wikipedia:

The European Commission generally uses ISO 3166-1 alpha-2 codes with two exceptions: EL (not GR) is used to represent Greece, and UK (not GB) is used to represent the United Kingdom.[10] This notwithstanding, the Official Journal of the European Communities specified that GR and GB be used to represent Greece and United Kingdom respectively.[11] For VAT administration purposes, the European Commission uses EL and GB for Greece and the United Kingdom respectively.

So, depending on your use case, you may need to amend and extend the list of standard ISO 3166-1 alpha-2 codes

@panoply
Copy link

panoply commented Oct 19, 2021

@bradydan is it official in UK already? I will have peek on the E.U governing sites. I am aware of the EL reference for Greece (I am Greek) however the vast majority of services feed GR when they are US based, might be worth adding EL in any sense. Wikipedia cannot be trusted nowadays, I will look on the gov counterparts and amend where necessary once I can confirm. Thanks for taking the time to leave your comment fam.

@VagishVela
Copy link

VagishVela commented Mar 10, 2022

@bradydan The UK adopted GDPR into the law when they left the EU.

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