UK postcode format explained: what does SW1A 1AA mean?

2025-02-05 · US Address Generator

First, a UK postcode is not a random string

A UK postcode is a Royal Mail sorting code with a strict structure. Lengths range from five to seven characters and always include one space. It splits into an outward code and an inward code. In SW1A 1AA, SW1A is the outward part and 1AA the inward part.

The leading one or two letters of the outward code are the postcode area and map to a broad region; the digits after them are the district within that area. The inward code is a digit plus two letters and pins down one side of a street, often a single building. UK postcodes are therefore far more precise than a US ZIP — which is exactly why a single wrong character drops the address out of the sorting system.

How area letters are allocated

Area codes abbreviate place names, not random values. Central London uses EC and WC, surrounded by E, W, N, NW, SE and SW. Elsewhere: M Manchester, B Birmingham, L Liverpool, LS Leeds, EH Edinburgh, G Glasgow, BT Belfast, CF Cardiff.

A form will often accept "Manchester" next to SW1A 1AA on format alone, but an address-consistency check will flag it. Realistic test data must take both values from the same region.

Famous central London codes

These read as convincingly real in demos — because they are real. They will not, however, be your address.

Line order and the space rule

UK addresses run from the specific to the general, the reverse of Chinese practice:

Mr. James Wilson        ← recipient
Flat 4B, Victoria Court ← unit + building (optional)
24 High Street          ← house number + street
Camden                  ← locality (optional)
LONDON                  ← post town, uppercase
NW1 8QP                 ← postcode
UNITED KINGDOM          ← international only

Three rules that break most often:

  1. Never delete the space. EC1A1BB fails validation in plenty of legacy systems because the regex expects it.
  2. The post town is uppercase. That is Royal Mail convention, not a free city field.
  3. The county is optional now. Royal Mail dropped the requirement years ago; postcode plus post town routes mail completely. Some old forms still ask, and forcing a county can contradict the postcode.

House names in rural areas

Plenty of rural British properties have no number, only a name: Rose Cottage, The Old Rectory, Ivy House. The name takes its own line above the street. A form with only "house number" and "street" boxes cannot take these addresses — keep a free-text premises line.

How to test a UK address form

The UK address generator on this site builds data per constituent country — England, Scotland, Wales, Northern Ireland — with prefixes matching each region, which covers all four checks.

Traps to avoid

For the full multi-line layout, see the UK address format guide.

This article is for learning only. Platform rules may change; always follow official guidance.

Related tools