Want a Custom tool for Yourself?

Need a Custom Tool? We build custom tools that can save hours per employee per day.

Random UK Postcode Generator

Generate random UK postcodes for address testing and sample data. Choose quantity and filter by letters to match area patterns quickly.

Random UK Postcode





Last updated: May 20, 2026

Created by: Eon Tools Dev Team

Reviewed by: Skanda Aryal



How this random UK postcode generator works

Press Generate and you get a postcode. Turn up the Number box for several at once, no repeats. Copy takes them.

SW1A 1AA. EC1A 1BB. WC2N 5DU. M1 1AA.

Every one follows the rules Royal Mail actually uses, and those rules are stranger and more deliberate than almost anybody realises. Six letters of the alphabet are banned. And the thing the postcode points at is not a place.

The six letters Royal Mail will not use

A UK postcode has two halves separated by a space. The outward code gets your letter to a sorting office. The inward code is always exactly three characters: a digit, then two letters.

Those final two letters may only be drawn from this set:

A B D E F G H J L N P Q R S T U W X Y Z

Twenty letters. The six that are missing are C, I, K, M, O and V.

The reason is beautiful and entirely practical. Those six either look like digits or look like each other when written by hand. A scrawled O is a nought. A scrawled I is a one. C and G blur. K and X blur. M and N blur. U and V blur. Every one of them is a chance for a letter to go to the wrong town.

So Royal Mail simply refused to use them, at the one position where a machine or a sorter has to read a letter with no surrounding word to give it away. The alphabet was pruned to make handwriting legible.

It is one of the great quiet pieces of design in British public life. A rule that costs nothing, that nobody has ever had to be taught, and that has been silently correcting our handwriting for sixty years.

A postcode is not a place. It is an instruction.

Here is the thing that catches out almost everybody who works with postcodes for the first time.

A postcode has no boundary. It has no area. It has no location. A postcode is a routing instruction, and what it points at is a set of delivery points: front doors, letterboxes, post boxes.

Royal Mail's address file covers roughly 29 million delivery points under about 1.8 million postcodes. Sixteen or so addresses each, on average. A postcode usually means part of a street. Sometimes it means one large building, which is why the Palace has its own.

When a map puts a pin on a postcode, that pin is a centroid: an average position calculated from the delivery points, and quite possibly sitting in a field, or in a river, or inside a neighbouring postcode. The pin was invented so that software would have something to draw.

Postcodes also expire, move and get re-cut when a new estate is built. They are operational data belonging to a delivery company. They were never a description of the country, and every dataset that treats them as geography is borrowing something that was never lent.

Six shapes, and no others

Write A for a letter and 9 for a digit, and every UK postcode in existence takes one of six forms.

A9 9AA. A99 9AA. A9A 9AA. AA9 9AA. AA99 9AA. AA9A 9AA.

The odd ones are the third and the sixth, where a letter turns up in the middle of the outward code. Those belong almost entirely to central London, which ran out of room and had to subdivide: EC1A, WC2N, SW1A.

The postcode areas themselves are mnemonic, which is a lovely piece of design. There are around 121 of them, each named for a major post town. L for Liverpool. EH for Edinburgh. AB for Aberdeen. And, best of all, TR for TRuro.

Which is why format-validity and existence are different questions. A code can obey every rule above and still have never been issued to anybody, because no house was ever built there. The pattern tells you what Royal Mail could issue. Only Royal Mail's Postcode Address File records what it has.

The postcodes you already know

SW1A 1AA is Buckingham Palace. EC1A 1BB turns up throughout Royal Mail's own documentation as the worked example, which is why it has quietly become the most-typed postcode in Britain.

And then there are the strays. GIR 0AA, Girobank's old code, was the last domestic postcode with a wholly alphabetic outward half. It has left the address file and is still in use by the bank that inherited it.

EH1 1AA is reported to have been withdrawn after the post office building it served was sold. A postcode can die when a door stops being a door.

That is the whole system in one sentence. It is not about where things are. It is about where a person carrying a bag has to walk next.

Ways people actually use this

  • Test data. Every code passes the official format pattern, which is what a validator checks.
  • Testing a validator. They should all pass. If yours rejects one, the bug is yours.
  • Quizzes. Show the outward code, ask for the city. EH, AB, L, G, M, NE.
  • Teaching data design. Ask a class why C, I, K, M, O and V were cut, before you tell them.
  • Writing. British fiction is full of postcodes. Now you know which ones cannot be real.

Getting more out of the filters

  • Contains matches anywhere in the string. Type EH for Edinburgh, BT for Belfast, AB for Aberdeen.
  • Type 1AA for the sector-one, unit-AA codes, which is what somebody reaches for when they need a plausible-looking example. Buckingham Palace is one of them.
  • Try the banned letters at the end of a code. OP, IJ, KL. The rule in the section above is doing its job.
  • Starts with and Ends with compare a single character, so give them one letter.

Questions people ask

Which letters cannot appear in a UK postcode?

In the final two letters, C, I, K, M, O and V are never used. The permitted set is ABDEFGHJLNPQRSTUWXYZ. They were excluded because they resemble digits or one another in handwriting.

What are the valid postcode formats?

Six: A9 9AA, A99 9AA, A9A 9AA, AA9 9AA, AA99 9AA and AA9A 9AA, where A is a letter and 9 is a digit. The inward half is always a digit followed by two letters.

How many postcodes are there?

Around 1.8 million unit postcodes, covering roughly 29 million delivery points. That averages out at about sixteen addresses per postcode.

Does a postcode cover an area?

Not formally. A postcode is a routing instruction attached to a set of delivery points. Any boundary or single location you see on a map is derived from those points, not published by Royal Mail as the postcode's shape.

Can I validate a postcode with a regular expression?

You can check its format, including the excluded letters. You cannot check that it exists. Only Royal Mail's Postcode Address File records which codes have been issued, and even that lags behind new developments.

References

  1. Postcodes in the United Kingdom
  2. UK postcode format, government specification
  3. Postcode formats


Skanda Aryal

Skanda Aryal is a full stack engineer focused on accessible web experiences, with personal interests in time zones, travel, hiking, and geography. His enjoys playing with utilities tied to movement, schedules, places, and time based coordination. At Eon Tools, he reviews geography, transportation, times now, and date and time tools.