List of world countries, as MySQL dump, with national flags

Get the latest updates on this project via RSS

A list of world’s countries as a MySQL dump file containing the official short names in English as given by ISO 3166-1, the ISO 3166-1-alpha-2 code provided by the International Organization for Standardization and the ISO alpha-3 code provided by the United Nations Statistics Division.

The package also contains the national flags of each country as a 16×16, 24×24, 32×32, 64×64 and 128×128 PNG images, courtesy of IconDrawer. The image files are named using the ISO 3166-1-alpha-2 code of the country they represent, for easily pairing flags with countries.

Keep in mind that while all the countries have ISO 3166-1-alpha-2 code, not all the countries have an ISO 3-alpha code.



version 1.2.1

If you find this library to be useful to you, you can support the author by donating a small amount via PayPal:

Alternatively, you could show your support by starring this library on GitHub

World countries list, with national flags is distributed under the LGPL.

In plain English, this means that you have the right to view and to modify the source code of this software, but if you modify and distribute it, you are required to license your copy under a LGPL-compatible license, and to make the entire source code of your derivation available to anybody you distribute the software to.

You also have the right to use this software together with software that has different licensing terms (including, but not limited to, commercial and closed-source software), and distribute the combined software, as long as state that your software contains portions licensed under the LGPL license, and provide information about where the LGPL licensed software can be downloaded.

If you distribute copies of this software you may not change the copyright or license of this software.



Click on a version to expand/collapse information.

version 1.2.1 (January 26, 2016)
  • the list is now available on GitHub
  • flags are now availabel also in 24×24, 32×32, 48×48, 64×64 and 128×128 pixels
version 1.2 (December 09, 2012)
  • added new country and codes: “South Sudan” (thanks to Jackman);
  • changed the ISO alpha-3 code of “Congo” from “cod” to “cog”;
  • added “cod” ISO alpha-3 code to “Congo, The Democratic Republic of the”;
  • added “ggy” ISO alpha-3 code to “Guernsey”;
  • added “jey” ISO alpha-3 code to “Jersey”;
  • added “myt” ISO alpha-3 code to “Mayotte”;
  • added “maf” ISO alpha-3 code to “Saint Martin (French Part);
  • added “sxm” ISO alpha-3 code to “Sint Maarten” (Dutch Part);
  • alpha-2 and alpha-3 codes are now lowercase and the countries’ names are no longer all-caps;
  • replaced the old flag icons dating from 2007 and with missing images for quite a few countries, with new ones by IconDrawer
version 1.1 (June 27, 2011)
  • updated the list
version 1.0 (January 30, 2006)
  • initial release


28 responses to “List of world countries, as MySQL dump, with national flags”

Follow the comments via RSS
  • Ferdinand, 2016-01-29, 07:54

    forgot … I’m not really missing it, but for completeness – what’s about Vatican?

    • Stefan Gabos, 2016-01-29, 09:42

      Vatican is not missing. It’s there both in the SQL file as well as in the flags (va)

    • Ferdinand, 2016-01-29, 11:34

      sorry! you are right (Holy See) i searched at letter V – Vatican City State! 😉

  • Eric, 2016-07-01, 19:22

    hi there, first of all i got to say thank you for your list its great! but i am a complete noob as far as sql php ect ect. i would like to know if there were a way to associate a country with a flag. i give you a concrete example. on my site users can register their chess tournaments and in the form, there is a dropdown with all the countries. I would like that when a country is selected that the flag appears as his logo…

  • Eugen, 2016-09-03, 10:07

    It will be nice to have “Rest of the world” flag


Leave a Reply

Your email address will not be published
You can use <strong>, <em>, <a>, <img>, <code>
Characters are not case-sensitive