PAF & UK Address Data

UK postcode format explained

UK postcodes follow a small set of well-defined patterns. Knowing them helps you validate input — but only a PAF lookup confirms a postcode truly exists.

No card required · Royal Mail PAF-verified data

Trusted UK address intelligence

31M+
UK addresses
1.8M
Postcodes
99.9%
Uptime
PAF-verified address lookup
Fast REST API & no-code plugins
GDPR-friendly, UK-hosted

A UK postcode is always made of an outward code and an inward code, with the inward code fixed at three characters: a digit followed by two letters.

The valid formats

  • A9 9AA — e.g. M1 1AE
  • A99 9AA — e.g. M60 1NW
  • AA9 9AA — e.g. CR2 6XH
  • AA99 9AA — e.g. DN55 1PT
  • A9A 9AA — e.g. W1A 0AX
  • AA9A 9AA — e.g. EC1A 1BB

Validation vs verification

Regex can confirm a string looks like a postcode, but it can't tell you whether it's real. A typo like "SW1A 9ZZ" may pass a pattern check yet not exist. To truly verify, check against PAF using an address validation API.

Build it in

Combine format checks with live lookups using our Postcode Lookup API, and read more in the PAF guide.

Frequently asked questions

What is the UK postcode format?

UK postcodes follow one of several patterns combining one or two letters, one or two digits, an optional letter, then a space, a digit and two letters — for example A9 9AA, A99 9AA, AA9 9AA, AA99 9AA, A9A 9AA and AA9A 9AA.

How long is a UK postcode?

UK postcodes are between five and seven characters long including the space, with the inward code always being three characters.

How do you validate a UK postcode?

You can validate the pattern with regex, but the only way to confirm a postcode actually exists is to check it against Royal Mail PAF data via a lookup API.

Ready to get started?

Add Royal Mail PAF-verified UK address lookup to your site in minutes — start free, no card required.