How a UK address is written
Royal Mail’s layout puts the building first and the postcode last, each element on its own line: an optional flat or building name, the house number and thoroughfare (42 Hawthorn Close), an optional locality, the post town (Royal Mail prefers it in capitals on envelopes) and the postcode on its own line. Counties are no longer required — Royal Mail dropped them from the addressing standard in 1996 — so a UK form should not make “County” mandatory.
Flats are written before the street line (Flat 3 / 42 Hawthorn Close), and some properties have a name instead of, or as well as, a number (Rose Cottage, Mill Lane). The generator produces both.
Postcode structure
A UK postcode has an outward code and an inward code separated by a space: LS6 2QD.
- Area – one or two letters (
LSLeeds,GGlasgow,BTNorthern Ireland). - District – one or two digits, sometimes followed by a letter in central London (
SW1A,EC1V). - Sector – the single digit after the space.
- Unit – two letters, which never include C, I, K, M, O or V.
The outward code is 2 to 4 characters and the whole postcode 6 to 8 characters with the space. A practical validation regex is ^[A-Z]{1,2}\d[A-Z\d]? \d[ABD-HJLNP-UW-Z]{2}$; normalise case and spacing first, because users type ls62qd and LS6 2QD.
England, Scotland, Wales and Northern Ireland
The UK has no states. The four constituent countries (ISO 3166-2 codes GB-ENG, GB-SCT, GB-WLS, GB-NIR) are useful for tax, shipping-zone or reporting logic, but they are not part of a postal address. The generator returns the country in a separate field so you can test that logic without printing it on the label. Note that the ISO country code is GB, while many people type UK; accept both in free-text input and store GB.
Testing tips for UK address forms
- Make the postcode the anchor: many UK checkouts look up addresses by postcode. Generated postcodes have a real outward code but a random inward code, so a lookup should return no match — a good test for your manual-entry fallback.
- Accept all six outward-code shapes — A9, A99, AA9, AA99, A9A and AA9A (
M1,B15,LS6,CF24,W1A,SW1A). - Allow apostrophes, hyphens and commas in street and town names (
Newcastle upon Tyne,Stratford-upon-Avon). - Crown dependencies (Jersey
JE, GuernseyGY, Isle of ManIM) use the same postcode shape but are not part of the UK for VAT.
What makes these addresses fictional
Post towns and postcode districts are real so that format checks and region rules behave realistically. Street names are built from generic words and the numbers are random; any match with a real property is coincidental. Use the output only in test, staging or demo systems.
Countries of United Kingdom
The generator uses the 4 first-level countries below, with the codes used in addresses. Cities are picked from 18 places spread across the country, each with postcodes from its own range.
- ENGEngland
- SCTScotland
- WLSWales
- NIRNorthern Ireland
Example United Kingdom test addresses
42 Hawthorn Close
Leeds
LS6 2QD
United Kingdom
Cardiff
CF24 3HW
United Kingdom
Validation pattern used for the Postcode: ^[A-Z]{1,2}\d[A-Z\d]? \d[ABD-HJLNP-UW-Z]{2}$. It checks the format only — whether a code is actually in use is known only to the postal operator.
Phone numbers in United Kingdom test data
UK numbers start with 0 nationally (+44 internationally, dropping the 0). The generator uses only Ofcom’s drama ranges: 07700 900000–900999 for mobiles, the 496 0xxx / 7946 0xxx / 2018 0xxx blocks for the cities that have one, and 01632 960xxx elsewhere.
| Type / area | Reserved range | Example |
|---|---|---|
| Mobile | 07700 900000 to 07700 900999 | |
| No specific area | 01632 960000 to 01632 960999 | |
| London | 020 7946 0000 to 020 7946 0999 | |
| Leeds, Sheffield, Nottingham, Leicester, Bristol, Reading (0113–0118) | 011x 496 0000 to 011x 496 0999 | |
| Birmingham, Edinburgh, Glasgow, Liverpool, Manchester (0121–0161) | 01x1 496 0000 to 01x1 496 0999 | |
| Tyneside, Durham, Sunderland | 0191 498 0000 to 0191 498 0999 | |
| Northern Ireland | 028 9649 6000 to 028 9649 6999 | |
| Cardiff | 029 2018 0000 to 029 2018 0999 | |
| Freephone | 08081 570000 to 08081 570999 | |
| UK-wide (03) | 03069 990000 to 03069 990999 | |
| Premium rate | 0909 8790000 to 0909 8790999 |
Source: Ofcom – Telephone numbers for use in TV and radio drama programmes (checked October 2026). All ranges: test e-mail addresses and fictional phone numbers.
Sources
- Postcodes in the United Kingdom (format)
- ISO 3166-2:GB
- Ofcom – telephone numbers for drama (archived copy)
Postcode ranges, region lists and address conventions checked against these sources in October 2026. Street names in the generator are synthetic.
Other countries: United StatesCanadaAustraliaIndiaGermanyFranceSpainItalyNetherlandsBrazilMexicoJapanPhilippinesPakistanNigeriaSouth AfricaTurkeyIndonesiaUnited Arab Emirates
Frequently asked questions
What is a valid UK postcode format?
One or two letters, one or two digits (optionally a letter), a space, then a digit and two letters — for example M1 1AE, LS6 2QD or SW1A 1AA. The final two letters never include C, I, K, M, O or V.
Do UK addresses need a county?
No. Royal Mail only needs the house number or name, street, post town and postcode. Make county optional in your forms.
Which UK phone numbers are safe to use in test data?
Ofcom reserves 1,000 numbers in several ranges for drama, including mobiles 07700 900000–07700 900999 and 01632 960000–960999. The generator only uses those ranges.
Is this a real address in United Kingdom?
No. The city, country and postcode format are real, but the street and house number are random. Use the addresses for testing forms, databases and shipping-rate logic, never to send mail or goods.