I need icons for the flags of countries.

  • PNG file format
  • Small sizes such as 32x32 pixels or similar. Consistent size for all flags (even the flags with strange shapes like Nepal, they have to be fit in).
  • Similar to the official flag, not too much styling/shadows/glowing/wind. If there is style, it has to be consistent.
  • Usable in both open source and commercial products

In each answer, embedding a sample icon (for instance UK) would be appreciated.

8 Answers 8


There is a Google Internationalization project called Region Flags that structures the Wikipedia data.

This package is a collection of flags for BCP 47 region codes. Most people think of these as country flags, but there are a few codes / flags that do not correspond to countries. The flags are in SVG and PNG format and named by their BCP 47 region code, which for countries is the same as ISO 3166-2 country code.

The license is based on the Wikipedia license, which are flag-dependent

The flags are downloaded from Wikipedia. When Wikipedia flags were copyrighted, we worked we Wikipedia editors to either relicense them, or drew / sourced and uploaded new public-domain versions.

How to get data:

To download missing flags, run download-wp.py.

To update to latest flags from Wikipedia, delete the html, svg, and png directories, then run make-aliases.sh followed by download-wp.py.

Data formats are PNG and SVG, where SVG can be easily and safely be used at any resolution.

enter image description here

  • Glad it was helpful. I use the python-phonenumbers module ( github.com/daviddrysdale/python-phonenumbers ) which it turns out was based on this googlei18n data. Also, I found some nice address parsing modules that I may try to incorporate in my work.
    – philshem
    Commented Dec 8, 2014 at 12:08

famfamfam icons are free and require no attribution and are quite small:
enter image description here

The Noun Project has a Flags of the World Collective, although it is not complete, and not in the desired formats of OP, but I just wanted to add them for everyone else who comes through here:

EDIT (2):
here's a set of text attributes of world flags, meant for machine learning http://archive.ics.uci.edu/ml/datasets/Flags

  • 1
    If you're interested in the famfamfam flags, you may be interested in this follow-up https://github.com/tkrotoff/famfamfam_flags
    – PatrickT
    Commented Apr 29, 2016 at 15:41
  • 1
    These icons are now maintained (no update since 2016) here: github.com/legacy-icons/famfamfam-flags
    – Cas
    Commented Jun 12, 2023 at 9:55

Wikipedia has images for flags of most countries which are normally licensed as Creative Commons and in general National Flags are considered ineligible for copyright as being in the public domain but it is nice to give attibution in your documentation.

Note that usage may be restricted in other ways - e.g. using the German Flag German Flag 200px in a program that promotes racial intolerance would get you into hot water.

Most of the Flags on Wikipedia are available as .png format and are not too stylized but the other problem is that 32x32 px is much to small to represent accurately many national flags, e.g.:

USA 300px USA 300 px --> 32x16 USA 32 px

All the original images come from Wikipedia.

To get such a set I used a python script then ImageMagik mogrify to resize to 32x32, (many ended up not exactly 32x32 as the aspect ratio for most flags is not 1:1), the resulting file and the python script are both available in my drop box - don't forget to credit Wikipedia and to look at the licence terms there.

  • Thanks! Sorry I forgot to explicit an important requirement: consistent size for the whole series.
    – Nicolas Raoul
    Commented Aug 25, 2014 at 6:55
  • 3
    @NicolasRaoul I have generated a 32x? set as a tar and put it in my dropbox dropbox.com/s/ntkh90dn5w9x6ro/32_pxFlags.tar?dl=0 hope that helps. Commented Aug 25, 2014 at 7:50
  • "using the German Flag " any citation for this? Commented Aug 15, 2017 at 15:07
  • No direct citation @MarianPaździoch but I have seen several news stories in the past where extremists were being prosecuted for associating the flag with their behaviour. Commented Aug 15, 2017 at 21:04

You can get a public domain set from the CIA World Fact Book:



Iconfinder allows you to search for icons, e.g., with "flags country": https://www.iconfinder.com/search/?q=flag+country

There is a large number of different icons in various styles, backgrounds, sizes, styles, formats, and licenses.

See a specific example here: https://www.iconfinder.com/icons/2176510/belgium_country_flag_icon#size=256

The results can be filtered by license (eg. "For commercial use").


For an app we made we used flags from Emoji characters. These means you take the ISO country code and map it to the emoji character. Because it's Unicode, you can scale it to any size and then render it as any image format (for example, with ImageMagick)

I'm sure with a more comprehensive search you'll find packages for any and every programming language, but here are a couple packages

note, I haven't checked or used either

  • So, this means the data comes from the font you are using, right? If so, can you recommend an open font that has nice scalable flags? Thanks!
    – Nicolas Raoul
    Commented Nov 21, 2018 at 8:21
  • here's a partial answer superuser.com/a/1266892/442118 and the question has other resources
    – philshem
    Commented Nov 21, 2018 at 11:56
  • 1
    You should write that font's name/URL/license into your answer, you know what we say about external links :-) The open data that your solution proposes comes directly (or indirectly via the 3 libraries you suggest) from the font. On some systems, the image returned by these 3 libraries might not be open data at all.
    – Nicolas Raoul
    Commented Nov 22, 2018 at 1:48

Another github repo popped up with 2600+ images of flags (flat/glossy, various sizes)


... a flag for every major country in the world, plus a few more. And we've created them in several sizes so they'll look great no matter where you're using them – 16×16, 24×24, 32×32, 48×48, and 64×64. We've also provided them in 2 variants – as flat and standard, and with a lovely glossy finish.

Free to use under an MIT license – view on GitHub.

  • This looks abandoned with no updates since early 2017
    – Cas
    Commented Jun 12, 2023 at 9:49

Hope this will help others! www.mcicon.com free logo and icons for commercial use without registration, you only need to attribute the author.

  • 1
    What or where is the license? Also, how to find country flags on this website? Thanks!
    – Nicolas Raoul
    Commented Jun 13, 2021 at 11:49
  • No website anymore...
    – Cas
    Commented Jun 12, 2023 at 9:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.