Alpha-2 and alpha-3 are identification formats
ISO 3166-1 defines two-letter alpha-2 codes, three-letter alpha-3 codes and a three-digit numeric form. These facilitate international data exchange but do not decide nationality or political status.
“Việt Nam,” “Vietnam” and “Viet Nam” may correspond to VN or VNM. The same identifier does not guarantee equal observation years or data definitions. Never derive alpha-3 from initials or by appending characters to alpha-2; use a validated official correspondence table.
A country can appear under different names
Country names are translated, shortened and sometimes updated. Standard identifiers make matching easier but require a dated reference. Historical files may use codes that later changed. The alpha-2 and alpha-3 lists are separately specified; do not invent one from the other.
Distinguish ISO, UN M49 and API identifiers
UN Statistics Division's M49 classification is used in country and regional statistics. A data API may use its own three-character identifier that resembles ISO alpha-3 without matching it in every case. When a code appears in a World Bank URL, check that API's documentation before joining it to an ISO column. Use an explicitly sourced mapping table, investigate exceptions and keep the full country name when exporting data.
For example, make a three-row table with columns for country name, alpha-2 and alpha-3: Vietnam–VN–VNM, Japan–JP–JPN and United States–US–USA. Import codes as text to preserve their characters; do not mistake a two-letter country code for a language name. Store language codes, currencies and time zones in separate fields for a multi-country application. Countries may use several languages or time zones, so neither language nor time zone can reliably be inferred from the country code alone.
Vietnam, Japan and the United States as examples
Common pairs are VN/VNM, JP/JPN and US/USA. Label the alpha-2 and alpha-3 columns and confirm them against ISO before publication. An individual service may have its own internal identifiers.
UN M49 supplies three-digit statistical identifiers, and ISO 3166-1 also has a numeric format; the lists must not be assumed identical for every entity or date. Regional aggregates such as Europe are different from individual countries.
| Country | Alpha-2 | Alpha-3 |
|---|---|---|
| Vietnam | VN | VNM |
| Japan | JP | JPN |
| United States | US | USA |
Alpha-2 and alpha-3 are different code lengths; there is no safe universal rule for assembling or cutting letters.
Country identifiers are not language identifiers
ISO 3166 describes geographical units, ISO 639 describes languages and IANA defines geographical time zones. One state may use several languages or zones, while a language spans many countries. Converting US directly to “English” or one local clock is an application-design mistake.
Use codes correctly in nhanto tables
When exporting /en/country-data/, preserve both a readable name and original code. If joining tables fails, check case, spaces, coding family and known exceptions. Do not invent temporary codes to hide missing matches. Retain reference versions and test historical and territorial entries.
For travel forms, reservations and legal documents, use the code scheme required by the specific operator. A code that works in one dataset may not be accepted by another. An alpha code is an identifier in a particular standard, not a translated country name or a universal permit to travel. A code can change as standards are updated, and other datasets can use different schemes. Keep the scheme and version alongside any stored identifier so the original entity can still be traced accurately.
Sources
nhanto is responsible for this content. The links below are references; this does not certify that every claim has been independently verified.
- Country codes — ISO 3166 · ISO
ISO 3166-1 alpha-2, alpha-3 and numeric definitions
- Standard country or area codes for statistical use (M49) · United Nations Statistics Division
UN M49 versus ISO coding scope
- How does the World Bank classify countries? · World Bank
Geographical codes are distinct from language and time-zone identifiers
Topics · nhanto · practical-guides