Data and sources
Flagdex is built on open data. Every figure on the site comes from one of the sources below, and this page states exactly which, along with the vintage, so you can judge and verify it yourself.
Dataset updated 250 countries 217 with population
What each number on this site counts
Different pages quote different totals, and every one of them is correct for what it counts. They are all derived from the same dataset at build time, never typed into copy, so they cannot drift apart. This table is the one place that defines them.
| Total | Value | What it counts |
|---|---|---|
| Countries and territories | 250 | Every record in the dataset: sovereign states plus dependencies and territories that hold their own ISO 3166-1 code. This is the number on the homepage, the poster and the API. |
| Sovereign states | 194 | Records marked independent in ISO 3166-1 terms. |
| United Nations members | 193 | UN member states. Vatican City is a Permanent Observer State rather than a member, which is corrected here against the source dataset. |
| With a capital city | 245 | Records that list at least one capital. The remaining 5 are uninhabited or administered from elsewhere. |
| Capital pages | 194 | Capital pagesexist for sovereign states with a capital only, because “what is the capital of X” is a question about countries. Territories keep their capital on the country page. |
| With population data | 217 | Records with a World Bank figure. The World Bank does not list every territory separately. |
| With a flag emoji | 249 | Records with a regional-indicator emoji. One record has no assigned emoji pair, so the emoji page shows 249 rather than 250. |
Sources
Base country data
Country names, official names, ISO 3166-1 codes (alpha-2, alpha-3 and numeric), capital cities, currencies, international calling codes, region and subregion, official languages, land borders, flag emoji, area, landlocked status and internet top-level domains come from the mledoze/countries open dataset, published under the Open Database License (ODbL 1.0).
Population
Population figures come from the World Bank, indicator Total Population (SP.POP.TOTL), using each country’s most recent available year. World Bank data is published under the Creative Commons Attribution 4.0 (CC BY 4.0) licence. This dataset was last updated by the World Bank on 2026-07-01. A small number of territories and partially-recognised states are not listed separately by the World Bank; where an authoritative national estimate exists we note it, and otherwise population is shown as not available.
Flags
Flag images are public-domain SVGs sourced from flagcdn.com, which builds on the widely used flag-icons project. They are free to use, including for print and in the classroom.
Flag meanings
The “What does the flag mean?” sections on individual country pages are hand-written, not auto-generated, and each one is sourced individually. Every paragraph cites the specific source it was drawn from directly underneath the text, typically a Wikipedia flag article or, where Wikipedia is thin, a body such as The Flag Institute. Only countries with a documented, sourced explanation are covered; where a flag’s popular “meaning” is folklore or simply unrecorded, the country is left off the flag meanings list rather than filled in with invented symbolism.
Flag colours
The colour filter and the flags by colour pages are computed, never eyeballed. At build time every flag SVG is rasterised to 120 by 80 pixels and each opaque pixel is classified into a colour family from its hue, saturation and lightness. A family counts as part of the flag when it covers at least 7 percentof the flag’s opaque area, which keeps outlines, anti-aliasing and small emblem details out of the answer.
Two deliberate exceptions: a very dark but strongly saturated colour keeps its hue rather than being called black, so Pakistan’s bottle green stays green; and red reaches into the crimson range, because a great many flag reds sit there. Low-saturation greys are ignored entirely. The result is a claim you can check: run the script against the same public-domain SVGs and you get the same list.
What this method does not capture is layout. Two flags with the same colour families can look nothing alike, which is why the “same colours” section on a country page is described as a colour match and not as a look-alike ruling. Layout is read separately from the same raster; the full rules for both are under how flag colours and layouts are classified.
Disputed and partially recognised territories
The dataset follows ISO 3166-1, which is a coding standard rather than a political statement, and this site does not add a judgement on top of it. In practice that means: Kosovo appears under the user-assigned code XK and is not marked independent; Taiwan and Palestine appear with their ISO entries and are likewise not marked independent; and Western Sahara appears under EH. Vatican City is marked independent but not a United Nations member, because the Holy See is a Permanent Observer State.
Where a place is not marked independent, the site calls it a territory rather than a country, in the title, in the description and in the body text. That is a statement about the coding standard, not about anyone’s claim. The naming rules are set out in full under how disputed territories are named.
How it is served
All of this is compiled into a single dataset that ships with the site, so pages make no runtime API calls and load instantly. The same dataset is exposed as a free static JSON API.
How flag colours and layouts are classified
One build script reads every flag SVG served on this site and writes two results: the colour families of each flag and its stripe layout. Each SVG is resized to a raster of 120 by 80 pixels with nearest-neighbour sampling, so stripe edges keep their flat colours instead of blending into in-between shades. Pixels that are less than half opaque are skipped, which keeps the empty corners of Nepal’s pennant out of the count.
Every remaining pixel is converted to hue, saturation and lightness and given one colour family by the rules below, tested in this order. Any other pixel with a saturation below 14 percent is a grey, typically an outline or an anti-aliased edge, and is not counted. A family is listed for a flag when its pixels cover at least 7 percent of the flag’s opaque area.
| Family | Rule | Flags |
|---|---|---|
| White | Lightness at least 82 percent and saturation below 20 percent. | 137 |
| Black | Lightness at most 16 percent and saturation below 55 percent. A darker but more saturated colour keeps its hue. | 38 |
| Red | Hue below 12 degrees, or 335 degrees and above, so crimson and rose count as red. | 188 |
| Brown | Hue from 12 to below 45 degrees, with lightness below 34 percent and saturation below 60 percent. | 0 |
| Orange | Hue from 12 to below 45 degrees, when the brown rule does not apply. | 21 |
| Yellow | Hue from 45 to below 70 degrees. | 66 |
| Green | Hue from 70 to below 165 degrees. | 84 |
| Blue | Hue from 165 to below 258 degrees. | 139 |
| Purple | Hue from 258 to below 335 degrees. | 0 |
Brown and purple are possible, but no current flag reaches the threshold for them.
Layout comes from the same classified raster. For every row of pixels the script finds the colour that covers most of it, and how much of the row that is; greys count as a colour of their own here. It does the same for every column. A flag is classed as horizontal stripes when its rows are on average at least 85 percent one colour, at least two different colours each lead at least 10 percent of the rows, and the columns score more than 15 percentage points lower. Vertical stripes is the same test with rows and columns swapped. Everything else is classed as other: crosses, cantons, discs, saltires and emblems each fail one of the tests, which is the intent.
In the current dataset that gives 76 horizontal, 31 vertical and 143 other. Every build also prints a fixed control sample with known answers, so a drift in the thresholds shows at once: Germany, Russia, Spain and the Netherlands are expected as horizontal; France, Italy, Nigeria and Belgium as vertical; Japan, the United Kingdom, Switzerland and Brazil as other. The flags by colour pages and the colour and layout filters in the flag finder read these results directly.
How the quiz picks its answers
The flag quiz draws its questions from the same region sets as the printable quizzes. A world round covers the 194 sovereign states that have a capital; adding territories to the world set takes it to all 250 records.
In hard mode the wrong options are lookalikes, judged only from the computed data above: flags with the same layout and an overlapping set of colour families. Nobody picks the pairs by hand. By that rule Chad and Romania qualify (both vertical stripes in red, yellow and blue), as do Indonesia and Monaco (both horizontal stripes in red and white).
Every round is built from a seed: a short code of four to eight lowercase letters and digits that drives a deterministic random generator. The same seed always gives the same flags in the same order with the same options, on any device, and it also settles ties between equally close lookalikes. That is what a challenge link carries, so everyone who opens it plays the identical round.
A few records share one flag file, byte for byte. These twin flags are found at build time by comparing a hash of every flag file, not listed by hand. A question never offers two twins as options, because nobody could tell them apart; a typed answer accepts any of them; and the answer names every place that uses the flag. Flags that are merely close are separate files and can appear as lookalikes, never as twins.
| Place | Uses the same flag file as |
|---|---|
| Saint Martin | France |
| Bouvet Island | Norway |
| Svalbard and Jan Mayen | Norway |
| United States Minor Outlying Islands | United States |
How disputed territories are named
Every record carries the common English name from the source dataset, next to its ISO 3166-1 alpha-2 code. For places whose status is disputed that gives short, neutral labels: Kosovo (XK), Taiwan (TW), Palestine (PS) and Western Sahara (EH). Kosovo’s XK is a user-assigned code, not an official ISO 3166-1 assignment.
Whether a record is called a country or a territory is decided by one field, not page by page. A record marked independent is a country, and its profile is headed “Country profile”; every other record is a territory, headed “Territory profile”, and is described that way in its title, its description and its opening sentence. The UN member badge appears only on the 193 United Nations member states. That is why each of the places above is counted among the 56 territories in the totals at the top of this page, carries no UN member badge and has no separate capital page.
The official-name line on a profile repeats the long-form name recorded in the source, such as Republic of Kosovo and Republic of China (Taiwan). It is quoted as recorded, next to the short name and the territory label, and is not a ruling on status.
Where a capital is itself disputed, as with Jerusalem, the capital of Israel page sets out the competing positions rather than choosing one.
A note on contested definitions
Some groupings on this site, such as the Middle East, the Balkans or Eastern Europe, are cultural and geopolitical rather than strictly geographic. Their membership varies between sources. On each of those pages we state the definition we use so nothing is left implicit.
Corrections
Found something wrong or out of date? Please tell us on the contact page. We rebuild from source periodically and update the vintage shown above.
Dataset changelog
Every change to the data itself, newest first, with the source behind it. Rebuilds of the site that leave the records untouched are not listed.
- Managua: the capital profile now places the city on the shores of Lake Managua, exactly as its cited source does, instead of the southern shores.Source: Wikipedia: Managua
- Vatican City is no longer counted as a United Nations member state. The base dataset marks it as one, but the Holy See is a Permanent Observer State, so the member badge and the UN member total now match the UN's own list.Source: United Nations: Member States
- Sri Lanka: Sri Jayawardenepura Kotte added as the legislative capital, where Parliament sits, next to Colombo as the commercial capital and seat of the executive.Source: Wikipedia: Sri Jayawardenepura Kotte
- Iraq: the year Baghdad became capital corrected from 762, when it was founded as the Abbasid capital, to 1921, when it became the capital of the Mandate of Mesopotamia. Eswatini: Mbabane is no longer described as the most populous city; it is the executive capital.Source: Wikipedia: Baghdad; Wikipedia: Mbabane
- Cuba: the withdrawn Cuban convertible peso (CUC) removed from the currencies, leaving the Cuban peso (CUP).Source: Correction to the mledoze/countries record
- Dataset compiled: country records from mledoze/countries and population from the World Bank, last updated by the World Bank on 2026-07-01.Source: mledoze/countries (ODbL 1.0); World Bank SP.POP.TOTL (CC BY 4.0)
How to cite Flagdex
For a paper, a report or a reference list, cite the dataset with the version it was built from. The version is the date the dataset this site runs on was compiled; later corrections to individual records are dated in the dataset changelog.
Flagdex (2026). Flags and country data, dataset version 2026-07-02. https://flagdex.net/data
Citing a single figure, such as a capital or a population? Add the country page it came from in place of the address above, so a reader lands on the exact record.