Random Flag
Draw a random country's flag and reveal which country it belongs to, or switch to quiz mode and test yourself with four multiple-choice options and a running score.
Drawing a flagβ¦
How a flag is actually built
Every flag on this page is computed, not stored: flagEmoji(cca2) takes a country's 2-letter code, converts each letter to a Regional Indicator Symbol code point (Unicode reserves U+1F1E6 through U+1F1FF for exactly this, one per letter A-Z), and joins the pair into a single string. Your browser or OS recognizes that specific two-code-point sequence and renders it as a flag glyph -- nothing on this site ever loads an image file for a flag.
"FR" -> F (0x1F1E6 + 5 = 0x1F1EB) + R (0x1F1E6 + 17 = 0x1F1F7) -> π«π·
A sample of the pool
The first 8 of 193 UN member states in the pool, in the order they appear in the underlying dataset (drawing itself is random and does not follow this order):
Why this matters for a quiz
Because the flag is generated fresh from the country's code every time, this quiz is exactly as accurate as the underlying data (see the About page for the source and licence) -- there is no separate, hand-maintained flag image library that could drift out of sync with the country list, get a color wrong, or go missing for a newly added entry.
Frequently Asked Questions
Are these real flag images?
No -- every flag on this page is an emoji, built at display time from two Unicode Regional Indicator Symbol code points derived from the country's ISO 3166-1 alpha-2 code (for example, France is FR, so the flag combines U+1F1EB and U+1F1F7). No image file is loaded for any flag anywhere on this site; the flag is text, rendered by your device's own emoji font, exactly like any other emoji character.
Why does a flag look different on my phone than on my laptop?
Because the flag is an emoji, not a picture, its exact appearance -- the shade of blue, the shape of a star, whether it renders as a flag at all -- depends entirely on the emoji font your device or browser uses. Some older or non-mobile platforms render Regional Indicator pairs as two plain letters instead of a flag graphic; that's a font limitation on your end, not a bug in the code point pair itself, which is correct either way.
How does quiz mode pick the wrong answers?
The same draw-without-replacement used on the Random Capital quiz: three distinct countries besides the correct one are drawn from the 193-country pool, then all four choices are shuffled with a true Fisher-Yates shuffle so the correct answer's on-screen position is never predictable.
Could two different countries ever show the same flag?
Not on this site -- every country has its own distinct alpha-2 code, so every flag emoji built from it is unique to that one code, even for countries whose real flags look visually similar (several pairs of national flags share the same three colors in the same layout in reality; the emoji here still maps one-to-one to the ISO code, not the visual design).
Is my quiz score saved?
No -- like the Random Capital quiz, the score lives only in this browser tab's memory for the current session and resets on reload or mode switch. Nothing is sent anywhere.
Every result here is drawn live in your browser with cryptographically-secure randomness -- nothing is predetermined, saved, or replayable. See the Terms.