Standards
ISO 3166 country codes
Codes for countries, dependent territories, and subdivisions under ISO 3166.
- Kind
- Vocabularies
- Steward
- International Organization for Standardization (ISO)
- Official source
- https://www.iso.org/iso-3166-country-codes.html
What it describes
ISO 3166 supplies standardized codes for country names and, in a related part, country subdivisions. Alpha-2, alpha-3, and numeric codes are common in data exchange. The standard provides a controlled representation for geography fields when names vary by language or abbreviation. Its entries follow the standard's scope and maintenance process, which should be distinguished from a system's separate political or legal assertions.
A country code does not prove where an entity is incorporated, resident, operating, or subject to a regulation. Historic codes can be withdrawn or replaced, and subdivisions require the appropriate ISO 3166 part. Keep the original source text and date when normalizing a location. Do not silently map an ambiguous name or disputed territory to a code without stating the rule used.
Structure
ISO 3166-1 provides alpha-2, alpha-3, and three-digit numeric codes; ISO 3166-2 covers subdivisions.
Useful for
- Normalize geographic fields.
- Join multilingual location datasets.
- Record subdivision references.
Limits
- Not proof of legal jurisdiction for an entity.
- Codes can change over time.
- Ambiguous place names need explicit resolution.
How it is used in practice
ISO 3166 supplies the country field of almost every dataset: addresses, shipping records, sanctions entries, user profiles and statistical tables. Part 1 provides the codes for countries and dependent territories, in alphabetic two-letter and three-letter forms and a three-digit numeric form. Part 2 provides codes for the principal subdivisions, such as states and provinces, built on the country code. A maintenance agency keeps the lists and publishes changes when names change, territories are added or codes are withdrawn.
The standard solves a labelling problem. It does not decide political questions. A territory's inclusion reflects the standard's own criteria, and some places have no official code, which leads data users to adopt user-assigned codes that look official but are not.
A worked example
A fictional customer file has a country column containing "UK", "GB", "United Kingdom" and "Great Britain". A cleaning step maps all of them to the alpha-2 code GB. The standard's assigned code for the United Kingdom is GB. UK is not an assigned code, so a validator that accepts only ISO codes would reject it.
The same file contains "NA". In one row it means Namibia, whose alpha-2 code is NA. In another it is a missing-value marker exported from a spreadsheet. A loader that treats "NA" as null by default will turn Namibia into a blank. The cleaning step therefore reads the column as text, validates each value against the current code list, flags rows where the original string differs from the normalized code, and keeps the original. The resulting table can be audited: for each row, what the source said, what the code is, and why.
Evaluating a claim that rests on a country code
A country code in a dataset is the data provider's classification of a location. Ask what location it describes: the address of a legal entity, the place of a transaction, the user's residence, the registered office or the place of operations. These may all differ for one customer, and a field labelled simply country hides the choice.
Check the date and the list version. Codes are added when states are created, and withdrawn when they dissolve or change. Historical data may contain codes that are no longer valid, and the old code is evidence about the data, not an error to correct silently. For claims that depend on jurisdiction, such as a regulation applying to an entity, the code is a pointer to find the legal basis and not the basis itself.
Confusions to avoid
ISO 3166 is not a list of sovereign states, nor a statement of recognition. It is a coding standard with its own scope. It is also not the same as the codes used by other systems: telephone prefixes, internet country-code top-level domains, vehicle registration marks and the codes of some international organizations differ in places, and each should be stored under its own name.
Subdivision codes are often assumed stable and unique across countries. They are unique only in combination with the country code, and they are revised more often than the country list. Record the code as the combination, with the version of Part 2 used.
Questions a reviewer can ask
Which edition of the code list was used to validate values? What does the country field describe: residence, registration, operation or transaction? How were nonstandard strings handled, and were originals kept? Do any values collide with null markers or other parser defaults? How are disputed or recently changed territories treated, and where is the rule written? Is the subdivision code stored with its country?
Maintenance and change
The code lists change in small but real ways. A state changes its name, a territory gains separate status, subdivisions are reorganized, and an alpha-2 code is withdrawn and later may be reassigned after a transition period. Pipelines that validate against a copy of the list taken years ago will reject new codes and accept withdrawn ones. A good practice is to refresh the reference list on a schedule, keep each version, and record which version validated each load. Where a source uses a code that the current list does not recognize, route it to review with the original value rather than dropping or guessing it.
Related terms
Found an error on this page? See corrections for what counts as one, how to report it and the dated log.
Enquiry
Which of your sources carry ISO 3166 country codes?
Tell us which sources carry it, which key the same entity some other way and who may read which. We reply with whether and how a first record would use this vocabulary.
Or write to [email protected] in your own words.