Skip to main content
EU Postal Code Formats: A Country-by-Country Reference for Developers
Guides

EU Postal Code Formats: A Country-by-Country Reference for Developers

European postal codes vary in length, format, and meaning. This guide is a country-by-country reference for the 27 EU member states plus the UK, Switzerland, and Norway.

Brent van der HeidenLast updated 5 min read
#postal codes#european postal codes#address validation#geocoding#eu data#regex

Every developer who has built an address form for European customers eventually discovers the truth: there is no European postal code format. Each country has its own, and the variations are genuinely meaningful. This page is a country-by-country reference covering the EU-27 plus key non-EU European countries, with the regex patterns and validation tips you need in production.

The High-Level Pattern

European postal codes split into roughly four groups:

  1. 5-digit numeric: Germany, France, Italy, Spain, Finland, Croatia, Estonia, Greece, Lithuania, Slovakia.
  2. 4-digit numeric: Belgium, Bulgaria, Hungary, Austria, Switzerland, Liechtenstein, Luxembourg, Norway, Slovenia, Denmark.
  3. Alphanumeric, fixed format: Netherlands (4 digits plus 2 letters), Ireland (Eircode, 7 alphanumeric), Malta (3 letters plus 4 digits).
  4. Hierarchical alphanumeric: United Kingdom (variable-length, two-part).

Plus a few outliers: Sweden uses 5 digits with a space after the third (123 45), Poland uses 5 digits with a hyphen after the second (00-001), Czechia uses 5 digits with a space after the third (110 00).

The EU-27 Reference

CountryISOFormatExampleRegex
AustriaAT4 digits1010^\d{4}$
BelgiumBE4 digits1000^\d{4}$
BulgariaBG4 digits1000^\d{4}$
CroatiaHR5 digits10000^\d{5}$
CyprusCY4 digits1010^\d{4}$
CzechiaCZNNN NN110 00^\d{3} ?\d{2}$
DenmarkDK4 digits1050^\d{4}$
EstoniaEE5 digits10111^\d{5}$
FinlandFI5 digits00100^\d{5}$
FranceFR5 digits75008^\d{5}$
GermanyDE5 digits10115^\d{5}$
GreeceGRNNN NN105 63^\d{3} ?\d{2}$
HungaryHU4 digits1051^\d{4}$
IrelandIEEircodeD02 X285^[A-Z]\d[\dW] ?[A-Z0-9]{4}$
ItalyIT5 digits00184^\d{5}$
LatviaLVLV-NNNNLV-1050^LV-\d{4}$
LithuaniaLTLT-NNNNNLT-01100^LT-\d{5}$
LuxembourgLU4 digits1234^\d{4}$
MaltaMTLLL NNNNVLT 1234^[A-Z]{3} ?\d{4}$
NetherlandsNLNNNN LL1011 AB^\d{4} ?[A-Z]{2}$
PolandPLNN-NNN00-001^\d{2}-\d{3}$
PortugalPTNNNN-NNN1000-001^\d{4}-\d{3}$
RomaniaRO6 digits010001^\d{6}$
SlovakiaSKNNN NN811 01^\d{3} ?\d{2}$
SloveniaSI4 digits1000^\d{4}$
SpainES5 digits28013^\d{5}$
SwedenSENNN NN111 22^\d{3} ?\d{2}$

Key Non-EU European Countries

CountryISOFormatExampleRegex
United KingdomGBhierarchicalSW1A 1AA^[A-Z]{1,2}\d[A-Z\d]? ?\d[A-Z]{2}$
SwitzerlandCH4 digits8001^\d{4}$
NorwayNO4 digits0150^\d{4}$
IcelandIS3 digits101^\d{3}$
LiechtensteinLI4 digits9490^\d{4}$

The UK Postcode in Detail

The UK system packs more hierarchy into one code than most in Europe. A code like SW1A 1AA decomposes into:

  • SW: postal area (London South West)
  • SW1A: postal district (Whitehall, Westminster and St James's)
  • SW1A 1: postal sector (a few streets)
  • SW1A 1AA: postal unit (specific delivery point, often one building)

This hierarchy means a UK postcode can identify a building, which is why UK products often use postcode as a proxy for neighbourhood-level or even street-level grouping. Ireland's Eircode goes further and gives every individual address its own code.

Production Validation Patterns

The cheapest production approach is a per-country regex table like the one above, applied based on a country code from the address. The country code can come from:

  • An explicit dropdown the user selected
  • The user's IP geolocation
  • The geocoder result (most production geocoders normalise the postal code and include the country code in the response)

Avoid trying to validate a postal code without knowing the country. A 4-digit code is valid in dozens of countries and invalid in many more.

For high-stakes flows (checkout, KYC, regulated industries), don't stop at regex. Send the address to a geocoder and treat a "rooftop" or "street" precision response as the validation, not the regex match alone. A correctly formatted postal code can still fail to match a real address.

Storage and Normalisation

Store postal codes as strings, not numbers. Leading zeros matter (01100 is a valid Lithuanian code; 1100 is not). Storage format conventions:

  • Strip non-alphanumeric characters when comparing across data sets.
  • Display in the country-canonical form (with hyphens, spaces, prefixes) on output.
  • Always store the country code alongside the postal code, even if your product only operates in one country today. The schema scales to multi-country expansion without migration.

How MapAtlas Helps

The MapAtlas Geocoding API returns a normalised address_components.postal_code field for every supported country, validated against the source data. The Search API accepts a postal code as a search input and returns the matching place. Both APIs are EU-hosted, GDPR-compliant, and built on OSM-grade data with explicit per-country address parsers.

For a deeper look at how addresses become coordinates, see What Is a Geocode. For the longitude and latitude mechanics behind every coordinate response, see Longitude vs Latitude.

Frequently Asked Questions

What is the format of European postal codes?

There is no single European postal code format. Each country defines its own. Most use a fixed-length numeric code (5 digits in Germany, France, Italy, Spain; 4 digits in Belgium, Hungary, Austria, Switzerland), but several use alphanumeric codes (Netherlands uses 4 digits plus 2 letters, the United Kingdom uses a complex two-part alphanumeric system, Ireland uses Eircode with 7 alphanumeric characters). A working address validator must hold a per-country pattern for the EU-27 plus key non-EU European countries.

Is a German postal code (Postleitzahl) the same as a Polish postal code?

Both are five characters but the structure differs. Germany uses 5 contiguous digits (e.g. 10115). Poland uses 2 digits, a hyphen, then 3 digits (e.g. 00-001). For storage, you can hold the canonical form with the hyphen for Poland and without for Germany. For matching across data sets, normalise by stripping non-alphanumeric characters and re-applying the country-specific format on display.

How do I validate a postal code from any EU country?

First identify the country (from the address, an ISO 3166-1 alpha-2 country code, or the user's geolocation). Then apply that country's regex pattern. Country-aware validation is the standard production pattern, because a single global regex would either reject valid codes or accept clearly invalid ones. The MapAtlas Geocoding API returns a normalised postal code per country in its `address_components`, so you usually let the geocoder do the validation step for you.

Why does the United Kingdom postal code system look so different?

UK postcodes use a hierarchical alphanumeric system that encodes the postal area, district, sector, and unit in two parts (e.g. SW1A 1AA for Buckingham Palace). It carries more spatial information per code than most country systems, which is why UK postcodes are sometimes used as a proxy for neighbourhood or even individual streets. The system was designed in the 1950s and 1960s and has been retrofitted into modern data infrastructure ever since.

Found this useful? Share it.

About the author

Brent van der Heiden

Written by

Brent van der Heiden

Co-Founder & CEO at MapAtlas

Brent built MapAtlas out of a conviction that developers deserve location APIs with fair pricing and genuine end-user privacy. Before that he co-founded MapMetrics, a community mapping and navigation app. He writes about geospatial infrastructure, map data, AI search visibility, and how location data powers the products people rely on every day.

View all articles →
Back to Blog