Part of these Data Solutions
- Explore →
Global Country & Region Reference Data Solution
Authoritative country codes, regions and location reference data to power your location-based solutions.
- Explore →
Logistics Data Solution
Comprehensive reference for shipping codes, container standards and more.
- Explore →
Postal Codes Solution
Every worldwide postal-code dataset in one bundle — the ultimate global reference for precise postal codes.
API Access
Access dataset files directly from scripts, code, or AI agents.
Browse dataset files
API Access
Access dataset files directly from scripts, code, or AI agents.
Each file has a stable URL (r-link) that you can use directly in scripts, apps, or AI agents. These URLs are permanent and safe to hardcode.
Start with these files — they give you everything you need to understand and access the dataset.
- 1. Fetch datapackage.yml to inspect schema and resources
- 2. Download data resources listed in datapackage.yml
- 3. Read README.md for full context
Data Files
Explore with AIcountry-codes
| Field | Type | Description | Constraints | Title |
|---|---|---|---|---|
| FIFA | string | Codes assigned by the Fédération Internationale de Football Association | FIFA code | |
| Dial | string | Country code from ITU-T recommendation E.164, sometimes followed by area code | telephone dialing code | |
| ISO3166-1-Alpha-3 | string | Alpha-3 codes from ISO 3166-1 (synonymous with World Bank Codes) | { "unique": true, "maxLength": 3, "minLength": 3 } | ISO3166-1-Alpha-3 |
| MARC | string | MAchine-Readable Cataloging codes from the Library of Congress | MARC code | |
| is_independent | string | Country status, based on the CIA World Factbook | independent country | |
| ISO3166-1-numeric | string | Numeric codes from ISO 3166-1 | ISO3166-1-numeric | |
| GAUL | string | Global Administrative Unit Layers from the Food and Agriculture Organization | GAUL code | |
| FIPS | string | Codes from the U.S. standard FIPS PUB 10-4 | FIPS code | |
| WMO | string | Country abbreviations by the World Meteorological Organization | { "maxLength": 2 } | WMO code |
| ISO3166-1-Alpha-2 | string | Alpha-2 codes from ISO 3166-1 | { "unique": true, "maxLength": 2, "minLength": 2 } | ISO3166-1-Alpha-2 |
| ITU | string | Codes assigned by the International Telecommunications Union | ITU code | |
| IOC | string | Codes assigned by the International Olympics Committee | { "maxLength": 3 } | IOC code |
| DS | string | Distinguishing signs of vehicles in international traffic | distinguishing signs of vehicles | |
| UNTERM Spanish Formal | string | Country's formal Spanish name from UN Protocol and Liaison Service | UNTERM Spanish Formal | |
| Global Code | string | Country classification from United Nations Statistics Division | global code | |
| Intermediate Region Code | string | Country classification from United Nations Statistics Division | intermediate region code | |
| official_name_fr | string | Country or Area official French short name from UN Statistics Division | official name French | |
| UNTERM French Short | string | Country's short French name from UN Protocol and Liaison Service | UNTERM French Short | |
| ISO4217-currency_name | string | ISO 4217 currency name | ISO4217-currency_name | |
| UNTERM Russian Formal | string | Country's formal Russian name from UN Protocol and Liaison Service | UNTERM Russian Formal | |
| UNTERM English Short | string | Country's short English name from UN Protocol and Liaison Service | UNTERM English Short | |
| ISO4217-currency_alphabetic_code | string | ISO 4217 currency alphabetic code | ISO4217-currency_alphabetic_code | |
| Small Island Developing States (SIDS) | string | Country classification from United Nations Statistics Division | small island developing state (SIDS) | |
| UNTERM Spanish Short | string | Country's short Spanish name from UN Protocol and Liaison Service | UNTERM Spanish Short | |
| ISO4217-currency_numeric_code | string | ISO 4217 currency numeric code | ISO4217-currency_numeric_code | |
| UNTERM Chinese Formal | string | Country's formal Chinese name from UN Protocol and Liaison Service | UNTERM Chinese Formal | |
| UNTERM French Formal | string | Country's formal French name from UN Protocol and Liaison Service | UNTERM French Formal | |
| UNTERM Russian Short | string | Country's short Russian name from UN Protocol and Liaison Service | UNTERM Russian Short | |
| M49 | integer | UN Statistics M49 numeric codes (nearly synonymous with ISO 3166-1 numeric codes, which are based on UN M49. ISO 3166-1 does not include Channel Islands or Sark, for example) | { "unique": true } | M49 |
| Sub-region Code | string | Country classification from United Nations Statistics Division | sub-region code | |
| Region Code | string | Country classification from United Nations Statistics Division | region code | |
| official_name_ar | string | Country or Area official Arabic short name from UN Statistics Division | official name Arabic | |
| ISO4217-currency_minor_unit | string | ISO 4217 currency number of minor units | ISO4217-currency_minor_unit | |
| UNTERM Arabic Formal | string | Country's formal Arabic name from UN Protocol and Liaison Service | UNTERM Arabic Formal | |
| UNTERM Chinese Short | string | Country's short Chinese name from UN Protocol and Liaison Service | UNTERM Chinese Short | |
| Land Locked Developing Countries (LLDC) | string | Country classification from United Nations Statistics Division | land locked developing country (LLDC) | |
| Intermediate Region Name | string | Country classification from United Nations Statistics Division | intermediate region name | |
| official_name_es | string | Country or Area official Spanish short name from UN Statistics Division | official name Spanish | |
| UNTERM English Formal | string | Country's formal English name from UN Protocol and Liaison Service | UNTERM English Formal | |
| official_name_cn | string | Country or Area official Chinese short name from UN Statistics Division | official name Chinese | |
| official_name_en | string | Country or Area official English short name from UN Statistics Division | official name English | |
| ISO4217-currency_country_name | string | ISO 4217 country name | ISO4217-currency_country_name | |
| Least Developed Countries (LDC) | string | Country classification from United Nations Statistics Division | least developed country (LDC) | |
| Region Name | string | Country classification from United Nations Statistics Division | region name | |
| UNTERM Arabic Short | string | Country's short Arabic name from UN Protocol and Liaison Service | UNTERM Arabic Short | |
| Sub-region Name | string | Country classification from United Nations Statistics Division | sub-region name | |
| official_name_ru | string | Country or Area official Russian short name from UN Statistics Division | official name Russian | |
| Global Name | string | Country classification from United Nations Statistics Division | global name | |
| Capital | string | Capital city from Geonames | capital city | |
| Continent | string | Continent from Geonames | { "maxLength": 2, "minLength": 2 } | continent |
| TLD | string | Top level domain from Geonames | TLD | |
| Languages | string | Languages from Geonames | languages | |
| Geoname ID | integer | Geoname ID | { "unique": true } | Geoname ID |
| CLDR display name | string | Country's customary English short name (CLDR) | CLDR display name | |
| EDGAR | string | EDGAR country code from SEC | { "maxLength": 2 } | EDGAR code |
| wikidata_id | string | Wikidata entity URL for the country, sourced via Wikidata SPARQL query on ISO 3166-1 alpha-2 property (P297) | Wikidata ID |
Download
Download CSVAbout
- One row per country or territory with code columns from multiple international standards bodies including ISO 3166, ITU, ISO 4217, UN M49, Geonames, CLDR, EDGAR, and Wikidata.
- Last updated
- 15 October 2026
- Total rows
- ...
- Format
- CSV
- File size
- 134 kB
- Sources
- United Nations Protocol and Liaison Service
- Unicode Common Locale Data Repository (CLDR) Project
- United Nations Department of Economic and Social Affairs Statistics Division
- SIX Interbank Clearing Ltd (on behalf of ISO)
- Statoids
- Geonames
- US Securities and Exchange Commission
- FIFA member associations (inside.fifa.com)
- Wikidata SPARQL endpoint
About this dataset
Country codes
Codes and names for every country and territory that has an ISO 3166-1 entry, in one CSV file. It combines the ISO 3166 alpha-2, alpha-3 and numeric codes with other code systems (ITU, FIPS, IOC, FIFA, WMO and more), telephone dialling codes, ISO 4217 currency codes, UN M49 region groupings, country names in six languages, and identifiers from GeoNames, the SEC (EDGAR) and Wikidata.
Column definitions and types are in datapackage.yml. Provided as a Tabular Data Package: view datapackage.
Data
data/country-codes.csv has one row per country or territory. The columns come from several sources; the table under Data sources shows which source feeds which columns. Rows are sorted by official_name_en, using the sort order of the machine that builds the file, so a few names can change places from one build to another. The columns ISO3166-1-Alpha-2 and ISO3166-1-Alpha-3 are each unique.
Known limitations
-
NAis real data. TheContinentcode for North America isNA, the alpha-2 code of Namibia isNA, and theDSvalue of Bonaire, Sint Eustatius and Saba isNA.pandas.read_csvturnsNAinto a missing value by default, so these cells come back empty. Turn that off and read everything as text:import pandas as pd df = pd.read_csv("data/country-codes.csv", dtype=str, keep_default_na=False) -
Numeric codes have no leading zeros.
ISO3166-1-numeric,M49and the UN region codes are stored as plain numbers, for example4for Afghanistan, where ISO writes004. To get the 3-digit form:df["ISO3166-1-numeric"] = df["ISO3166-1-numeric"].str.zfill(3)ISO4217-currency_numeric_codekeeps its leading zeros (for example008), so read it as text too. -
Some empty cells are not empty. Where Statoids has no code, the cell holds a single non-breaking space (U+00A0) instead of nothing. This happens in
FIFA,Dial,MARC,FIPS,WMO,ITU,IOCandDS; a few other cells (for exampleCapital) have stray spaces. Remove them after reading:df = df.apply(lambda col: col.str.strip()) -
One cell can hold several values, separated by commas. For example
DialforDOis1-809,1-829,1-849,Languageslists several language codes, and countries with two currencies have two values in eachISO4217-currency_*column, in the same order (for exampleBThasINR,BTNand356,064). Use.str.split(",")to separate them. -
Not every column is filled for every row. The
UNTERM ...columns are empty for many territories and for some countries (for exampleAQ,HKandCI).EDGARis matched by country name, so it is empty where the SEC name differs (for exampleCAandUS). The region columns are empty for Antarctica (AQ). The optional UN groupings (Least Developed Countries (LDC),Land Locked Developing Countries (LLDC),Small Island Developing States (SIDS)) are empty unless the country is in that group. -
A few
FIFAvalues are not 3-letter codes (for example1forGBandROS3forAQ). The pipeline leaves a value as it is when neither it nor the country's ISO alpha-3 code is on the FIFA list. Check this column before relying on it. -
wikidata_idis a full URL, for examplehttps://www.wikidata.org/wiki/Q889, not just theQnumber. -
Only ISO 3166-1 entries have a row. Kosovo (
XK), for example, has none.
Data sources
The licence column says what we found about reuse; see License for what was checked.
| Source | Columns it feeds | Licence |
|---|---|---|
| UN Protocol and Liaison Service, UNTERM names | UNTERM <language> Short and UNTERM <language> Formal, for English, French, Spanish, Russian, Chinese and Arabic | Restricted. The UN website terms of use allow downloading and copying "for the User’s personal, non-commercial use, without any right to resell or redistribute them or to compile or create derivative works therefrom". The file is hosted on un.org and we found no separate licence for it. |
| UN Statistics Division, M49 | ISO3166-1-Alpha-3, M49, official_name_en, official_name_fr, official_name_es, official_name_ar, official_name_cn, official_name_ru, Global Code, Global Name, Region Code, Region Name, Sub-region Code, Sub-region Name, Intermediate Region Code, Intermediate Region Name, Least Developed Countries (LDC), Land Locked Developing Countries (LLDC), Small Island Developing States (SIDS) | Licence unclear. The page states no licence. The UN website terms quoted above probably apply to it, but we could not confirm that. |
| Statoids | ISO3166-1-Alpha-2, ISO3166-1-numeric, ITU, FIPS, IOC, FIFA (first pass), DS, WMO, GAUL, MARC, Dial, is_independent | Licence unclear. The site carries a copyright notice and states no licence or permission to reuse. |
| SIX Group, ISO 4217 list one | ISO4217-currency_country_name, ISO4217-currency_name, ISO4217-currency_alphabetic_code, ISO4217-currency_numeric_code, ISO4217-currency_minor_unit | Licence unclear. SIX publishes the list free of charge and states no licence for the XML file. |
| FIFA member associations | FIFA (checks and corrects the Statoids value, and fills it when empty) | Licence unclear. The terms of this page have not been read. |
| ISO (the codes themselves) | ISO3166-1-Alpha-2, ISO3166-1-Alpha-3, ISO3166-1-numeric and the ISO4217-currency_* codes | Licence unclear. ISO allows "free-of-charge use of its country, currency and language codes" and also says "Any use, including reproduction requires our written permission." |
| GeoNames | Capital, Continent, TLD, Languages, Geoname ID | CC BY 4.0. Credit to GeoNames is required (see ATTRIBUTION.txt). |
| Unicode CLDR | CLDR display name | Unicode License v3. The copyright and permission notice must travel with the data; it is in ATTRIBUTION.txt. |
| SEC EDGAR | EDGAR | Free to copy and share. The SEC asks for a citation but does not require one. |
| Wikidata | wikidata_id | CC0 (public domain). |
Notes on the sources:
- The UN short names, M49 codes and region groupings come from the M49 lists, which the UN Statistics Division bases on UNTERM. They are the UN's short forms, not ISO 3166 names, so some differ: for example
official_name_enisIvory CoastforCI, where the ISO 4217 list and CLDR useCôte d’Ivoire. CLDR display nameis the customary English short name from CLDR, for exampleSouth Korea. The ISO 4217 country names are in capitals, as SIX publishes them.- The Statoids country-code table was last updated in 2016 (see License), so some of its codes may lag behind the standards. FIFA codes are checked against FIFA's own list for that reason.
Changes made to the source data: the scripts in scripts/ download each source and join the tables into one file by ISO alpha-3 code, alpha-2 code or country name (UNTERM names are matched to the UN English names with a fuzzy matcher that must give a perfect score, SIX names by exact match after a fixed list of name fixes, and EDGAR names by exact match to the SIX country names). Columns are renamed and reordered, duplicate rows are dropped, and rows are sorted by official_name_en. UNTERM rows that are not complete in all six languages are skipped. SIX entries marked as funds are skipped, and when a country has several currencies the values are joined with commas. For CLDR, where a name has a -alt-short form (for example BA-alt-short), that shorter name is used; -alt-variant names, numeric region codes and the codes ZZ, EZ and EU are ignored. FIFA values that are not on FIFA's list are replaced by the country's ISO alpha-3 code when that code is on the list. For Wikidata, the entity ID is turned into a URL, and a few duplicate or retired items are removed. No GeoNames, CLDR, SEC or Wikidata value is otherwise edited.
Not endorsed by, or affiliated with, the United Nations, ISO, SIX Group, Statoids, FIFA, GeoNames, Unicode, Inc., the U.S. Securities and Exchange Commission or Wikidata.
Preparation
The file is rebuilt from the live sources by running the scripts. You need:
-
Python 3 (the workflow uses 3.12) and the packages in
scripts/requirements.txt, which include csvkit (thein2csv,csvjoinandcsvcuttools), Selenium, pandas and Frictionless:pip install -r scripts/requirements.txt -
Google Chrome. The EDGAR step (
scripts/edgar.py) drives it through Selenium because the SEC site refuses plain downloads. On a server without a display, also install Xvfb and start it first:Xvfb :99 -screen 0 1024x768x24 & export DISPLAY=:99 -
curlfor the Wikidata step, and theen_US.UTF-8locale for the row sorting inscripts/reorder_rows.py.
Then, from the repository root:
make update
make clean
make update downloads the sources and rebuilds data/country-codes.csv; make clean deletes the temporary files it leaves in data/. make test checks the result with frictionless validate datapackage.yml.
The six UN M49 files in tmp/ (UNSD-en.csv, UNSD-fr.csv, UNSD-es.csv, UNSD-ar.csv, UNSD-cn.csv, UNSD-ru.csv) are committed to this repository and read by scripts/iso3166.py. make update does not download them, so the UN M49 region codes and the UN names in six languages only change when someone replaces these files. To refresh them, download the six language versions from the M49 page, rename them to the names above and copy them into tmp/. No manual step is needed for a normal make update.
A GitHub workflow (.github/workflows/actions.yml) runs the same steps with Xvfb on the 1st of every month at 00:00 UTC, on every push to main, and on demand. It commits data/country-codes.csv if it changed.
License
This file combines data from several sources whose terms differ. Where they are clear, they are given in the table above. In short:
- Restricted: the
UNTERM ...columns. The UN terms quoted above allow personal, non-commercial use and give no right to redistribute or to create derivative works. The file is compiled from these names and redistributes them. - Clear, with credit or a notice: GeoNames (CC BY 4.0, credit required), Unicode CLDR (notice required), SEC EDGAR (citation requested). Wikidata is CC0.
- Licence unclear: the UN Statistics Division M49 columns, Statoids, SIX Group, FIFA, and ISO's own rights in the codes.
What was checked, and what could not be established:
- UN: the UN website terms of use and copyright page. We found no UNTERM or M49 licence that replaces them.
- Statoids: the site has copyright notices and no licence page. It also sells its administrative-division spreadsheets under reuse limits (those are different files from the free code table). Its founder, Gwillim Law, died in 2016; the site is now run by his family, and the country-code table was last updated in 2016.
- SIX Group: the data standards page says the lists are free of charge, but there is no licence for the XML file. The SIX website terms say the content of the SIX website may not be reproduced or reused commercially; they do not say whether that covers the XML.
- ISO: the sentence quoted in the table, read on ISO's page.
- FIFA: we did not read any terms.
We could not establish whether the unclear sources allow republishing or commercial use. Before using this file in a public or commercial product, check the terms of the sources marked restricted or unclear.
The maintainers place only their own work (the scripts, and the selection and arrangement of the data) under the Public Domain Dedication and License (PDDL). This does not cover the data taken from the sources and does not remove the UN restriction. See also ATTRIBUTION.txt.