Tool Hub

Postal Code Format

Postal code regex validation by country + examples

Validation

Pattern: 5 digits

Example: 06236

How to use

  1. Select a country from the searchable dropdown to load its postal code rules.
  2. Type a postal code into the code field.
  3. The tool shows the official regex pattern and a format example for that country.
  4. A green 'Valid' or red 'Invalid' label confirms whether the code matches the pattern.

Examples

  • Selecting Germany (DE) shows the pattern \d{5} with example 10115; entering 10115 returns Valid, whilst entering 1011 returns Invalid.
  • Selecting Canada (CA) shows the pattern [A-Z]\d[A-Z] \d[A-Z]\d with example K1A 0A9; entering K1A 0A9 returns Valid.

Verify outputs before using in production. No warranty — see Terms.