The UK Postcode Format

Author

Doaa Kurdi

Updated

2023-11-15

The UK postcode consists of five to seven alphanumeric characters which was created by Royal Mail. A full postcode designates an area with multiple addresses or a single delivery point. If you're looking to accurately search for an address from a postcode, try our postcode lookup tool.

Key Patterns

UK postcodes can assume one of the following patterns:

Postcode Format Outward Code Inward Code Postcode Area District Code Sub-District Sector Unit
AA9A 9AA AA9A 9AA AA AA9 AA9A AA9A 9 AA
A9A 9AA A9A 9AA A A9 A9A A9A 9 AA
A9 9AA A9 9AA A A9 N/A A9 9 AA
A99 9AA A99 9AA A A99 N/A A99 9 AA
AA9 9AA AA9 9AA AA AA9 N/A AA9 9 AA
AA99 9AA AA99 9AA AA AA99 N/A AA99 9 AA

N/A means not applicable

Postcode Components

Postcodes can also be broken down into meaningful constituent components.

Postcode Components

Definitions

Outward Code

The outward code is the first half of a postcode (before the space). Some are non-geographic, i.e. does not divulge the location.

Distinguishing features include:

  • 2-4 characters long
  • Always begins with a letter
  • May end with a number or letter

Examples of outward codes include:

  • L1
  • W1A
  • RH1
  • RH10
  • SE1P

CSV Download full list of UK outward codes.

Inward Code

The inward code is the second half of a postcode (after the space). The inward code assists in the delivery of post within a postal district.

Its distinguishing features are:

  • Exactly 3 characters long
  • Always begins with a number

Examples of inward codes:

  • 0NY
  • 7GZ
  • 7HF
  • 8JQ

CSV Download full list of UK inward codes.

Postcode Area

The postcode area is the longest initial string of letters in a postcode.

Examples include:

  • L (Liverpool)
  • EH (Edinburgh)
  • BT (Northern Ireland)

Check our list of postcode areas for reference.

CSV Download full list of UK postcode areas.

District Code

The district code is part of the outward code. It is between two and four characters long. It does not include the trailing letter found in some outcodes.

Examples of district codes include:

  • L1
  • W1
  • RH1
  • RH10
  • SE1

CSV Download full list of UK postcode districts.

Sub-District Code

The sub-district code is part of the outward code. It is often not present, only existing in particularly high density London districts. It is between three and four characters long. It does include the trailing letter omitted from the district.

Examples of Sub-District codes:

  • W1A
  • EC1A
  • NW1W
  • E1W
  • SE1P

CSV Download full list of UK postcode sub-districts.

Sector

The postcode sector is made up of the postcode district, the single space, and the first character of the inward code. It is between four and six characters long (including the single space).

Examples of postcode sectors:

  • SW1W 0
  • PO16 7
  • GU16 7
  • L1 8
  • CV1 4

CSV Download full list of UK postcode sectors.

Unit

The postcode unit is the last two letters of a postcode.

Each postcode unit generally represents:

  • a street
  • part of a street
  • a single address
  • a group of properties
  • a single property
  • a sub-section of the property
  • an individual organisation or (for instance Driver and Vehicle Licensing Agency)
  • a subsection of the organisation

The level of discrimination is often based on the amount of mail received by the premises or business.

Examples of postcode units:

  • NY (from SW1W 0NY)
  • GZ (from PO16 7GZ)
  • HF (from GU16 7HF)
  • JQ (from L1 8JQ)

CSV Download full list of UK postcode units.

Code

We publish an open sourced library called Postcode. This package allows you to extract parts of a postcode outlined above.

Ideal Postcodes Address Validation is a great solution to ensure your data is accurate and up-to-date. We offer comprehensive data with every postcode, incorporating premise-level address information, unique property reference numbers (UPRNs), geolocations and more.