Postcode
United Kingdom postcodes
United Kingdom postcodes have the format @# #@@|@## #@@|@@# #@@|@@## #@@|@#@ #@@|@@#@ #@@|GIR0AA, for example EC1Y 8SY. zipcodestack has 2,680,239 postcodes for United Kingdom in 4 regions.
- Format
- @# #@@|@## #@@|@@# #@@|@@## #@@|@#@ #@@|@@#@ #@@|GIR0AA
- Example
- EC1Y 8SY
- Codes in our database
- 2,680,239
- Local name
- postcode
United Kingdom postcode format
| Pattern | @# #@@|@## #@@|@@# #@@|@@## #@@|@#@ #@@|@@#@ #@@|GIR0AA (# digit, @ letter) |
|---|---|
| Examples | EC1Y 8SY, GIR 0AA, M2 5BQ, M34 4AB, CR0 2YR, DN16 9AA |
| Regex | ^(?:GIR ?0AA|(?:(?:AB|AL|B|BA|BB|BD|BF|BH|BL|BN|BR|BS|BT|BX|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GY|GU|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZE)(?:\d[\dA-Z]? ?\d[ABD-HJLN-UW-Z]{2}))|BFPO ?\d{1,4})$ |
| Official lookup | www.royalmail.com |
Format and regex from Google's address metadata (libaddressinput). The regex checks the shape of a code, not whether it exists.
Postcode Districts by region
| Region | Range | Codes |
|---|---|---|
| England | AL1 – YO91 | 2,256 |
| Northern Ireland | BT1 – BT94 | 81 |
| Scotland | AB10 – ZE3 | 455 |
| Wales | CF3 – SY25 | 209 |
Postcode Districts of the largest cities
UK postcodes have two parts. These lists show the first part, the postcode district (outward code), e.g. SW1A. A full postcode such as SW1A 1AA covers around 15 addresses; the zipcodestack API covers 2.6 million full UK postcodes.
Neighbouring countries
United Kingdom postcodes: FAQ
What is the postcode format in United Kingdom?
@# #@@|@## #@@|@@# #@@|@@## #@@|@#@ #@@|@@#@ #@@|GIR0AA (# = digit, @ = letter). Examples: EC1Y 8SY, GIR 0AA, M2 5BQ, M34 4AB, CR0 2YR, DN16 9AA.What regex validates United Kingdom postcodes?
^(?:GIR ?0AA|(?:(?:AB|AL|B|BA|BB|BD|BF|BH|BL|BN|BR|BS|BT|BX|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GY|GU|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZE)(?:\d[\dA-Z]? ?\d[ABD-HJLN-UW-Z]{2}))|BFPO ?\d{1,4})$ matches the official format (from Google's address metadata). It checks the shape only; whether a code exists needs a lookup in a postal code database such as the zipcodestack API.What is the postcode of London?
How many postcodes are there in United Kingdom?
Postal code API
Look up United Kingdom postcodes by API
zipcodestack looks up, validates and searches postal codes in 149 countries: city, state, coordinates, distances and radius search, as JSON.
/v1/search documentation International postal code API All documentation
300 free requests every month. No credit card required.
GET https://api.zipcodestack.com/v1/search?codes=EC1Y+8SY&country=gb
{
"results": {
"EC1Y 8SY": [{
"postal_code": "EC1Y 8SY",
"country_code": "GB",
"city": "…",
"state": "…",
"latitude": …,
"longitude": …
}]
}
}