
May 10
Free UK Postcode Towns & Counties Database
Updated Friday 14th May 2010 – Check Comments and provide feedback
When you come across websites that fills in your address after entering a postcode you can bet they’re using the Royal Mails PAF. But what if you’re looking for something less specific such as associating a town or county with a postcode? There are free tools and databases out there but I couldn’t find anything specific enough for my needs.
I’ve extended on the ezpy Free UK postcode data file to include the region and county for each postcode (along with the longitude and latitude provided by ezpy). It includes 2822 postcodes and a postcode such as “EX32″ will contain the town “Barnstaple” and the county “Devon”.
The download contains an SQL and CVS file which you can use freely.
Update 0.2 – May 14th 2010
The postcode database has been updated improving and fixing upon some of the issues discussed. In some cases towns and cities don’t use a county so this has mainly been replaced with the town/cities region or ceremonial county. For example Birmingham (city) now has West Midlands (county).
- Now includes a csv, Microsft Excel csv, MySQL sql and Open Office ods
- Corrected the Longitude/Latitude columns in the SQL file. The values were correct but the data type wasn’t (doh)
- Improved the duplicate “town/county” issue
UK Postcode Town and Counties Database – .ZIP FORMAT







iplanweb 9 September 2009 10:11 pm
Great Job!! really helpful and handy for the kind of work I am doing.
John 6 October 2009 12:25 am
Unfortunately the UK towns/counties dbase seems to have quite a number of innacuracies. e.g a number of “counties” are in fact just the POST TOWN duplicated, which rather spoils it all.
Regards,
John
Gibbs 6 October 2009 9:15 am
Hi John and thanks for the feedback. Unfortunately I haven’t had much time to improve on the accuracy but for my specific task I needed the postal town. Anybody wanting to make additions and improve upon it are free to do so. When I have the time I’ll try and work on it and maybe even house it somewhere on the new (not live) site.
Cheers
AMF 15 December 2009 12:39 am
Thank you. This is just what I was looking for, to validate delivery addresses. The SQL script will save me a minute or two. I am surprised that it is not more readily available. In some places there are two or more posttowns for one outward postcode. Do you plan to include all of these and the remaining counties at some stage?
Gibbs 15 December 2009 10:12 am
Hey AMF. This is far from perfect I completely agree on that. I do plan on an update but it’s going to take time.
I’ve generated a massive list of over 3 million postcodes and have validated if they exist of not. The difficult part starts after then. It will have more specific regional information though instead of generalising things under the main post town.
RussH 30 December 2009 9:22 pm
this is a great start – and whilst don’t want to look a gift horse in the mouth, am really looking forward to your updated version!
I wondered however if this news story give you any extra information to use in order to validate your data?
http://news.bbc.co.uk/1/hi/technology/8402327.stm
arif 7 January 2010 9:30 pm
Looking forward to your finished goods.
will be an excellent belated xmas present.
the ezpy is a fabuolous database/resource – i was just thinking of adding towns to it myself… you’ve beaten me to it !
.. but plz move up a gear and finish it. Just work on the epzy 2822 records.
for full blown postcode database http://www.linuxbox.co.uk has something on offer. 3-million will take you far too long and will still be way short of the 28-million postcode royal mail database.
let us know when your done with the 2822-records.
thanks and good luck.
Ollie Treend 11 May 2010 5:23 pm
You, my friend, are a God!
Thank you very much for this excellent resource!
Unfortunately your lat+long points were a little mangled… they’re all to 1 significant figure??
But that’s not a problem… I simply used the lat long values from ezpy’s list, and your town & county names.
Your new list does sound rather impressive, but this will do for the time being!
Thanks again
Ollie
Dan Peters 13 May 2010 5:36 pm
Hi,
Wanted to give you a big thanks for this free database and look forward to your update for it coming. =)
Dan
Gibbs 14 May 2010 7:35 pm
I’ve finally got around to updating this. There’s been some fixes and improvements that were mentioned (thanks for all the feedback by the way).
Grab it above the comments section or at http://www.danielgibbs.net/downloads/.
Dan Peters 19 May 2010 12:45 pm
Thank you for the update Gibbs, going to try using this today!
Jonney 29 June 2010 9:13 pm
Excellent resource. just what i was looking for. You have saved me a lot of time.
George Edwards 2 August 2010 1:36 pm
Thank you for releasing this file! Transparency prevails!
Cheers
Greenman 12 August 2010 3:09 pm
Hi I am looking for something a bit different I am looking for a database of postcodes down to sector level ( G53 6)
and a count of the number of businesses and households in the postcode sector. I thought about going through PAF but it would be really expensive for what I want.
Gibbs 13 August 2010 10:14 am
Hi Greenman,
Apparently the government is releasing postcode data sometime this year. I haven’t heard anything about that recently but we’ll have to wait and see. Until then it’s very difficult (and time consuming) to compile a list of all postcodes and the relevant information.
Chris Lomax 18 August 2010 11:05 pm
Honestly, amazing. Been looking for this everywhere!
scott 19 August 2010 9:02 pm
Hi there
This is excellent and probably exactly what i am looking for. Although being a novice web designer i wondered if this is possible to have a system whereby someone types in there post code and it takes them to a specific page (which obviously relates to the town) i.e someone types AB21 or AB12 and they are directed to the Aberdeen page.
i dont know how i would relate search field on website to the csv file and subsequently to pages per town