by behdad

behdad /region-flags

Collection of flags for BCP 47 region codes in SVG / PNG

134 Stars 72 Forks Last release: Not found Other 75 Commits 2 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:


This package is a collection of flags for geographic region and sub-region codes. The regions are based on the data from BCP 47 and selected sub-regions (US states, Canadian provinces and territories, and some sub-regions of Great Britain) are based on ISO 3166-2:US, ISO 3166-2:CA, and ISO-3166-2:GB.

Most people think of these regions from BCP 47 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. In case of sub-regions, ISO 3166-2 is used for naming the files; e.g.

is the flag of the State of Delaware.

The canonical way to get all BCP 47 region codes is to look for records in

(which is downloaded from IANA Language Subtag Registry) with the following fields:
Type: region
Subtag: [A-Z]{2}
AND NOT Description: Private use
AND NOT Deprecated: .*

Regions not in that repository can be added to

. One such region has been added.

Some regions do not have their own flag. In such cases, they are symlinked to the best flag to represent them, which in most cases is the flag of their regional or political parent. These are listed in file


The sub-regions currently covered are:

  • US states and the District of Columbia
  • Canadian provinces and territories
  • Countries of England, Scotland, and Wales in Great Britain
  • The province Northern Ireland in Great Britain

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. In particular, the license for these flags were resolved for the initial import:

  • Montenegro
  • Nicaragua
  • Sint Maarten
  • Ascension Island
  • Lesotho
  • Kosovo


  • The script
    lists all regions and some selected sub-regions with their metadata.
  • The script
    shows the Wikipedia URL for the flag page.
  • The script
    shows all such regions that we don't have flags for.
  • The script
    makes symlinks for regions that use flag of another region.
  • The script
    downloads missing flags from Wikipedia and generating optimized SVG and PNG versions.

You can use the waveflag script from the Noto fonts project to wave PNG flags.



If new regions are needed, update

from IANA Language Subtag Registry, or add new regions to
before. Then update
as needed.

If a specific flag on Wikipedia flag is under Creative Commons, work with Wikipedia editors to relicense it to public domain. If the flag is not explicitly marked

but otherwise exempt from Copyright (typically, because of national laws), make a note of it in file

To download missing flags, run

To update to latest flags from Wikipedia, delete the

, and
directories, then run
followed by


See file

for details.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.