Country Flag Emoji
by Risan Bagja Pradana
JavaScript library listing country codes with their flag emojis, Unicode sequences and country names.
Emoji Code libraryOpen source

1. Price: github.com/risan/country-flag-emoji
Free and open source under the MIT license.
github.com/risan/country-flag-emojiNo quote yet: price is read from the official pages.
2. Commercial use: LICENSE on GitHub
“to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software”
The MIT License allows use and selling in paid products.
LICENSE on GitHub3. Credit the author: LICENSE on GitHub
“The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.”
No credit on screen. Keep the license notice inside the code you ship.
LICENSE on GitHub4. Agent access: github.com/risan/country-flag-emoji
An agent can install it by itself with npm install country-flag-emoji. No key or account is needed.
github.com/risan/country-flag-emojiLicense checked Nov 11, 2026 against 1 official page. Tap a verdict to see its source. How we checked Report an error
Country Flag Emoji: flags and names for every country code
Country Flag Emoji is a small free code library with a list of countries and regions. For each two-letter code like DE or JP it gives the name and the flag emoji. The flags are text characters, so the visitor's own emoji font draws them.
Where you can use it
Flag next to a country code
Your database stores a two-letter code such as FR for each order or user. One call turns it into the country name and its flag for a table or a profile.
Country list for a form
Fill the country menu of a sign-up, shipping or billing form with every name and flag from one list. Typing a few letters can narrow it down.
Flags on a page without a build step
A plain HTML page, like a landing page or an old site, can load the library with one script tag and use the same list.
Sales or visitors by country Idea
Put a flag in front of each country in a small report, such as orders per country, so people find their row at a glance.
Region switcher in the header Idea
Show the flag of the chosen country in a shop's region or currency menu, next to its name, not instead of it.
Country Flag Emoji popularity
Downloads not confirmed by community. 40 GitHub stars for 11.3K downloads a week. Bots and CI installs can inflate npm counts.
GitHub stars stayed at 40 since Nov 12, 2026, so there is no stars chart.
Downloads from api.npmjs.org, stars from GitHub, checked Nov 19, 2026. How the Gid Score is calculated
How to start
Tell your AI assistant
“Add country-flag-emoji 1.0.3 and build a country menu for the checkout form from countryFlagEmoji.list, sorted by name, showing the flag and the name and saving the two-letter code; handle an unknown code (get() returns undefined).”
Show codeStep 1 or Step 2
Add the package to your project.
$ npm install country-flag-emoji
Import it and look up a country by its two-letter code, or use the full list.
import countryFlagEmoji from "country-flag-emoji";
// Array of all country flag emojis
console.log(countryFlagEmoji.list);
// Get country flag emoji for the given country code
console.log(countryFlagEmoji.get("US"));
Mistakes to avoid
const c = countryFlagEmoji.get(code); if (!c) show "Unknown country"get() returns undefined for a code that is not in the list, so reading .name throws.
<script src="https://unpkg.com/country-flag-emoji@latest/dist/country-flag-emoji.umd.js">The docs show @latest; a pinned version cannot change under your page.
In our demo the 258 entries include EU (European Union), UN (United Nations) and small territories such as AC and TA.
The flag is only an emoji character; its look depends on the device font and screen readers read it differently.
License
MIT License. Free for personal and paid products under the MIT License, with no visible credit needed. Keep the short copyright and permission notice with copies of the code.
“to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software” LICENSE on GitHub
“The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.” LICENSE on GitHub
“Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files” LICENSE on GitHub
Passing the files on is allowed with the MIT notice kept.
“The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.” LICENSE on GitHub
AllowedWith conditionsNot allowedNot stated or not checked yet
Is Country Flag Emoji free for commercial use? The full answer Not legal advice. Check the license page before you ship.
For your agent
License rules tell your agent what it may do with Country Flag Emoji. Paste them into your prompt or AGENTS.md.
- Country Flag Emoji (Emoji). JavaScript library listing country codes with their flag emojis, Unicode sequences and country names. Price: free; commercial use OK; no credit needed.
Connect: npm country-flag-emoji.
Rule: Keep the MIT license and copyright notice with any copies or substantial portions you distribute.
Rule: Install via npm (country-flag-emoji) or the unpkg CDN rather than copying data by hand.
Rule: Look up flags by ISO 3166-1 alpha-2 country code with get().
License: https://github.com/risan/country-flag-emoji/blob/HEAD/LICENSE (checked 2026-11-11; details: https://agentgid.com/assets/country-flag-emoji/)
Agent installs a package or loads it from a CDN.
npm install country-flag-emojiCountry data: country-flag-emoji, MIT LicenseAlternatives
Country Flag Emoji This page
Pick Emojibase when you need emoji and flag names in several languages, not only English.
Pick Emoji Mart when people should choose any emoji from a ready picker, not only flags.
Pick Twemoji when emoji, flags included, must look the same as pictures on every device.
Keyword library that makes emoji searchable, mapping each emoji character to a list of keywords.
Emoji data in JSON plus spritesheet images from Apple, Google, Twitter and Facebook sets, distributed on GitHub and npm.
Questions
Can I use it in a paid app?
Yes. The MIT License allows use, copying and selling; keep the copyright and permission notice with copies of the code.
Which codes does it use?
Two-letter codes in the ISO 3166-1 alpha-2 format, such as US or ID.
What does one entry contain?
Four fields, code, unicode (the character sequence), name and emoji.
Is it still updated?
The newest version on the package registry is 1.0.3, published in October 2019.