A clean, lightweight, and developer-friendly JSON dataset containing a comprehensive list of countries and territories with their standardized country codes.
This repository is designed to be simple, reusable, and framework-agnostic, making it ideal for applications that need country selection, geolocation, internationalization, or global configuration support.
countries.json– A JSON array of country objects with:name– Official or commonly used country/territory namecode– ISO 3166-1 alpha-2 country code
{
"name": "India",
"code": "IN"
}- ✅ 240+ countries & territories
- ✅ ISO 3166-1 alpha-2 country codes
- ✅ Clean and consistent JSON structure
- ✅ Ready for frontend & backend usage
- ✅ Perfect for dropdowns, filters, and forms
- ✅ Easy to extend and maintain
- 🌍 Country selector dropdowns
- 📦 Address & shipping forms
- 🌐 Internationalization (i18n)
- 📊 Analytics & reporting
- 📱 Mobile and web applications
- 🔌 API integrations
- 🧩 Configuration files
https://raw.githubusercontent.com/ameerzain/countries/main/countries.json
fetch('https://raw.githubusercontent.com/ameerzain/countries/main/countries.json')
.then(response => response.json())
.then(data => console.log(data));import requests
url = "https://raw.githubusercontent.com/ameerzain/countries/main/countries.json"
countries = requests.get(url).json()
print(countries)<select>
<option value="IN">India</option>
<option value="US">United States</option>
<option value="GB">United Kingdom</option>
</select>ℹ️ Note:
This dataset is served via GitHub Raw and is suitable for light to medium usage.
For high-traffic production environments, consider caching or self-hosting the file.
[
{
"name": "India",
"code": "IN"
},
{
"name": "United States",
"code": "US"
}
]Contributions are welcome!
- Add missing countries or territories
- Improve naming consistency
- Update deprecated country codes
- Add additional metadata (flags, calling codes, regions)
This project is open-source and available under the MIT License.
Ameer Zain
GitHub: https://github.com/ameerzain
If you find this repository useful, consider giving it a ⭐ to support the project.
Happy coding! 🚀