Skip navigation

Text List of All Countries in the World

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
AttachmentSize
country_code_drupal.txt (updated)3.52 KB
country_code_drupal_survey.txt (updated)3.52 KB

"Macedonia"

Macedonia is not a country. The name of that country is FYROM

Exactly...The country's name

Exactly...The country's name is FYROM

Republic of Macedonia is a country

Least according to wikipedia which is the authoritative response here. For more information on the Republic of Macedonia.

Umm....

You realize "FYROM" just stands for Former Yugoslav Republic of Macedonia, right? Then again, from your comment, I would say no... I came here from google, and don't know what this is, but people don't know that Netherlands is a country and that FYROM is a completely acceptable *abbreviation* for the name, but not the name itself? Hmm.. thanks for the list, though, I needed it for a project.

dummy

the netherlands are not a country they are a territory with 4 nations sweden norway finland and some really small country which i cant remember at this time so you suck

No! The Netherlands IS a

No! The Netherlands IS a country :)

You are not entirely wrong

But you are irrelevant. As clearly stated at the top of the list, this is generated via Wikipedia's List of sovereign states. Wikipedia does list the constituent countries of the Kingdom of the Netherlands in this list. I would encourage you to read up on it however when you have a chance. Sweden, Norway & Finland are all sovereign states. I'm guessing you were thinking about the Kingdom of Denmark (but this too would be inaccurate).

Scandinavia

There are Scandinavia with Sweden, Norway and some part of Finland. Then we have the "Nordic countries" which is Sweden, Norway, Denmark Finland and Iceland. Thera are also the associated territories Faroe Islands, Greenland, Svalbard and Åland. http://en.wikipedia.org/wiki/Nordic_countries http://en.wikipedia.org/wiki/Scandinavian_Peninsula The netherlands is just another European country :)

A huge timesaver!

Many thanks. Just came by this via Google, and it's saved me lots of work. Great stuff :)

Great

Very helpful. Saved me a lot of time. Thanks

Thanks

Super you for providing a textfile of country! Thanks :)

Lots of thanks

Thanks a lot for the complete list of countries.

You just saved me a ton of

You just saved me a ton of work, thanks man.

Thanks Mate

Mega list, mega useful, cheers for this mate

Gibraltar

Gibraltar is part of the UK. It is under British Sovereignty and has been for the last 300 years. It should be on the list

Interesting Place

But Gibraltar is still a British overseas territory. We're working with the Wikipedia definitions to derive this country list.

Another thanks...

Over 2.5 years on and the list is still useful! I used it on a new drupal site that is currently work in progress.

very helpful, thank you!

very helpful, thank you!

Many thanks!

This countries list saved me a lot of copy-pasting. 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

The abovementioned places are territories of the U.K. and the us, respectively

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

no it is not

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.