Free client-side developer tool

UK Postcode Checker and Formatter

Normalise a UK postcode, check its supported syntax, and separate the outward and inward codes. The value stays in your browser and is not sent to PostcodeLab.

Reviewed 17 July 2026

Check a postcode format

Try upper or lower case, with or without the usual space. Common pasted punctuation is ignored.

UK postcode checker and formatter visual

What the checker does

The tool trims the input, converts letters to upper case, ignores whitespace and common pasted punctuation, and inserts one space before the final three characters. It then applies the BS 7666-style postcode shape documented in a UK government web-services specification.

A matching result is split into the outward code used for the postcode area and district, and the three-character inward code used for the sector and unit. For example, PO15 5RR contains outward code PO15 and inward code 5RR.

What a syntax result cannot prove

QuestionAnswered here?Required next step
Does the text match the supported UK postcode shape?YesUse this client-side check
Is the postcode currently allocated?NoCheck a maintained postcode source
Does it belong to a particular address?NoUse an appropriate address lookup
Can a carrier deliver there?NoUse the carrier's service-specific rules
Is a person connected to it?NoDo not infer identity from a postcode

ONS postcode products include current and terminated postcodes and are updated on a published cycle. Address verification and deliverability are different decisions with different sources, licences and failure modes.

Implementation guidance for forms

  • Accept lower case, missing spaces and harmless surrounding whitespace.
  • Keep client and server rules consistent, but do not rely on an HTML pattern alone.
  • Tell the user what went wrong and preserve the entered value for correction.
  • Offer manual address entry when a lookup cannot find an address.
  • Document whether BFPO, overseas territory or non-geographic formats are in scope.
  • Keep syntax validation separate from lookup, verification, identity and delivery checks.

For production code and a full test matrix, read the UK postcode regex guide and the comparison of postcode validation versus address verification.

If you need an exploratory value rather than checking an existing one, use the random UK postcode generator. For the underlying structure and terminology, read the UK postcode format guide.

Official references