Loading...

Mrs. Jane Williams

42 High Street

Kensington

London

SW7 5AB


Key Components


Building Number or Name


Unlike the US, many UK properties have names instead of numbers. A cottage might be addressed as "Rose Cottage" rather than a numeric house number. Forms should allow both.


Street Name


UK street names use terms like Street, Road, Lane, Avenue, Close, Crescent, Terrace, and Gardens. Some streets use unique British naming like "The Broadway" or "High Street" (the most common street name in the UK).


Locality and Post Town


The locality is an optional line used when the post town alone is not enough to identify the area. The post town is the main sorting office town and is always written in capitals by convention. Common post towns include LONDON, BIRMINGHAM, MANCHESTER, EDINBURGH, and CARDIFF.


County


Historically, UK addresses included the county (e.g., "Oxfordshire," "Kent"). Royal Mail no longer requires the county for mail delivery, but many forms still include it. Developers should make this field optional.


Understanding UK Postcodes


The UK postcode is the most distinctive part of a British address. It consists of two parts separated by a space:


  • Outward code (first part) - identifies the postal district
  • Inward code (second part) - narrows it down to a specific group of addresses

  • Postcode Format Patterns


    UK postcodes follow one of these formats, where A = letter and 9 = digit:


    | Format | Example |

    |-----------|-----------|

    | A9 9AA | M1 1AE |

    | A99 9AA | B33 8TH |

    | A9A 9AA | W1A 1HQ |

    | AA9 9AA | CR2 6XH |

    | AA99 9AA | SW1A 1AA |

    | AA9A 9AA | EC1A 1BB |


    Validation Regex


    A commonly used regex pattern for UK postcodes:


    ^[A-Z]{1,2}[0-9][0-9A-Z]?\s?[0-9][A-Z]{2}$


    Note: This is case-insensitive in practice, so always convert to uppercase before validation.


    Special Postcodes


  • GIR 0AA - The old Girobank postcode (no longer used for new mail)
  • BFPO codes - British Forces Post Office addresses for military locations
  • Postcodes starting with **BT** are in Northern Ireland

  • Differences from US Addresses


    | Feature | US | UK |

    |---------|----|----|

    | Postal code type | Numeric (5 digits) | Alphanumeric (6-7 chars) |

    | State/region | Required (2-letter state code) | County optional |

    | City placement | Same line as state and ZIP | Own line (post town) |

    | Building identification | Always numeric | Numeric or named |


    Tips for Developers


  • **Make county optional** - Royal Mail does not require it
  • **Accept both cases for postcodes** - Users enter mixed case; normalize to uppercase
  • **Validate outward and inward codes separately** - The space between them is significant
  • **Support building names** - Do not enforce numeric-only house numbers
  • **Do not combine city and postcode on one line** - UK convention puts them on separate lines
  • **Test with real postcode patterns** - Use a UK address generator to create realistic test data covering all six format variations
  • Related Articles

    What Is a Fake Address Generator and How to Use OneUS Address Format Guide: How to Write American AddressesAddress Formats Around the World: A Developer Guide