UtilityKit

500+ fast, free tools. Most run in your browser only; Image & PDF tools upload files to the backend when you run them.

Random Country Generator

Explore dozens of nations with emoji flags.

About Random Country Generator

Random Country Generator picks a random country from the full list of UN-recognized sovereign states and displays its national flag emoji, continent, ISO 3166-1 alpha-2 and alpha-3 codes, and capital city. It is a quick tool for geography education, quiz games, travel inspiration, data testing, and any situation where a random country selection is needed. Click Generate to get one country, or use batch mode to generate up to 20 countries at once for a quiz list, a geography challenge, or test data seeding. Each result includes enough structured metadata to be directly useful in code — ISO codes for database entries, continent for region grouping, and flag emoji for display. Everything runs in the browser; no API calls are made.

Why use Random Country Generator

Rich Structured Metadata Per Country

Every result includes the flag emoji, ISO alpha-2 code (for databases), ISO alpha-3 code (for international standards), continent, and capital city — giving you all the structured data points you need, not just a country name.

Region Filter for Targeted Selection

Constrain the random pick to a specific continent — Africa, Asia, Europe, the Americas, or Oceania — for region-specific geography quizzes, travel planning, or continent-scoped test data generation.

Flag Emoji for Instant Visual ID

Each country includes its flag as a Unicode emoji, universally supported in modern browsers and apps. This makes results immediately shareable in chat apps, social media, and Notion pages without needing image assets.

ISO Codes for Direct Use in Code

ISO 3166-1 alpha-2 and alpha-3 codes are the standard identifiers used in country dropdowns, locale settings, currency APIs, and international databases. Having them instantly available eliminates lookup time.

Geography Education and Quiz Tool

Generate a batch of countries for a geography quiz — ask students to identify the capital, continent, or flag. The structured output with all fields visible or hidden makes it easy to run structured quiz rounds.

Batch Generation for Test Data

Produce up to 20 country records at once for populating dropdowns, seeding user location fields, testing internationalization logic, or creating sample datasets with realistic global distribution.

How to use Random Country Generator

  1. Click Generate Country to pick one random country and see its flag, name, continent, capital, and ISO codes.
  2. Use the Region filter dropdown to constrain selection to a specific continent if needed.
  3. Click Generate Again to pick a different country without changing your settings.
  4. Switch to Batch mode and set the quantity (2–20) to generate multiple countries at once.
  5. Click the copy icon next to any country to copy its details, or use Copy All in batch mode.
  6. Use the ISO codes, continent, and capital fields directly in your code, test data, or quiz answer sheet.

When to use Random Country Generator

  • When seeding a user database with realistic country values for testing country-select dropdowns and internationalization logic
  • When creating a geography quiz for a classroom and you need a randomized list of countries with capitals and flags
  • When building a travel or bucket-list app prototype and want randomly selected countries to populate the UI with realistic content
  • When testing that your application correctly handles ISO 3166-1 codes for all continents and regions
  • When running a geography-themed trivia game and you need a neutral way to pick the next question's subject country
  • When generating sample shipping address data and need realistic country values with their ISO codes for the country field

Examples

Single random country

Input: No filter, click Generate

Output: 🇧🇷 Brazil | Continent: South America | Capital: Brasília | ISO: BR / BRA

European country (filtered)

Input: Region filter: Europe, click Generate

Output: 🇵🇹 Portugal | Continent: Europe | Capital: Lisbon | ISO: PT / PRT

Batch of 3 countries for quiz

Input: Batch mode: 3 countries, no filter

Output: 🇳🇬 Nigeria (AF), 🇯🇵 Japan (AS), 🇨🇦 Canada (NA)

Tips

  • For a geography quiz, generate 10 countries in batch mode and use the capital city field for the question — 'What country has this capital?' — then hide the country name field until the student answers.
  • When testing internationalization in your app, generate countries from each continent to ensure your UI handles all character sets, flag rendering, and long/short country name lengths without layout issues.
  • ISO alpha-2 codes map directly to HTML lang attributes, country select option values, and most payment and address APIs — copy the alpha-2 code directly from the result for immediate use in code.
  • For a travel bucket-list app, use the batch generator to produce 20 random countries, then filter down by continent — this gives you a truly global initial set without manual searching.
  • Flag emojis are universally supported in most chat apps and note-taking tools, making results from this tool easy to share in Slack, Notion, or a WhatsApp group without needing to find image files.

Frequently Asked Questions

How many countries are in the pool?
The pool contains the 195 UN-recognized sovereign states, including all 193 UN member states plus the Vatican City (Holy See) and Palestine, which hold observer status. Territories, dependencies, and disputed regions are excluded.
Are all countries equally likely to be picked?
Yes. Each of the 195 countries in the pool has an equal 1-in-195 probability of being selected on each independent draw, regardless of population, land area, or any other metric.
Which ISO standard are the country codes from?
Codes follow ISO 3166-1, the international standard for country codes. Alpha-2 codes are two-letter (e.g., JP for Japan, DE for Germany) and alpha-3 codes are three-letter (e.g., JPN, DEU). These are the standard identifiers used in software, databases, and international APIs.
Does the region filter change the probability within that region?
When a continent filter is active, each country within that continent has equal probability of selection. The filter simply removes all countries outside the selected continent from the pool.
Do the flag emojis display correctly on all devices?
Flag emojis are part of the Unicode standard and display correctly on modern Android, iOS, macOS, and current Linux distributions. Windows historically displayed text codes instead of flag graphics, though recent Windows 11 versions have improved flag emoji support.
Can I exclude specific countries from the pool?
The current version does not support manual exclusion lists. The region filter is the available constraint mechanism. For use cases requiring fine-grained exclusion, copy the generated list and remove unwanted entries manually.
Is the country data up to date?
The country list and ISO codes are based on the ISO 3166-1 standard as of the tool's last update. Country names and codes are highly stable — significant changes are rare — but for authoritative current data, always cross-reference with the ISO 3166 maintenance agency.
Can I use this to generate random locale codes?
The ISO alpha-2 country codes produced by this tool are the country component of locale codes (e.g., the 'US' in 'en-US'). To construct a full locale, combine the country code with a language code. The tool currently provides only the country component.

Explore the category

Glossary

ISO 3166-1
An international standard published by the International Organization for Standardization that defines codes for the names of countries, dependent territories, and special areas. Alpha-2 (two-letter) and alpha-3 (three-letter) codes are the most widely used variants.
Alpha-2 Code
A two-letter country code from the ISO 3166-1 standard (e.g., US, GB, JP). These are the most widely used country identifiers in software, appearing in locale strings, domain suffixes (ccTLDs), and international APIs.
Alpha-3 Code
A three-letter country code from the ISO 3166-1 standard (e.g., USA, GBR, JPN). Used in passports, sporting event databases, financial systems, and international statistics.
UN Member State
One of the 193 countries that are full members of the United Nations, representing the most internationally recognized set of sovereign nations. The tool's pool adds Vatican City and Palestine as observer states for a total of 195.
Flag Emoji
Unicode characters representing national flags, encoded as sequences of Regional Indicator Symbol Letters (e.g., the UK flag is the sequence 🇬🇧 formed from the letters G and B). Support varies by operating system and application.
ccTLD (Country Code Top-Level Domain)
An internet domain suffix assigned to a country based on its ISO 3166-1 alpha-2 code (e.g., .jp for Japan, .de for Germany). Closely related to but not always identical to the alpha-2 code in use.