🌍 Country Code Data

Country Code Data for React & Node.js – ISO Codes, Flags, Phone Codes

Add country dropdowns easily with ISO codes, flags, phone dial codes, currencies & languages. Optimized for React, Next.js, Vue & Node.js. Free and lightweight.

npm install country-code-data
200+ Countries
~48KB Package Size
0 Dependencies
100% TypeScript
🏴

Country Flags

High-quality flag images from flagcdn.com for all countries

📞

Phone Codes

International calling codes for every country

🔤

ISO Codes

ISO 3166-1 alpha-2 country codes

💰

Currency Data

Currency codes, names, and symbols

🏛️

Capital Cities

Capital city information for each country

🗣️

Languages

Official and widely spoken languages

Interactive Demo - Search Countries

Quick Start - Code Examples

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"]
} */