Field guide
ZIP Code vs Postal Code
A ZIP Code is the U.S. postal routing code. Postal code is the broader international term used by many countries. Forms that label every field as ZIP Code may confuse users outside the United States.
Examples by country
- United States: 10001 or 90210.
- Canada: M5V 1Z7.
- United Kingdom: SW1A 1AA.
- Germany and France: five digits.
- Singapore and India: six digits.
Form design advice
Use country-aware labels such as ZIP Code for the United States, postcode for the UK and Australia, PIN code for India, and postal code as a neutral fallback.
QA notes
Test letters, spaces, hyphens, leading zeros, four-digit postcodes, five-digit postal codes, and six-digit codes. Avoid a single numeric-only rule for every country.
Validation matrix
| Country | Example | Required data behavior |
|---|---|---|
| United States | 02108 or 10001-1234 | Preserve a leading zero and optional ZIP+4 hyphen |
| Canada | M5V 1Z7 | Accept letters and normalize the central space |
| United Kingdom | SW1A 1AA | Accept variable length and letters |
| Netherlands | 1012 AB | Do not apply numeric-only validation |
| Singapore | 079903 | Preserve six digits including the leading zero |
Implementation rule
Store postal values as strings. Select the country first, then apply a country-specific label and conservative shape validation. A regex can identify an obvious formatting error, but it cannot confirm that a code exists, matches the city, or is deliverable.
Regression cases
- JSON serialization does not convert 02108 to a number.
- Whitespace normalization never removes the required internal space.
- Changing country replaces the rule without erasing a value before confirmation.
- CSV import and export preserve letters, zeros, spaces, and hyphens.
Country-switch test sequence
- Select the United States and enter
02108. Confirm that the label says ZIP Code and the leading zero remains. - Change to Canada and enter
M5V 1Z7. Confirm that letters and the internal space are accepted. - Change to the United Kingdom and enter
SW1A 1AA. Confirm that a U.S. length rule is no longer active. - Return to the original country and verify that the product either restores the country-specific value or clearly asks for a replacement.
Record the displayed label, submitted payload, stored value, and validation message for each step. The test fails if the country selector changes only the label while leaving an incompatible validator behind. Deliverability and city matching should remain separate services from conservative input-shape validation.