AddressLab · Guides
US ZIP Code Field Tests: Nine Inputs and Their Results
First published: · Chrome · 2026-10-24
Test a ZIP field as text and decide whether your product accepts only canonical input or also normalizes alternatives. In the AddressLab postal checker, six of nine inputs passed after normalization, including full-width digits and an internal space; three were rejected. This describes the tool’s syntax behavior, not whether any ZIP+4 is assigned.
For developers deciding the acceptance and storage contract of a US ZIP field. We selected United States and tested the exact nine raw strings below in a local Chrome production build. JSON notation makes the leading/trailing spaces and empty string visible.
The nine raw inputs and actual outputs
Open the Postal Code Format Checker, select United States, enter each raw value and select Check format. Reset or replace the input between runs. The two ZIP+4 strings below are hand-written syntax cases, not a lookup of an assigned delivery code.
| Raw input (JSON notation) | Normalized output | Observed syntax result |
|---|---|---|
"02108" | 02108 | Accepted |
"02108-1234" | 02108-1234 | Accepted |
"021081234" | 02108-1234 | Accepted |
" 02108 " | 02108 | Accepted |
"02 108" | 02108 | Accepted |
"02108" | 02108 | Accepted |
"2108" | 2108 | Rejected |
"0210A" | 0210A | Rejected |
"" | (empty) | Rejected |
The checker removes whitespace, applies Unicode compatibility normalization and inserts a hyphen in nine compact digits. That explains why 02 108 passes here. It is a product normalization decision, not evidence that an internal space is the canonical postal presentation.
Accepting an alternative is different from storing it unchanged

If your application accepts the compact input, record which value the server stores and what the user sees after reopening. Send both raw and normalized values to your own QA log when useful, but do not expose real customer addresses in public bug reports. A frontend success is insufficient if the backend applies a different rule.
Do not assume this normalization also happens inside the separate Address Form Tester. Test the actual component used by the workflow.
A rejection should preserve a useful correction path

A four-digit value such as 2108 is not automatically a damaged 02108. It could be an incomplete entry. Do not prepend zero to every rejected value. Ask the user to confirm, or compare against the original trusted record if a known numeric import stripped the zero.
For required fields, empty input should fail; for optional fields, your application may use a different contract. The table records this checker’s empty-input rejection, not a universal requirement for every form.
Write a small, explicit field contract
| Decision | What to specify |
|---|---|
| Input type | Text, with numeric keyboard hints if useful; do not treat ZIP as an arithmetic quantity. |
| Accepted forms | Five digits; ZIP+4 if supported; explicitly chosen normalization alternatives. |
| Stored value | String, including leading zero and optional ZIP+4 hyphen. |
| Failure message | Field-specific reason plus a way to correct the original input. |
| Matching | A separate authorized address-matching step if required by the real delivery workflow. |
USPS documents last-line address presentation. HTML input rules control browser behavior. Neither a generic text field nor a local regex queries postal assignments. Use the save and export walkthrough to test persistence after acceptance.
Keep syntax, matching and delivery separate
Every result here is local. No USPS query, recipient check or mailing was performed. A syntactically accepted code does not prove the city/state combination, unit number, resident or selected carrier service. Adding a hand-written ZIP+4 merely to satisfy the field can make a real destination less accurate.
When investigating an import defect, preserve the original CSV and inspect its text before changing values. Spreadsheet import is a different test from this browser input matrix.
Sources and test scope
AddressLab used AI assistance to organize this guide and checked it against the recorded browser operations and the primary references below. Tests ran on 24 October 2026 against a local production build in isolated Chrome. External advertising and analytics requests were blocked during functional QA. These observations do not prove address assignment, delivery, mailbox ownership or tax outcomes.