Full UK Postcode Database for Free
Update: April 2010
This post was originally publish in 2008. Things have changed. a lot. Read on.
Ordnance Survey have open sourced a huge chunk of their data. This hasn’t been widely publicised , but the full set of geodata for all UK postcodes is available for free from OS OpenData. For geocoding UK postcodes it’s the Code-Point® Open product you’re looking for. It’s a simple set of CSV files.
The only possible snag is that it only contains only OS Grid (X,Y) coordinates rather than the more useful WGS84 (lat/lng) coordinates. You can perform your own conversions on these values, it’s pretty simple. Or you can just grab a modified WGS84 version of the data
Thanks to MySociety.org for the WGS84 Version of the CodePoint files.
Additionally, if you don’t want to get your hands dirty with the CSV files, have a look at my Open Geocoding API
ps. Royal Mail never did give me a free copy of the PAF file.
The Original Post
It sounds nuts but for a limited time only Royal Mail are giving away copies of the full UK Postcode Database for free to those wishing to use it for the “Show Us a Better Way” competition currently being run by The Cabinet Office.
The Royal Mail has now kindly agreed to make the full PAF data sets available to those who want to use it for the purposes of this competition, but you will need to contact Royal Mail to discuss licensing.
Regardless of the fact that this data should be in the public domain anyway, this is pretty exciting. I’ve certainly put in a claim for my free copy. I’m sure it will arrive with all sorts of legal threats though, but nevermind.
Find out how to get your copy here
Posted in Web


July 25th, 2008 at 9:48 am
Sweet!
July 30th, 2008 at 10:10 am
I had to use geonames.org a while back for a project
It does UK postcodes -> geo coordinates as well as postcodes in nearly every country through a nice web service
However the postcode search definatly isnt street level, usually only locates to a town..
I do agree it should be free – it should be public domain data
July 30th, 2008 at 7:51 pm
Yeah, geonames is good but I found it to be a little slow. Google Maps API which you can call via HTTP woithout any of the sexy JavaScript mapping geocodes UK postcodes pretty well to (down to the AAN N level). It also does an AMAZING job of resovling “random string representing a place name” to a real location on the globe.
I wrote a PHP class once that primarily used Google Maps API and fell back on geonames. It worked pretty well.
Streetmap.co.uk does a pretty good (unoffical) job of geocoding to street level. How to persuade the site to geocode for you is left as an excercise for the reader
July 31st, 2008 at 8:31 am
Does google maps do any postcode translations outside the UK?
July 31st, 2008 at 10:48 am
Yeah, it seems to try it’s best with most countries. US zip codes, French… um whatever they call them… i’m guessing they have pretty good data for most developed countries. You should give it a go. It’s really useful for applications where you want users to be able to enter addresses in a free-form kinda way but you ultimately want structured address data and most importantly some lovely long/lat coords.
August 4th, 2008 at 11:27 am
Cheers buddy will definatly look into it
I work at the moment mostly on a parcel booking and tracking system
People entering addresses badly is obviously a big pain in the ass
August 16th, 2008 at 4:13 pm
Hmm; people forget that the Royal Mail didn’t get their information for free. They have to constantly maintain their post code system (no matter how trivial one may think it is). In fact, if it were so easy to maintain then another entity could have provided a service to maintain postcodes.
It would be really nice if it were public domain, but it is unfair to expect an entity to maintain such information without being subsidised (whether their organisation is government funded or not).
It could easily be paid for using taxation, which would make sense if it were part of the public domain!
August 18th, 2008 at 11:16 pm
Yeah, but it has been paid for by taxation. Don’t forget Royal Mail was built using public money before it was privatised. Funny how other countries manage to provide their postcode data for free!
August 19th, 2008 at 9:26 am
Oddly I agree with both Kel and Neil. The Royal Mail, built (and still heavily subsidised) with our hard earned money has a duty to provide us with some of the data they hold. But realistically they are a business like any other trying to compete in an ever more competitive arena. I see no reason however that the GPS coordinates for all UK postcodes could not be released into the public domain, whilst the full postcode address file remained a licensed product.
Businesses would still shell out for licensed access and updates to the data whilst the rest of us could legally obtain a less regularly updated public domain subset of the same data.
I’m almost certain that this would not affect profits. Some businesses would choose not to pay, but surely those would be the very same fly-by-night style businesses that are currently either not using postcode products or are using illicit postcode data anyway.
Everyone wins
August 20th, 2008 at 9:22 pm
For the record, Royal Mail has not been privatized and is wholly owned by the UK Government. It makes a modest profit (more on letters than parcels) and turns this profit over to the government. The Board of Royal Mail Group has to go back to the Government to argue the case to borrow some back to invest in automation, etc. It is operating in a commercial environment and finds it increasingly hard to compete.
As for postcodes, delivery staff continually feedback changes in buildings, properties, etc. to allow the PAF (Postal Address File)database to be kept up to date. It generates some revenue by selling quarterly updates to other businesses.
PP.
December 12th, 2008 at 10:29 pm
Hi guys,
did any of you get the full postcode data?
I’ve love to have a copy quickly. I’m willing to pay a small fee.
E-mail me dra_19@hotmail.com
December 14th, 2008 at 4:34 pm
[...] public links >> postcode Full UK Postcode Database for Free Saved by danerly7 on Sun 23-11-2008 Postcodes can make a difference to your pension annuity rate [...]
December 23rd, 2008 at 3:29 am
Hi I would love a copy as well for a small fee. Thanks
December 23rd, 2008 at 10:22 am
@VI @A Char
If you want to pay a small fee for Royal Mail’s postcode data I’m afraid you’re gonna have to pay Royal Mail or one of their resellers for it
http://www.royalmail.com/portal/rm/jump2?mediaId=400085&catId=400084
January 12th, 2009 at 5:16 pm
I got mine from here
http://www.uk-postcode.org.uk/
April 10th, 2009 at 10:36 pm
If it’s just outfields you need, there’s a CSV file at http://linuxbox.co.uk/postcode_database.php . It has the advantage of containing lat/long and geographical info too (although as I say, it only lists outfields)
April 27th, 2009 at 10:14 am
If it’s not the whole dataset you’re after and don’t want the hassle of trying to upload the database to your web server or fart around with the PAF monthly updates, then just use a pay-per-click web service solution like the ones from http://www.postcodeanywhere.co.uk
At around 2p per look up, it saves a whole load of hassle and it’s much nicer for your concience to use a legal version rather than try and rip off the Royal Mail, who spend a huge amount of time, effort and money to keep PAF up to date.
August 11th, 2010 at 1:43 pm
i need a postcode please now
August 26th, 2010 at 11:05 am
Thanks Jamie, great work.