UK Postcode Prefix vs Range Rules: How Coverage Is Matched
Many UK delivery rules are published as outward-code families or district ranges. Preserving that structure makes the data easier to audit and reduces false precision.
The outward code is often the useful routing key
A UK postcode contains an outward part before the final three-character inward code. Carrier exception lists often express operational rules at the postcode area or district level rather than at individual delivery-point level.
For routing intelligence, the useful question is therefore whether the normalized postcode falls inside a published service rule such as BT, IV1–IV56 or TR21–TR25.
When to use a prefix rule
A prefix rule is appropriate when the source clearly applies to every postcode that begins with a defined outward family. Public examples include rules that refer to all BT, HS, IV or ZE postcodes.
The prefix should remain tied to the service and source version. A BT prefix rule from one delivery product does not authorize the same rule for every UK service.
When to use a range rule
A range rule is better when only selected districts inside a postcode area are affected. AB35–AB38 is materially different from “all AB.” The same applies to selected PA, PH, PO or TR bands.
Range preservation prevents overblocking. If the source only names AB35–AB38, expanding that to every AB postcode would incorrectly classify destinations outside the published scope.
Specificity and outcome precedence matter
A production matcher needs deterministic precedence. If multiple rules overlap, the service should apply the more specific rule and preserve the stronger published restriction where the source model requires it.
In ShipQualify’s current UK postal model, unavailable outcomes take precedence over remote outcomes when both apply to the same service match. This avoids presenting an explicitly unavailable service as merely conditional.
Why not expand every UK postcode into a giant table?
Full expansion creates scale without adding evidence. The source document may only say “BT” or “TR21–TR25,” so generating thousands of synthetic full postcodes can make the database look more precise than the source actually is.
Keeping the original prefix/range granularity also makes updates safer: when a carrier changes one district range, the normalized rule can be replaced without regenerating an artificial postcode universe.
Postcode validity and service coverage remain separate
Royal Mail’s Postcode Finder and PAF are authoritative address/postcode references. A routing product can use those kinds of sources for address validation while still keeping serviceability rules in a separate layer.
A valid postcode can be unavailable for one service; an invalid or incomplete postcode should not receive a serviceability decision at all.
A simple matching example
Consider two rules for the same service: a broad BT prefix condition and a narrower unavailable range inside another postcode family. The matcher should normalize the input, identify all applicable rules, then return the deterministic service outcome rather than whichever row happened to be loaded first.
This is why precedence, specificity and service identity belong in the data model. They make the result repeatable and testable when the rule set grows.
Frequently asked questions
What is the difference between a prefix and a range rule?
A prefix rule applies to a postcode family; a range rule applies only to specified districts inside that family.
Why not store every full UK postcode?
Because many source rules are only published at prefix or district-range level. Expanding them creates false precision and more maintenance.
What happens when remote and unavailable rules overlap?
The matcher should use deterministic precedence so that an explicit unavailable rule is not downgraded to a remote condition.
Does a valid Royal Mail postcode mean every service can deliver there?
No. Address validity and service eligibility are separate decisions.
Sources & methodology
External sources below establish postal structure or carrier examples. ShipQualify does not copy one carrier's rule onto another service without a documented service mapping. Public decisions use normalized service-specific rules; private supplier identities and source costs are not exposed.
- Evri: Location Charge PostcodesCurrent location-charge postcode list for selected UK areas.
- Post Office: Evri in-branch services — postcode availabilityCurrent service-availability and delivery-aim exceptions for selected UK postcodes.
- Royal Mail: Changes to Royal Mail terms and conditionsCurrent Royal Mail notices, including 2026 BT delivery-aim changes and postcode-zone updates.
- Royal Mail: Postcode FinderOfficial Royal Mail postcode/address reference.