Guidance

Use consistent country codes

Updated 9 August 2022

Use the ISO 3166-1:2013 country codes standard for services and data that reference countries.

1. Summary of the standard’s use for government

This standard enables anyone creating or searching government datasets to use a list of accurate and consistent country codes.

You should use 2-letter ISO 3166-1 alpha-2 codes. For the UK, use the following extended codes:

  • GB-ENG for England
  • GB-NIR for Northern Ireland
  • GB-SCT for Scotland
  • GB-WLS or GB-CYM for Wales

The government chooses standards using the open standards approval process and the Open Standards Board has final approval. Read more about the process of choosing the country codes standard.

2. How this standard meets user needs

The users are government workers who need to record, search, reuse or exchange data which has worldwide geographical information. The systems that hold this data need to use accurate country information to provide consistent data between systems.

Users of this standard include:

  • publishers of government data
  • data scientists
  • data analysts
  • developers

Having multiple names and spelling for countries can cause inconsistencies across different data sets. The country codes standard reduces this problem by using a uniform way to identify countries.

Other benefits of this standard include:

  • improving the quality of data
  • reducing duplication of resources and effort
  • reducing ambiguity caused by alternative names for a country

3. How to use the standard

The list of countries published in ISO 3166 currently contains 249 countries. The Foreign and Commonwealth Office’s (FCO) Geographical names index, is a subset of ISO 3166 and currently lists 195 countries that are officially recognised by the UK.

In addition to the country code for each country, the ISO 3166 standard also has:

  • the English name
  • the indigenous name
  • any common aliases
  • the dates during which the codes were/are valid

You can use the dates to tell which countries or country codes no longer exist. For example, the Union of Soviet Socialist Republics (USSR) has an end-date of `1991-12-25’.

The ISO 3166 Maintenance Agency regularly updates the country codes based on information from the United Nations. The agency sends notifications of any changes they make to the standard so you can download the latest version.

Although ISO 3166 is usually backwards compatible, if a code remains unused for 15 years the ISO standard might reuse it to represent another country. This means you should consider country codes as temporary, especially when you’re using the code to infer borders, flags, political structure, and other attributes of the country.