Country Code to Flag Emoji

Convert ISO 3166-1 country codes to 🇬🇧 🇺🇸 flag emojis

Turn two-letter ISO 3166-1 alpha-2 country codes into flag emojis, and decode flag emojis back to their codes. Built on the Regional Indicator Symbol pairing rule used by every emoji platform. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

How is a flag emoji built from a country code?

Each letter is mapped to a Regional Indicator Symbol (A = U+1F1E6 … Z = U+1F1FF). Placing the two indicators for a valid ISO 3166-1 code next to each other tells the renderer to draw that country's flag.

What this tool does

This converter maps ISO 3166-1 alpha-2 country codes to flag emojis and back. Type GB to get 🇬🇧, US to get 🇺🇸, or paste a row of flags to recover their codes. It is useful for building country pickers, localisation tables, social bios, travel content, and anywhere you want to add a flag without hunting through an emoji picker.

How it works

There is no dedicated “flag” code point for each country. Instead, a flag emoji is a pair of Regional Indicator Symbols — a set of 26 Unicode characters at code points U+1F1E6 (🇦) through U+1F1FF (🇿), one for each letter.

To build the flag for a code like GB, the tool emits:

  • The indicator for G (U+1F1EC)
  • Followed immediately by the indicator for B (U+1F1E7)

When the rendering engine sees two valid consecutive Regional Indicator Symbols that form an assigned ISO 3166-1 code, it draws the corresponding country flag. The emoji character sequence for the flag has no visible break between the two indicator symbols — they combine at render time.

Decoding reverses the process: the tool walks the string by Unicode code point (not by JavaScript string index, since Regional Indicator characters are astral code points that occupy two UTF-16 code units), and whenever it finds two consecutive indicators, it converts each back to its letter.

ISO 3166-1 alpha-2 codes

These are the two-letter country codes assigned and maintained by ISO and used across international standards including TLDs, currencies (ISO 4217 uses a related scheme), and language tags (BCP 47). Well-known examples:

CodeCountryCodeCountry
GBUnited KingdomUSUnited States
DEGermanyFRFrance
JPJapanINIndia
BRBrazilNGNigeria
AUAustraliaZASouth Africa

Platforms and rendering notes

  • Assigned codes render as the country’s flag on platforms with the relevant glyph: most iOS, Android, and macOS emoji sets include virtually all current flags. Windows renders some flags but not all.
  • Unassigned combinations like XX display as two boxed indicator letters (🇽🇽) rather than a flag, because no glyph exists.
  • Sub-national flags such as England 🏴󠁧󠁢󠁥󠁮󠁧󠁿, Scotland 🏴󠁧󠁢󠁳󠁣󠁴󠁿, and Wales 🏴󠁧󠁢󠁷󠁬󠁳󠁿 use a separate Unicode Tag Sequence encoding — they are not alpha-2 codes and are outside the scope of this tool.
  • Codes are case-insensitive: gb, Gb, and GB all produce the same indicator pair.