Country Flags
High-quality flag images from flagcdn.com for all countries
Add country dropdowns easily with ISO codes, flags, phone dial codes, currencies & languages. Optimized for React, Next.js, Vue & Node.js. Free and lightweight.
High-quality flag images from flagcdn.com for all countries
International calling codes for every country
ISO 3166-1 alpha-2 country codes
Currency codes, names, and symbols
Capital city information for each country
Official and widely spoken languages
Choose your preferred framework and start building!
// Import the package
const countryData = require('country-code-data');
// Get all countries
const allCountries = countryData.getAllCountries();
// Get country by name
const usa = countryData.getCountryByName('United States');
// Get country by ISO code
const bd = countryData.getCountryByShortName('BD');
// Get country by phone code
const uk = countryData.getCountryByCode('+44');
// Sample output
console.log(bd);
/* {
"id": 14,
"name": "Bangladesh",
"shortName": "BD",
"code": "+880",
"flag": "https://flagcdn.com/w40/bd.png",
"capital": "Dhaka",
"currency": {
"code": "BDT",
"name": "Bangladeshi Taka",
"symbol": "৳"
},
"languages": ["Bengali"]
} */