CodeCrafting All articles
Engineering Culture

The House With No Number: Designing UK Address Forms for Real Places

CodeCrafting
The House With No Number: Designing UK Address Forms for Real Places

Photo: Evelyn Simak , CC BY-SA 2.0, via Wikimedia Commons

There's a particular kind of confidence that comes from shipping a postcode lookup field. You type SW1A 1AA, a dropdown appears, the user picks a house, done. It demos beautifully. Then someone orders something to Flat 3, above the bakery, where the postcode resolves to a single commercial premises, and the whole thing falls over in a way that makes the courier's app show a red box.

British addresses are not a data format. They're a centuries-old accretion of habit, and any form that pretends otherwise is going to spend its life arguing with customers.

The eighty per cent that lookup solves

Royal Mail's Postcode Address File is genuinely good at what it does: roughly 30 million delivery points, updated constantly, keyed by postcode. If you can afford the licence, it will handle the majority of urban residential addresses better than any free-text form ever will.

But the PAF is a delivery point database, not a description of where people live. Those aren't the same thing, and the gap is where the support tickets come from.

What the lookup won't tell you

A few things worth internalising before you build:

So the lookup is a shortcut, never a gate. Manual entry must always be one click away, and it must not be hidden behind a link that only appears on failure.

Flats, wings and letters that aren't numbers

Most address schemas are shaped by a US assumption: a street number, a street name, an optional apartment. Britain laughs at this. A perfectly ordinary address might read:

Flat 3B, Marlborough House, 12–14 Station Road

Is 3B the flat number or part of the building name? Both, depending on who you ask. Add in Flat 3b, Flat B3, 3/2 (still common in Scotland), Maisonette 2, Rear of 41, and Unit 4, The Old Tannery, and you begin to see why a single house_number integer column is a small act of violence.

Give people room. Three free-text address lines, each long enough for a genuinely long building name, beats a clever structured schema almost every time.

The house with a name and no number

Rural addressing is where urban-shaped forms embarrass themselves. In large parts of Norfolk, Cumbria, the Borders and Wales, the address is a name and a postcode and not much else:

Ty Newydd, Llanfair, Llanybydder

No street. No number. Possibly no town in the sense your form means. There may not even be a road name the mapping people agree on. What there is, reliably, is a postcode covering perhaps a dozen properties and a postman who knows exactly which one you mean.

If your form insists on a street name, those customers either invent one or abandon the basket. Neither is a good outcome.

Crown Dependencies, BFPO and other edges

Three sets of addresses that break naive UK assumptions:

Being explicit about what you don't ship to is fine. Silently failing validation on a legitimate address is not.

A schema with room to breathe

Here's a shape that survives contact with reality:

{
  "line1": "Flat 3B, Marlborough House",
  "line2": "12-14 Station Road",
  "line3": null,
  "town": "Bristol",
  "county": null,
  "postcode": "BS1 4DJ",
  "country": "GB",
  "uprn": 123456789012
}

Two things to notice. First, county is nullable and not required — Royal Mail hasn't required a county in an address for decades, as long as the post town and postcode are correct. Keep it for the people who want it, drop the asterisk. Second, there's no house_number and no street field. They sound helpful and they are, in fact, the source of half your data-quality problems.

If you need structured output for a specific downstream system — a courier API, say — derive it at the boundary, not in the form.

UPRN: what the identifier is actually for

The Unique Property Reference Number is a twelve-digit identifier maintained by GeoPlace, one per addressable premises, stable across years. It's available through Ordnance Survey's AddressBase products and increasingly through council datasets.

A UPRN is excellent for matching, deduplication and routing. It is worthless as a thing to show a human, and it doesn't solve address capture on its own — it identifies a property, not the flat within it, unless that flat has its own record. Keep it as an optional field you populate when lookup succeeds. Don't make it a requirement, and never display it raw to a customer.

Validation that doesn't argue with people

Some practical rules, learned the tedious way:

Ship for the address you have

The through-line here is a familiar one. A form is a model of the world, and models fail at the edges. The flat above the shop, the farm with a name, the parcel going to a base in Cyprus — these aren't unusual cases, they're just unusual to the person who wrote the schema.

Build the form to bend. Your courier integration can be as rigid as it likes later.

All Articles

Related Articles

Week One as a Test Suite: Turning Onboarding Friction Into README Fixes

Week One as a Test Suite: Turning Onboarding Friction Into README Fixes

The Quiet Fortnight: Handover Notes That Work When the Office Is Empty

The Quiet Fortnight: Handover Notes That Work When the Office Is Empty

Make Dull Work Visible: The Case for a Maintenance Budget

Make Dull Work Visible: The Case for a Maintenance Budget