Given the success of this simple list, I thought it would be good to see if it could be improved by opening it up to greater collaboration. Check out our blog post about Factual.
How hard would it be to simply have a text list of all countries in the world that you could use to just cut and paste for a drop-down list? I was just in the middle of creating a cck node for countries and wanted a quick list I could cut and paste from without having to muck about with doing search/replace work to get rid of the side data from Wikipedia or the UN's list of countries. I wanted a similar list for states & provinces in North America, so just added that.The Wikipedia list also has lists of the states lacking general international recognition, of which Taiwan & Palestine are likely the most hotly contested.
My friend Jason Ramsey pointed out on Facebook (when my rss feed migrated there) that there were some other options, looking at "the perl cpan module Geography::Country you will notice that they use the ISO 3166-1 list which I searched for and found this list. Then you can easily do a regex to strip off the country code. Or there is also this easy to use list tool. I took the output from this and formatted it nicely for use in cck's select forms (one value per line - key|label.) & the survey module (A list of all options - delimited by semicolons & colons - 1:red;2:blue;3:green).
It is useful to have a drop-down that returns a country code so that this can be consistently stored with your client's address. If you do need support with user input forms, please feel contact us.
I've cleaned up one source of 195 countries and have it here for future reference:
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua & Deps
Argentina
Armenia
Australia
Austria
Azerbaijan
Bahamas
Bahrain
Bangladesh
Barbados
Belarus
Belgium
Belize
Benin
Bhutan
Bolivia
Bosnia Herzegovina
Botswana
Brazil
Brunei
Bulgaria
Burkina
Burundi
Cambodia
Cameroon
Canada
Cape Verde
Central African Rep
Chad
Chile
China
Colombia
Comoros
Congo
Congo {Democratic Rep}
Costa Rica
Croatia
Cuba
Cyprus
Czech Republic
Denmark
Djibouti
Dominica
Dominican Republic
East Timor
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Ethiopia
Fiji
Finland
France
Gabon
Gambia
Georgia
Germany
Ghana
Greece
Grenada
Guatemala
Guinea
Guinea-Bissau
Guyana
Haiti
Honduras
Hungary
Iceland
India
Indonesia
Iran
Iraq
Ireland {Republic}
Israel
Italy
Ivory Coast
Jamaica
Japan
Jordan
Kazakhstan
Kenya
Kiribati
Korea North
Korea South
Kosovo
Kuwait
Kyrgyzstan
Laos
Latvia
Lebanon
Lesotho
Liberia
Libya
Liechtenstein
Lithuania
Luxembourg
Macedonia
Madagascar
Malawi
Malaysia
Maldives
Mali
Malta
Marshall Islands
Mauritania
Mauritius
Mexico
Micronesia
Moldova
Monaco
Mongolia
Montenegro
Morocco
Mozambique
Myanmar, {Burma}
Namibia
Nauru
Nepal
Netherlands
New Zealand
Nicaragua
Niger
Nigeria
Norway
Oman
Pakistan
Palau
Panama
Papua New Guinea
Paraguay
Peru
Philippines
Poland
Portugal
Qatar
Romania
Russian Federation
Rwanda
St Kitts & Nevis
St Lucia
Saint Vincent & the Grenadines
Samoa
San Marino
Sao Tome & Principe
Saudi Arabia
Senegal
Serbia
Seychelles
Sierra Leone
Singapore
Slovakia
Slovenia
Solomon Islands
Somalia
South Africa
Spain
Sri Lanka
Sudan
Suriname
Swaziland
Sweden
Switzerland
Syria
Taiwan
Tajikistan
Tanzania
Thailand
Togo
Tonga
Trinidad & Tobago
Tunisia
Turkey
Turkmenistan
Tuvalu
Uganda
Ukraine
United Arab Emirates
United Kingdom
United States
Uruguay
Uzbekistan
Vanuatu
Vatican City
Venezuela
Vietnam
Yemen
Zambia
Zimbabwe
| Attachment | Size |
|---|---|
| country_code_drupal.txt (updated) | 3.52 KB |
| country_code_drupal_survey.txt (updated) | 3.52 KB |


"Macedonia"
Exactly...The country's name
Republic of Macedonia is a country
Umm....
dummy
No! The Netherlands IS a
You are not entirely wrong
Scandinavia
A huge timesaver!
Great
Thanks
Lots of thanks
You just saved me a ton of
Thanks Mate
Gibraltar
Interesting Place
Another thanks...
very helpful, thank you!
Many thanks!
Thank you
Thank you
Thank you very much! :-)
Not only did we need this list.. but we needed it for use on our Drupal site! :-)
where is bermuda???
where is bermuda??? also, where is puerto rico? i might just not be seeing them.
Bermuda/Puerto Rico
List of countries, not territories and commonwealths
We've had a number of comments about this. This list is not geared towards including all territories and commonwealths, just countries.
For the United Kingdom the included territories are:
* Flag of the United Kingdom Akrotiri and Dhekelia
* Anguilla
* Bermuda
* British Indian Ocean Territory (disputed by Mauritius and the Seychelles)[8]
* British Virgin Islands
* Cayman Islands
* Falkland Islands (disputed by Argentina)[8]
* Gibraltar (disputed by Spain)[8]
* Montserrat
* Pitcairn Islands
* Saint Helena (with its dependencies of Ascension Island and Tristan da Cunha)
* South Georgia and the South Sandwich Islands (disputed by Argentina)[8]
* Turks and Caicos Islands[8]
* British Antarctic Territory (disputed)
The British Crown has sovereignty over
* Guernsey (with the dependencies of Alderney, Herm and Sark)
* Isle of Man
* Jersey
For the USA the list is:
* American Samoa
* Guam
* Northern Mariana Islands
* Puerto Rico
* United States Virgin Islands
Thanks... that was really
Thanks... that was really helpful...been looking around this list for a drop-down menu.
God bless!
thanks a lot
Thanks a lot - saved me loads of time!
Hey thanks this is great
Hey thanks this is great saved me loads of time
Great! thanks! anyone have cities?
This is great thanks.
I'm using it in a profanity filter system I have.
( ie, all countries and their foreign language translations go into the whitelist )
Question.
Does anyone have a list of all the major cities in the world?
Thanks heaps!
Brian
City Names
I think GeoNames is your best bet for this data, but there is also a nice looking Drupal API too.
Cheers mate, just what I
Cheers mate, just what I needed
Correction
I'm not sure if American's even realise this, but although the United Kingdom is commonly referred to as a 'country' because it has a single government which represents the entire UK on the international political stage, it is in fact a unified kingdom (as the name suggests) consisting of 4 separate countries; England, Wales, Scotland and Northern Ireland (unlike the USA, which is one country divided into separate states). On a list of 'countries' therefore it is probably more accurate to list the 4 countries separately rather than under one 'UK' entry.
It's not that we're discounting nations within the UK
But this list is mostly for things like snail mail drop-down lists for choosing countries.
The nations you have listed do not appear in the list of member states of the UN.
I think that a list that included all nations of the world would be a lot harder to maintain.
How would someone use a list of all of the world's nations?
Brilliant
1 word - Legend!
Merci !
Merci !
Thanks so much ! :-) Saved
Thanks so much ! :-) Saved me heaps of time, Cheers
Facebook
Great list. I'm trying to get Facebook friends in 100+ countries. I'll post a list of countries I need using this list. Send FRIEND SUGGESTIONS via Facebook for "obscure" countries.
THANKS!
Very helpful list
big thanks for this list ;D
big thanks for this list ;D
'Terima kasih' from Jakarta
'Terima kasih' from Jakarta (Indonesia)... I have a few hours before having to submit a project and THIS HAD BEEN SUPERB.
Thank you, you are a true
Thank you, you are a true time saver.
Some corrections...
Yugoslavia does not excist anymore and should not be on this list. On February 4, 2003 it was renamed to the "State Union of Serbia and Montenegro", and officially abolished the name "Yugoslavia". On June 3 and June 5, 2006 respectively, Montenegro and Serbia declared independence, thereby ending the Yugoslav state. --> Serbia and Montenegro should be on the list!
Kosovo is missing from the list. The 2008 Kosovo declaration of independence was adopted on 17 February 2008, and declared Kosovo to be independent from Serbia (recognized by more than 40 countries, including the USA, the UK, Germany, Norway, Sweden, Australia, and many more)
Westen Samoa changed name to Samoa in 1997.
Kosovo is not independent country
You have an error! Kosovo is not recognize as an independent country by UN and by all EU coutry, so it still has no independency. It's still part of Serbia. Please, remove it.
I have addressed this above
Kosovo is recognized by most Western countries and I am keeping it in the list. Thanks for your request though. I do hope that there is movement towards a better resolution for this issue in the near future.
Montenegro won its
Montenegro won its independence from Serbia in 2006 and was recognized by the UN the same year. "Serbia and Montenegro" doesn't exist any more.
Thanks, but where?
That's been fixed in the lists I see posted. Do you see it listed as Serbia & Montenegro somewhere?
Good Details
Especially catching the name change to Samoa.
Cape Verdi should be Verde
Cape Verdi should be Verde
Thanks
I've corrected that in the lists on this page.
Kosovo is missing from the list!!
Kosovo is missing from the list! The Assembly of Kosovo approved a declaration of independence on 17 February 2008.
no it is not