Download UK Postcodes with Latitude and Longitude

Download a list of UK out code postcodes with their latitude and longitude coordinates.

Introduction

UK and Northern Ireland Postcodes

The UK postal system uses postcodes to help with automating the sorting and delivery of mail. This is made up of a 2-part code, an out code and an in code. As the out code is the most significant part of the system, it can be used to obtain a rough area level break up of the UK. There are approximately 2971 out codes and approximately 1.74M full postcodes (out code + in code).

Purpose

The uses of these out codes and lat/long values include mapping applications such as:

List Status

Outcode Postcodes Current List : 2974

Full UK Postcode Current List : 1741532

Non Geographic Postcodes

Non geographic postcodes are listed below. Note these will have a latitude and longitude of an empty string

AB99, BT58, CA99, CM92, CM98, CR44, CR90, GIR, IM99, IV99, JE5, M61, ME99, N1C, N81, NR99, NW26, PA80, PE99, RH77, SL60, SO97, SW95, SY99, WD99, WF90

Downloads

Full UK Postcode Latitude Longitude Download

Outcode Area Postcodes (AB1,B2,BT7 etc..)

Copyright and Reproduction

As per : https://www.ons.gov.uk/methodology/geography/licences

You may re-use this information (not including logos or Northern Ireland data) free of charge in any format or medium, under the terms of the relevant data owners' licence. In addition, the following attribution statements must be acknowledged or displayed whenever the owners data is used:

Contains Ordnance Survey data © Crown copyright and database right 2021

Contains Royal Mail data © Royal Mail copyright and database right 2021

Source: Office for National Statistics licensed under the Open Government Licence v.3.0

Using This Data

To import to a web based MySQL database we would recommend BigDump: Staggered MySQL Dump Importer

Relevant Links

Version History

Comments For This Page

I think the lat / lng for DG2 8RX is a bit out, should be 55.058885 -3.659007 KR
By mak on 19th May 2021

sssq, thanks for reporting. There was a bug in the file contents. It has now been corrected.
By Free Map Tools on 14th April 2021

The latest ukpostcodesmssql.zip has the first INSERT without values, is that an error or is the sql file is missing records?
By sssq on 14th April 2021

Pankaj, sorry thats not possible.
By Free Map Tools on 25th January 2021

As always, thanks for this site. I have a request, is it possible to add city name to the outcodes too?
By Pankaj on 21st January 2021

Just a note to anyone importing this data. Make sure if using the table schema provided on this website, make sure you set the longitude and latitude columns to nullable, otherwise you will get an error during your import.
By Mark on 26th November 2020

Hi, Thanks for this useful data. I was wondering how "Outcode Area Postcodes" locations were measured? I ask because I've found disparity between that and the full data you offer. I will attempt to roll my own aggregations as you have not covered the outcodes: ['WV98', 'SW95', 'SY99', 'CR90', 'SO97', 'N81', 'CM98', 'EN77', 'WF90', 'SR43', 'N1C', 'RH77', 'ME99', 'CR44', 'SO25', 'NR99', 'WD99', 'CM92', 'M61', 'DL98', 'BN91', 'S95', 'NW26', 'WV99', 'BN95', 'L80']
By L on 24th May 2020

Thanks Luisll, the name of the PK has been updated.
By Free Map Tools on 1st May 2020

Thank you for this great tool. Script to create table postcode-outcodes_tablemssql has a mistake: "CONSTRAINT [PK_postcodelatlng] PRIMARY KEY CLUSTERED" should be "CONSTRAINT [PK_outcodepostcodes] PRIMARY KEY CLUSTERED"
By Luisll on 1st May 2020

Thank you for this resource. The webpage say "Non geographic postcodes are listed below. Note these will have a latitude and longitude of an empty string." In the CSV file 'postcode-outcodes.csv' they are not empty but '0'.
By Jonathan. on 25th March 2020

I live at 20 Guardians Court, NE20 9UG but due to an error in one of the postcode databases the postcode sometimes generates North Road. The latter has the postcode NE20 9UH. Would you please check your database produces Guardians Court when you input NE20 9UG. Thanks
By Jackie Park Harris on 24th February 2020

Which file are you looking inside?
By Free Map tools on 19th February 2020

Hi - I can't see any postcodes for Coventry (CV) or Birmingham (B). Any ideas?
On 19th February 2020

Hi John, it was last updated in July 2019
By Free Map Tools on 18th February 2020

how up to date is postcode-outcodes.csv
By Peter on 18th February 2020

Hi, how uptodate is ukpostcodesmssql.zip Thanks
By John on 18th February 2020

Hi Albert, this is to signify that a postcode is known but does not have a lat/lng value. We hope to populate these as time goes on.
By Free Map Tools on 22nd January 2020

There seem to be quite a few postcodes with lat/lng: 99.9999, 0 - is that expected? (e.g. GY1 %, or SE1P %)
By Albert on 22nd January 2020

cheers :)
By bollos on 7th January 2020

Great resource! Just to let you know the latest versions of MYSQL have strict mode set as default. So the entries with latitude and longitude of an empty string will throw an error. My solution was to search and replace '' ----> '0' Before attempting an import.
By Gary on 3rd October 2019

Showing the most recent 20 out of 261 comments. Click to see all the comments.

Add your own comment below and let others know what you think:

Comments

Your Name (optional)

 Post