AddrGen
AddrGen
Regex & Validation Reference

Postal Code Format by Country

Technical specifications, validation regular expressions (regex), character lengths, and formatting examples for 54 national postal systems worldwide.

International Postal Code Regex Best Practices

When designing global forms or API validation schemas (e.g., Zod, Yup, or Joi), never restrict postal codes to numeric digits. Review key considerations across national standards:

Numeric vs Alphanumeric Systems

Most of Europe and Asia uses 4 to 6 numeric digits (e.g., Germany 5-digit PLZ, France 5-digit, Japan 7-digit). However, the UK, Canada, Netherlands, and Ireland require alphanumeric support.

Leading Zeros Matter

Never parse postal codes as integers. In Massachusetts (02138) or Puerto Rico (00901) or Germany (01067 Dresden), converting to integer strips the leading zero and invalidates the address.

Postal Code Specifications (54 Countries)

Official names, validation regex, and example codes for all supported nations:

Generate Postal Codes
CountrySystem NameExampleValidation RegexGenerator
🇺🇸United States(US)
ZIP Code90210^\d{5}(-\d{4})?$Generate
🇬🇧United Kingdom(GB)
PostcodeSW1A 1AA^[A-Z]{1,2}[0-9][A-Z0-9]? ?[0-9][A-Z]{2}$Generate
🇨🇦Canada(CA)
Postal CodeK1A 0B1^[A-Z]\d[A-Z] \d[A-Z]\d$Generate
🇦🇺Australia(AU)
Postcode2000^\d{4}$Generate
🇧🇩Bangladesh(BD)
Postal Code1212^\d{4}$Generate
🇩🇪Germany(DE)
Postleitzahl (PLZ)10115^\d{5}$Generate
🇮🇳India(IN)
PIN Code110001^\d{6}$Generate
🇯🇵Japan(JP)
Postal Code (Yūbin Bangō)100-0001^\d{3}-\d{4}$Generate
🇫🇷France(FR)
Code Postal75008^\d{5}$Generate
🇧🇷Brazil(BR)
CEP (Código de Endereçamento Postal)01310-100^\d{5}-\d{3}$Generate
🇳🇱Netherlands(NL)
Postcode1012 JS^[1-9][0-9]{3} ?[A-Z]{2}$Generate
🇪🇸Spain(ES)
Código Postal28013^\d{5}$Generate
🇮🇹Italy(IT)
CAP (Codice di Avviamento Postale)00187^\d{5}$Generate
🇸🇬Singapore(SG)
Postal Code018956^\d{6}$Generate
🇲🇽Mexico(MX)
Código Postal06000^\d{5}$Generate
🇦🇷Argentina(AR)
Código PostalC1002AB^[A-Z]?\d{4}[A-Z]{3}$Generate
🇨🇴Colombia(CO)
Código Postal110111^\d{6}$Generate
🇨🇱Chile(CL)
Código Postal8320000^\d{7}$Generate
🇵🇪Peru(PE)
Código Postal15001^\d{5}$Generate
🇨🇭Switzerland(CH)
Postleitzahl (PLZ)8001^\d{4}$Generate
🇸🇪Sweden(SE)
Postnummer111 22^\d{3} ?\d{2}$Generate
🇳🇴Norway(NO)
Postnummer0150^\d{4}$Generate
🇩🇰Denmark(DK)
Postnummer1050^\d{4}$Generate
🇵🇱Poland(PL)
Kod Pocztowy00-001^\d{2}-\d{3}$Generate
🇧🇪Belgium(BE)
Code Postal / Postcode1000^\d{4}$Generate
🇦🇹Austria(AT)
Postleitzahl (PLZ)1010^\d{4}$Generate
🇵🇹Portugal(PT)
Código Postal1000-001^\d{4}-\d{3}$Generate
🇮🇪Ireland(IE)
EircodeD02 X285^[A-Z0-9]{3} [A-Z0-9]{4}$Generate
🇬🇷Greece(GR)
Taxydromikos Kodikas (TK)104 31^\d{3} ?\d{2}$Generate
🇨🇿Czech Republic(CZ)
PSČ (Poštovní směrovací číslo)110 00^\d{3} ?\d{2}$Generate
🇹🇷Turkey(TR)
Posta Kodu34000^\d{5}$Generate
🇨🇳China(CN)
Youzheng Bianma100000^\d{6}$Generate
🇰🇷South Korea(KR)
Postal Code (Guk-ga Gicho Gugyeok)03186^\d{5}$Generate
🇮🇩Indonesia(ID)
Kode Pos10110^\d{5}$Generate
🇲🇾Malaysia(MY)
Poskod50450^\d{5}$Generate
🇵🇭Philippines(PH)
ZIP Code1226^\d{4}$Generate
🇹🇭Thailand(TH)
Postal Code (Rahat Praisani)10110^\d{5}$Generate
🇻🇳Vietnam(VN)
Mã Bưu Chính700000^\d{6}$Generate
🇵🇰Pakistan(PK)
Postal Code75500^\d{5}$Generate
🇳🇵Nepal(NP)
Postal Code44600^\d{5}$Generate
🇸🇦Saudi Arabia(SA)
Postal Code (Al-Ramz Al-Bareedi)11564^\d{5}$Generate
🇦🇪United Arab Emirates(AE)
Makani Number / PO Box00000^\d{5}$Generate
🇮🇱Israel(IL)
Mikud (Postal Code)6473104^\d{7}$Generate
🇳🇿New Zealand(NZ)
Postcode1010^\d{4}$Generate
🇿🇦South Africa(ZA)
Postal Code2001^\d{4}$Generate
🇳🇬Nigeria(NG)
Postal Code100001^\d{6}$Generate
🇪🇬Egypt(EG)
Postal Code (Al-Raqm Al-Bareedi)11511^\d{5}$Generate
🇰🇪Kenya(KE)
Postal Code00100^\d{5}$Generate
🇫🇮Finland(FI)
Postinumero00100^\d{5}$Generate
🇭🇺Hungary(HU)
Irányítószám1051^\d{4}$Generate
🇷🇴Romania(RO)
Cod Poștal010011^\d{6}$Generate
🇱🇰Sri Lanka(LK)
Postal Code00100^\d{5}$Generate
🇲🇦Morocco(MA)
Code Postal20000^\d{5}$Generate
🇬🇭Ghana(GH)
Digital Address (GhanaPostGPS)GA-183-9214^[A-Z]{2}-\d{3}-\d{4}$Generate

Frequently Asked Questions

Common questions regarding postal code structures, regex patterns, and global form validation.