ISO 3166 is a global standard published by the International Organization for Standardization (ISO). It provides unambiguous identifiers for countries and regions using alpha-2 (e.g., CN), alpha-3 (e.g., CHN), and numeric codes. The standard facilitates cross-border trade, data exchange, and network security, and is compatible with China's national standard GB/T 2659.
What is the ISO 3166 standard
The ISO 3166 standard is established by the International Organization for Standardization (ISO) and is primarily used to provide a unified coding system for countries and regions worldwide. By combining the ISO 3166 standard with ESA's rules, you can precisely identify and manage geographic locations to improve network performance, security, and user satisfaction.
Components of the ISO 3166 standard
The ISO 3166 standard consists of three parts:
ISO 3166-1
ISO 3166-1 defines codes for countries, dependent territories, and other areas of special geopolitical interest. It includes three code formats:
-
alpha-2 code: This two-letter code is the most widely used format and is often used for country code top-level domains (ccTLDs)(for example,
.thfor Thailand). In rule configurations, theip.geoip.countryfield uses the ISO 3166-1alpha-2 codeformat, such asTHfor Thailand. -
alpha-3 code: A three-letter code that more closely resembles the country's English name. For example, the alpha-3 code for Singapore is SGP.
-
numeric code: A three-digit code used in language-independent contexts.
ISO 3166-2
ISO 3166-2 defines the subdivision code for the principal administrative regions within a country, such as provinces or states. Each subdivision code extends the country's ISO 3166-1 alpha-2 code by adding a hyphen and up to three alphanumeric characters. This format enables more granular geographic targeting. In rules, the value for ip.geoip.country can also be an ISO 3166-2 code. For example, ID-JC represents Central Java Province in Indonesia.
ISO 3166-3
ISO 3166-3 provides codes for the names of former countries, such as Czechoslovakia. These codes are primarily used for historical records and data archives.
Corresponding Chinese national standards
The Chinese national standard corresponding to ISO 3166 is GB/T 2659. For more information, see the China National Standards website.
-
Standard: GB/T 2659.1-2022, Codes for the representation of names of countries and their subdivisions—Part 1: Country codes.
-
Standard: GB/T 2659.2-2022, Codes for the representation of names of countries and their subdivisions—Part 2: Subdivision codes.
-
Standard: GB/T 2659.3-2023, Codes for the representation of names of countries and their subdivisions—Part 3: Codes for formerly used names of countries.
How to find the latest ISO 3166 codes
The ISO 3166 Maintenance Agency (ISO 3166/MA) maintains the standard, ensuring the codes are accurate and up to date. You can find the latest codes at the following links.