ZIP and postal codes
ZIP and postal codes are short and structured, which tempts forms to reject valid ones over a space, a dash or a capital letter.
The answer
Accept ZIP and postal codes however they are typed, and don’t require one where people may not have one that works. As strong as the weakest rule behind it: weak.
-
Accept ZIP and postal codes with or without spaces or dashes, in any case, and tidy them yourself.
GOV.UK guidance, reopened and checked; consistent with Input masks and formatting as you type, rule 1. One source for ZIP codes, so 2.
- Applies when
- Always.
- Based on
- Convention
- Principle
- Prevent errors
- Common mistake
- Rejecting a ZIP code for a missing or extra space (rule 2).
- StandardStandard: Postcode data element (UK Government Data Standards Catalogue v2.1, via NHS Data Dictionary)NHS England Data Dictionary reproducing UK Government Data Standards Catalogue, 2002
- GuidanceGuidance: Ask users for addresses (GOV.UK Design System pattern)GOV.UK Design System
-
Don’t require a ZIP or postal code where some people won’t have one that works.
Google's guidance and one company account. Rated 2.
- Applies when
- Users are in more than one country.
- Based on
- Convention
- Depends on
- Where users live
- Principle
- Prevent errors
- ExperimentExperiment: Solving Italian address input with Google PlacesJust Eat Takeaway.com technology blog, 2016
- GuidanceGuidance: Learn Forms: Address formsweb.dev, 2021
The other rules
-
Mark the ZIP or postal code field with the postal-code autocomplete token.
WCAG 2.2 level AA (1.3.5).
- Applies when
- The person is entering their own details.
- Based on
- Standard or law
- Depends on
- Whose details they enter
- Principle
- Work for everyone
- StandardStandard: HTML Standard: autofill field names for addressesWHATWG
- GuidanceGuidance: wcag22-1.3.5
-
Where the data is reliable, fill in the city from the ZIP code, and let people change it.
Baymard recommends it from testing; Google's guidance advises against relying on ZIP code lookup; one company's own write-up describes ZIP codes proving unusable for one country. Conflicting, so 2.
- Applies when
- Users are in a country with reliable ZIP code data.
- Based on
- Practitioner research
- Depends on
- Where users live
- Principle
- Let practiced people go faster
- ExperimentsExperiment: Checkout usability: auto-detect City and State from the postal codeBaymard Institute, 2023
- Experiment: Solving Italian address input with Google PlacesJust Eat Takeaway.com technology blog, 2016
- GuidanceGuidance: Learn Forms: Address formsweb.dev, 2021
-
Show a number pad only when every code you accept is all digits, as US ZIP codes are.
No source gives evidence. Rated 1.
- Applies when
- On small touch screens.
- Based on
- Convention
- Depends on
- Device and screen
- Principle
- Let practiced people go faster
- GuidanceGuidance: Ask users for addresses (GOV.UK Design System pattern)GOV.UK Design System
Accessibility
Open questions
- OpenNo study of ZIP code entry was found.
- OpenKeyboard type (rule 5).
Checked November 12, 2026
Sources
- ExperimentsExperiment: Checkout usability: auto-detect City and State from the postal codeBaymard Institute, 2023
- Experiment: Solving Italian address input with Google PlacesJust Eat Takeaway.com technology blog, 2016
- StandardsStandard: HTML Standard: autofill field names for addressesWHATWG
- Standard: Postcode data element (UK Government Data Standards Catalogue v2.1, via NHS Data Dictionary)NHS England Data Dictionary reproducing UK Government Data Standards Catalogue, 2002
- GuidanceGuidance: wcag22-1.3.5
- Guidance: Ask users for addresses (GOV.UK Design System pattern)GOV.UK Design System
- Guidance: Learn Forms: Address formsweb.dev, 2021
Related
- Postal addressOffer an address lookup where the data is reliable, and always let people type the address by hand.Answer: moderate.
- Input masks and formatting as you typeAccept the separators people type and clean them up yourself, and show the expected shape outside the field.Answer: moderate.
- Field width as a hintSize each field to the length of the answer you expect.Answer: moderate.