Country at Random

About Country at Random

Country at Random is run by a single independent builder as seven free tools for drawing a random country, capital, flag, US state, continent or language. Every tool states exactly how its result is drawn and where its underlying facts came from -- nothing on this site is typed from memory. If a fact isn't in a cited source, the tool shows it as unavailable rather than guessing.

How the tools work

Every tool that draws a country, capital, flag, continent or language routes its actual draw through one shared randomness engine rather than each tool reinventing its own. Every integer draw uses the Web Crypto API (crypto.getRandomValues) with unbiased rejection sampling; every without-repeats draw is a true Fisher-Yates shuffle. Neither Math.random() nor a plain modulo shortcut appears anywhere in the draw path, because both are measurably biased for pool sizes -- like 193 UN member states -- that don't evenly divide 256. Flags are never images: every flag is built at display time from two Unicode code points derived from the country's own ISO code.

Country data: sources, licences and fetch dates

Every country fact on this site -- name, official name, ISO 3166-1 alpha-2/alpha-3 codes, capital(s), region and subregion, area, languages, currencies, calling code, and UN-member flag -- was fetched from mledoze/countries, a community-maintained, ISO-3166-referenced world country dataset on GitHub, on 2026-09-17, and is licensed under the Open Data Commons Open Database License (ODbL) v1.0. That licence requires attribution and that any public derivative database remain open on the same terms -- this credit, and the full Country List page, are that attribution.

Population figures were fetched separately from World Bank Open Data -- World Development Indicators (SP.POP.TOTL) on 2026-09-17 (Creative Commons Attribution 4.0 (CC BY-4.0)) -- the most recent year available for each country individually, which is shown alongside every population figure since it isn't the same year for every entry. 35 of 250 entries, mostly small non-independent territories, have no population figure in this source and are shown as unavailable rather than estimated.

We originally intended to use restcountries.com, this site's namesake data provider, but as of this writing its free v3.1 API has been deprecated in favor of a paid v5 product requiring an API key -- so its underlying, freely-licensed open dataset (mledoze/countries, which restcountries.com itself was historically built from) was used directly instead.

A correction we made, and why

The country dataset flags Vatican City (the Holy See) as a UN member state. Cross-checking directly against the United Nations' own published member-states list on 2026-09-17 shows it is not included -- the Holy See holds Permanent Observer status, like the State of Palestine, not membership. We corrected this one field in our copy of the data so this site's default pool is exactly the 193 states the UN itself lists, and documented the correction in lib/countries.ts rather than silently changing it. Every other field on every other country is used as the source provides it.

US state data

The 50 US states are not part of the country dataset above -- ISO 3166-1 has no entries for individual states, since a state is a subdivision of one country, not a country of its own. State names, USPS abbreviations and FIPS codes come from the U.S. Census Bureau -- state FIPS codes and USPS abbreviations (fetched 2026-09-17); capital cities and the year each became the capital come from Wikipedia -- List of capitals in the United States (State capitals table) (Creative Commons Attribution-ShareAlike 4.0 (CC BY-SA 4.0), fetched 2026-09-17). All 50 states have a recorded capital.

What it doesn't do

Every draw happens entirely in your browser; nothing you generate is sent to our servers, and there are no accounts. Quiz scores exist only in that browser tab's memory for the current session and are never saved or transmitted. See Terms.

Every tool

Plus one page per continent (Africa, Americas, Asia, Europe, Oceania), each preloading the main generator to that continent's own pool.

Corrections

If something here is wrong or unclear, email hello@countryatrandom.com.