Country codes

Which codes customs and carriers use, how alpha-2, alpha-3 and numeric differ, and the exceptions that trip up forms and data feeds.

Customs systems and carriers use the two-letter ISO 3166-1 code for a country in most fields, such as GB, DE or CA. The standard has a three-letter form and a three-digit form as well, so check which your form wants, because they aren't interchangeable. The table below shows each country's two-letter code and currency.

ISO 3166 has three parts

ISO 3166 has three parts
ISO 3166-1Countries and areas of particular geopolitical interestDE, DEU, 276
ISO 3166-2Subdivisions, using the alpha-2 code plus up to three charactersUS-CA for California, ID-RI for Riau
ISO 3166-3Names deleted since the first edition in 1974Former country names

Part 1 has three forms:

ISO 3166 has three parts
Alpha-22 lettersDERecommended for general use, and on most customs fields
Alpha-33 lettersDEUSome data feeds, travel documents, older systems
Numeric3 digits276Useful outside Latin script. Assigned by the UN

ISO publishes the codes through its Online Browsing Platform. ISO adds and changes entries from time to time, so don't hard-code a list you downloaded once.

Exceptions you'll actually hit

  • GB, not UK. The ISO code for the United Kingdom is GB. Writing "UK" is a common cause of rejected address data, even though the country's name uses it.
  • XI for Northern Ireland. This isn't an ISO country code. It's used in EU and UK customs and VAT contexts for Northern Ireland, for example on an EORI or a VAT number under the Windsor Framework.
  • EL for Greece, in VAT. The ISO code is GR, but EU VAT numbers use the prefix EL. An EORI starts with the two-letter code of the issuing country, so check the format per system rather than assume.
  • EU isn't a country. Origin is usually declared at country level, unless a rule says otherwise. On the US Section 301 schedule, for example, the EU has its own headings.
  • Territories have their own codes. Hong Kong (HK), Macao (MO), Puerto Rico (PR) and others are listed separately in ISO 3166-1. The customs treatment doesn't always follow the same line, so check the tariff.

Other codes that travel with them

Other codes that travel with them
ISO 4217CurrencyGBP, EUR, USDISO
UN/LOCODEPorts and other trade locationsGBFXT for FelixstoweUNECE
HS codeGoods6912.00WCO
EORIBusiness, for EU and GB customsDE plus up to 15 charactersCommission and HMRC
IncotermsSale termsFCAICC

UN/LOCODE is five characters: the two-letter ISO country code, then three for the place. A customs or carrier system may also have its own port codes, such as the US Schedule D codes, so a LOCODE doesn't always fit.

Things to get right

Use the code for the country of origin on your commercial invoice, and keep it separate from the code for the country you shipped from, because the two are often different. In your own systems, store the code as a coded field with validation, and don't accept free text. When you connect to a data feed or a carrier's system, check whether it wants alpha-2 or alpha-3, and map to that: a three-letter code in a two-letter field usually fails at the worst time. For why the origin field matters so much, see country of origin.

Sources