What Do Two-Letter Country Codes Mean?

Learn to read alpha-2 and alpha-3 labels in directories and country datasets.

Atlas Roulette compass artwork for What Do Two-Letter Country Codes Mean?

Try the codes in search

Search CA, CAN, or Canada in the country picker. Then try GB for the United Kingdom. Read the code field in each profile to confirm the match. The atlas also retains the dataset’s XK label for Kosovo, a commonly used extension outside the official ISO assignment.

Alpha-2, alpha-3, and numeric codes

The two-letter form is useful in compact tables and software interfaces. A three-letter form is often easier to recognize in a dataset. ISO 3166 also defines numeric codes. Keep leading zeros if you store a numeric code as text. Every column should have a label that identifies its standard, especially when several code systems appear together.

Worked example: join two datasets

Suppose one list calls the United States “United States” and another calls it “United States of America.” A shared code can make the join more reliable than comparing names. Convert both tables to the same code format, check for duplicate rows, and review records left unmatched. Match on the code only when the two datasets cover the same geographic scope.

Cases worth checking manually

GB is the ISO alpha-2 code used in this atlas for the United Kingdom. You may still encounter UK in other contexts. XK is a common Kosovo label used by this atlas and sits outside the official ISO assignment. For an application that accepts user input, record which aliases you support and keep them separate from the standard code values. See GB and GBR in the UK profile.

Avoid mixing dialing and domain conventions

A calling code can cover more than one country or territory. A domain name suffix follows internet naming rules. A familiar two-letter string can therefore appear in more than one system with a different purpose. Before reusing a list, check which field it contains and what its owner considers a valid entry.

Spot four common data-entry errors

Check that alphabetic codes are in the expected case and length, that numeric codes retain leading zeros, that informal aliases are tagged, and that the country scope matches the dataset. A directory may display a common country name while storing a code behind it. Use the source’s official code list to validate an unfamiliar entry before importing it.

Common questions

Why is Great Britain’s code GB?

GB is the assigned alpha-2 value for the United Kingdom in ISO 3166. The display name and the code do not always use the same words. Open the official assignment when a common abbreviation differs from the value in your dataset.

Can one code identify multiple datasets?

A shared country code can be used as a join key when both datasets use the same standard and geographic coverage. Review unmatched records, duplicate codes, and any dataset-specific extensions. Keep a note of mappings you add manually so another person can repeat the join.

Keep exploring

Sources