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
| Question | Answered here? | Required next step |
|---|---|---|
| Does the text match the supported UK postcode shape? | Yes | Use this client-side check |
| Is the postcode currently allocated? | No | Check a maintained postcode source |
| Does it belong to a particular address? | No | Use an appropriate address lookup |
| Can a carrier deliver there? | No | Use the carrier's service-specific rules |
| Is a person connected to it? | No | Do 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
patternalone. - 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.