April 07, 2004
Postcode formatting

OK, sorry about this. Remarkably tedious (if rather useful) post coming up.

Everything you will ever need to know about UK address and postcode formats (in PDF), via the Universal Postal Union (where you can find similar documents for other countries' address formats), found via forta.com.

Posted to Software development by Simon Brunning at April 07, 2004 04:10 PM

Ah, so a *useful* post for a change... ;-)

Posted by: Paul on April 7, 2004 04:45 PM

More intresting info in this thread - http://london.pm.org/pipermail/london.pm/Week-of-Mon-20030331/018067.html - including the suggestion that SAN TA1 might be a valid postcode. Is this true? I certainly hope so.

Posted by: Simon Brunning on April 7, 2004 04:50 PM

You can download a full postcode file from here:

And there are some surprisingly interesting postcode related stats here:

Posted by: duncan on April 8, 2004 03:57 PM

See also http://www.govtalk.gov.uk/gdsc/html/noframes/PostCode-2-1-Release.htm for even more details on vlid postcode formats.

Posted by: Simon Brunning on April 14, 2004 03:38 PM

mysql> select mf_outcode from PAF_Y03M10.fpmainfl where mf_outcode="S" or mf_outcode="SA" or mf_outcode="SAN" limit 5;
Empty set

If it exists, the grown-ups aren't meant to know about it either. ;)

There is one special postal code according to the Royal Mail's PDF, although it escapes me now. I think it was "GYROBANK", or "GYRO0000", or similar. If you are really interested, look at the London PM thread, I mentioned it there.

Posted by: David Wilson on April 20, 2004 01:06 AM

The special case that I know *exists* is "GIR 0AA" - this is indeed for the Gyrobank.

Posted by: Simon Brunning on April 20, 2004 09:00 AM

The post office does do special things with letters addressed to santa, usually sending them to a certain place (it chances every yeah) but I have no idea whether SAN TA1 actually exists. I don't think it does, though.

There are some notable exceptions to the postcodes that that list doesn't give: BFPO which is a prefix for British Forces (and goes somewhere in London) and BX1 something which is a special postcode owned by Lloyds TSB and goes somewhere in the south west.

Posted by: Rob on September 10, 2004 01:20 AM

If postcodes and regex are your thing, try


Posted by: Phil on September 14, 2004 08:53 PM
Post a comment

Email Address:



Remember info?