UN M49 or the Standard Country or Area Codes for Statistical Use is a standard for area codes used by the UnitedNations for statistical purposes, developed and maintained by the United Nations Statistics Division. Each area code is a 3-digit number which can refer to a wide variety of geographical, political, or economic regions, like a continent, a country, or a specific group of developed or developing countries. Codes assigned in the system generally do not change when the country or area's name changes, but instead change when the territorial extent of the country or area changes significantly, although there have been exceptions to this rule. Some of these codes, those representing countries and territories, were first included as part of the ISO 3166-1 standard in its second edition in 1981, but they have been released by the United Nations Statistics Division since 1970. Another part of these numeric codes, those representing geographical supranational regions, was also included in the IANA registry for region subtags for use within language tags, as specified in IETF's BCP 47.
Beside the codes standardized above, the numeric codes 900 to 999 are reserved for private-use in ISO 3166-1 and in the UN M.49 standard. They may be used for any other groupings or subdivision of countries, territories and regions. Some of these private-use codes may be found in some UN statistics reports and databases, for their own specific purpose. They are not portable across databases from third parties, and may be changed without notice. Note that the code000 is reserved and not used for defining any region. It is used in absence of data, or for data in which no region is applicable. For unknown or unencoded regions, private-use codes should preferably be used.
Extensions to M.49
Early editions of M.49 used one- or two-digit prefixes to designate economic regions rather than assigning 3-digit codes. These two digit prefixes were designed to be used to easily aggregate data through the use of prefix matching, and regions could be specified collectively by using the 000 code as a base to which the prefix would be added. For example, by prefixing 13 to Algeria's code, 012, to create the five-digit code 13012, Algeria could be identified as being in North Africa, which is itself in Africa. One-digit suffixes were also permitted, to specify statistics of subdivisions of countries. For example, by suffixing 5 to the code for the United Kingdom to create the four-digit code 8265, Scotland could be represented as a subdivision of the United Kingdom. Additional suffixes could be used to represent the other constituent units of the UK.