I'm working on a website where as a key part of the sign up process users have to enter their location. The particular town where a user lives is integral to the functions of a website.
In most of Europe this is easy enough to do. I simply ask for their municipality or the like. Most countries tend to have very smal level local government.

For the UK though, there things are tough.
In London and other big cities it seems fairly easy with things being still divided into wards/boroughs/that sort of thing, but then you have areas like county durham where the entire county is united under one unified government. From my time in the UK I know that this is much too big an area.

So, when asking British people for their location what is good practice?

Post codes? But they are just for the post office and often don't follow lines either political or in people's hearts.

Constituancies? But they seem to be changed a lot. My British friends have no idea which constituency they live in. I'm not trying to show local events on this site, I'm showing overviews of data, where X is the most popular, which Y people like in Z, etc.

A list of all towns over X size? But then what about village people? That will be a lot of towns I have to find and doubtless I will make mistakes in parts of the country I know nothing about.

Letting users enter their own location wouldn't really work as the site is reliant on data about local areas.

Any input as to a usual best practice and how anything close to what I'm trying to do does it?

  • 2
    As a UK resident I would recommend postcodes, they are used almost everywhere when a location is required already; In car Satnav, delivery addresses, mapping, 'Find nearest store' and many other places. Commented May 27, 2014 at 15:42

2 Answers 2


Postcodes are appropriate here.

Every house (indeed every building really) has a postcode. They're more or less unique (well, places share postcodes if they're in the same street, but one postcode only exists in one part of the country) unlike other options such as town name where there could be several of them. (Westbury, Newcastle, Hadleigh...)

There are databases you can hook into that carry a full up-to-date list of the country postcodes and addresses (for a fee, naturally) such as http://www.postcodeanywhere.co.uk/ and http://www.royalmail.com/postcode-finder/ among many others.

The drawback with postcodes is that you will likely have to pay, and you need to keep it up-to-date (which is taken care of if you pay the fee for usage). More postcodes get added, some occasionally change (infrequently though) and new houses get built that need to be considered.

It depends how accurate you want to be, but postcodes is the most accurate method here. Failing that, County may be a more cost-effective route to take as these are pretty static (although change on very infrequent occasions) but they cover quite a large geographic area so that may not be suitable.

  • 1
    If you use the Google geocoder to decode the postcode, you don't need to pay or keep it up to date yourself. You do need to show a Google map (but that might be a good thing here as you can say "That means you're here: is that right?") Commented May 27, 2014 at 16:31
  • Postcodes have a big drawback. Not all locations have a postcode, and some postcodes are recorded against places that no longer exist (e.g. derelict buildings that have been knocked down), if you're using postcode as the only differentiator, some people simply cannot be classified, since their house doesn't have one.
    – Racheet
    Commented Sep 4, 2014 at 8:40
  • @Racheet That is why you have to pay for a postcode service rather than just using a static list of them. I believe all postcodes are controled by the Royal Mail (or perhaps the Post Office) who keep the list up-to-date. You could do some autosuggest too, as the first 3/4 characters are the broader location, and the last 3 are the more specific road / location, so it's likely the first digits that are the most useful for identifying a general location. OP isn't asking for a exact location to the square metre, but a more general one, which postcode should provide.
    – JonW
    Commented Sep 4, 2014 at 8:53
  • @jonW The issue is that the post office's list of postcodes isn't guaranteed by them to be comprehensive or accurate. It's designed to be good enough for a local postman who knows the area to get post to the correct place. So their list doesn't actually cover every dwelling in the country. New build locations sometimes don't have postcodes for up to several years.
    – Racheet
    Commented Sep 4, 2014 at 9:01

For your purposes I agree postcodes sound the most likely candidate, although the first part of the postcode may give you the data/grouping you require e.g. S - Sheffield, LN - Lincoln.

Checkout these article on Wikipedia List of postcode areas in the United Kingdom and List of postcode districts in the United Kingdom

It would probably be best to capture the entire Postcode then analyse by either of the two sub-categories.

The advantage to doing this is that the sub-groups are meaningful to people from the UK (everyone's heard of Sheffield), easily manageable (can be regularly updated in a related lookup table) and best of all are FREELY AVAILABLE!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.