# 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.

Area: Forms. Evidence behind the answer: Weak. Last checked November 12, 2026.
Page: https://uxreference.com/forms/postcode

## The answer

Accept ZIP and postal codes however they are typed, and don’t require one where people may not have one that works.

- **Weak.** Accept ZIP and postal codes with or without spaces or dashes, in any case, and tidy them yourself. (https://uxreference.com/forms/postcode#rule-2)
- **Weak.** Don’t require a ZIP or postal code where some people won’t have one that works. (https://uxreference.com/forms/postcode#rule-4)

## The problem

ZIP codes are short and structured, which tempts forms into rejecting valid ones over spacing or case, and not every country has usable ZIP codes.

## How to decide

None. The sources do not describe more than one correct practice that depends on context.

## Every rule

Each rule has a grade: Settled (required by WCAG AA or law, or replicated research), Strong, Moderate, Weak, or Unsettled (use the stated default until the evidence settles).

#### Rule 1. Settled, WCAG AA

Mark a field for the person's own ZIP code with the postal code token.

- Applies when: The person is entering their own details.
- Based on: Standard or law
- Depends on: Whose details they enter
- Principle: Work for everyone

Why: WCAG 2.2 level AA (1.3.5).

Sources: wcag22-1.3.5; [HTML Standard: autofill field names for addresses](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute)

Link: https://uxreference.com/forms/postcode#rule-1

#### Rule 2. Weak

Accept a ZIP code in upper or lower case, with or without spaces or punctuation, and tidy it yourself.

- Applies when: Always.
- Based on: Convention
- Principle: Prevent errors

Why: GOV.UK guidance, reopened and checked; consistent with [Input masks and formatting as you type, rule 1](https://uxreference.com/forms/input-masks#rule-1). One source for ZIP codes, so 2.

Sources: [Ask users for addresses (GOV.UK Design System pattern)](https://design-system.service.gov.uk/patterns/addresses); [Postcode data element (UK Government Data Standards Catalogue v2.1, via NHS Data Dictionary)](https://v2.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/postcode_de.asp@shownav=0.html)

Link: https://uxreference.com/forms/postcode#rule-2

#### Rule 3. Weak

Where ZIP code data is reliable, fill in the city and state from the ZIP code, and let the person change them.

- 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

Why: 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.

Sources: [Checkout usability: auto-detect City and State from the postal code](https://baymard.com/blog/zip-code-auto-detection); [Learn Forms: Address forms](https://web.dev/learn/forms/address); [Solving Italian address input with Google Places](https://tech.justeattakeaway.com/?p=464606)

Link: https://uxreference.com/forms/postcode#rule-3

#### Rule 4. Weak

Do not require a ZIP code where some people will not have one that works.

- Applies when: Users are in more than one country.
- Based on: Convention
- Depends on: Where users live
- Principle: Prevent errors

Why: Google's guidance and one company account. Rated 2.

Sources: [Learn Forms: Address forms](https://web.dev/learn/forms/address); [Solving Italian address input with Google Places](https://tech.justeattakeaway.com/?p=464606)

Link: https://uxreference.com/forms/postcode#rule-4

#### Rule 5. Unsettled

Which on-screen keyboard to ask for is unsettled, because ZIP codes contain letters in some countries and only digits in others.

Until the evidence settles, use this default: Ask for a numeric keyboard only when every accepted ZIP code is all digits.

- Applies when: On small touch screens.
- Based on: Convention
- Depends on: Device and screen
- Principle: Let practiced people go faster

Why: No source gives evidence. Rated 1.

Sources: [Ask users for addresses (GOV.UK Design System pattern)](https://design-system.service.gov.uk/patterns/addresses)

Link: https://uxreference.com/forms/postcode#rule-5

## Accessibility requirements

- WCAG 2.2, 1.3.5 Identify Input Purpose (AA). (https://www.w3.org/WAI/WCAG22/Understanding/identify-input-purpose.html)

## Common mistakes

- Rejecting a ZIP code for a missing or extra space ([rule 2](https://uxreference.com/forms/postcode#rule-2)).

## Still open

- No study of ZIP code entry was found.
- Keyboard type ([rule 5](https://uxreference.com/forms/postcode#rule-5)).

## Related problems

- [Postal address](https://uxreference.com/forms/address): Offer an address lookup where the data is reliable, and always let people type the address by hand.
- [Input masks and formatting as you type](https://uxreference.com/forms/input-masks): Accept the separators people type and clean them up yourself, and show the expected shape outside the field.
- [Field width as a hint](https://uxreference.com/forms/field-width): Size each field to the length of the answer you expect.

## Sources

- wcag22-1.3.5. n.d..
- [HTML Standard: autofill field names for addresses](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute). WHATWG, n.d., normative standard.
- [Ask users for addresses (GOV.UK Design System pattern)](https://design-system.service.gov.uk/patterns/addresses). GOV.UK Design System, Government Digital Service, n.d., pattern documentation; points to a GitHub discussion for research, none summarized on the page.
- [Postcode data element (UK Government Data Standards Catalogue v2.1, via NHS Data Dictionary)](https://v2.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/postcode_de.asp@shownav=0.html). NHS England Data Dictionary reproducing UK Government Data Standards Catalogue, 2002, normative data standard.
- [Checkout usability: auto-detect City and State from the postal code](https://baymard.com/blog/zip-code-auto-detection). Baymard Institute (Edward Scott), 2023, moderated usability testing (multi-round checkout research) plus site benchmark; one client A/B test mentioned.
- [Learn Forms: Address forms](https://web.dev/learn/forms/address). web.dev (Google), 2021, expert opinion (platform vendor course lesson).
- [Solving Italian address input with Google Places](https://tech.justeattakeaway.com/?p=464606). Just Eat Takeaway.com technology blog, 2016, company-reported A/B tests (three autocomplete variants against four-field control).

---
From Solved Problems in UX by Athen Pellicci, an evidence-graded reference of web interface problems. CC BY 4.0. https://uxreference.com/
