Postal Code Validator
Check whether text is a valid postal code as you type it, right in your browser, without sending it anywhere.
Input
Output
No value
Guide
What is a postal code?
A postal code is the part of an address that tells the post which area a letter or parcel goes to. It's called a ZIP code in the United States and a postcode in the United Kingdom. Each country has its own format: five digits in Germany, France and Italy, four in Austria, Switzerland and Australia, 999-9999 in Japan, A9A 9A9 in Canada and 9999 AA in the Netherlands. A UK postcode such as AA9A 9AA has two halves: the outward code for the town or district and the inward code for a few streets.
You check one when you build an address form for an online shop, set up delivery zones, or clean up a mailing list before sending out party invitations.
Tool description
Type or paste a code into the Postal code field, and the result shows as you type: "Postal code is valid" or "Postal code is not valid". Spaces and line breaks around the code are ignored, while a space inside it passes only where the country's format has one.
The Country menu starts on Any country, where a code passes when it fits the format of at least one country in the list. Pick a country to check against its format alone.
Why pick a country
With Any country, every run of three to eight digits passes, because some country in the list uses that length. With the country picked, the length, the letters and the separators all have to match: four digits pass for Switzerland but fail for Germany.
How the formats differ
- Hyphens that must be there: Japan
999-9999, Poland99-999, Portugal9999-999and US ZIP+4 codes,99999-9999 - Separators you can leave out: the space in Canadian, Dutch and UK codes and in
999 99for Czechia, Slovakia, Greece and Sweden, and the hyphen in Brazil's99999-999 - A space that must be there: Ireland's Eircode,
A99 XXXX - Letters in front: Lithuania
LT-99999and LatviaLV-9999need them, and so do AndorraAD999, AzerbaijanAZ9999and HaitiHT9999, in capitals - Small letters pass in Canadian, Dutch, Irish, Maltese and UK codes
Good to know
- The UK rule also accepts the outward code alone, such as
AA9AorA9, so a postcode missing its second half passes. - A code that passes may not belong to any place: the check looks at the format only.
- To fill in test address forms, the Random Postal Code Generator makes codes in each country's format.
Features
- Postal code formats of countries from Andorra to Zambia
- ZIP+4 codes, UK postcodes, Canadian codes and Eircodes
- Letters, spaces and hyphens checked the way each country writes them
- Results as you type, with no button to press
- Runs in your browser, so nothing you type is sent anywhere