Format and field rules
The base format is five digits, such as 97401. ZIP+4 adds a hyphen and four extension digits, such as 97401-1234.
A ZIP Code is an identifier rather than a number for arithmetic. Storage must preserve leading zeros and allow a hyphen when ZIP+4 is supported.
Recommended test cases
Cover normal input, boundary input, and deliberately invalid input as separate cases.
- Accept 00501 and 97401
- Accept or reject 97401-1234 according to product requirements
- Reject four-digit, six-digit, or alphabetic values
Scope
This guide explains development-test formatting. It does not provide a delivery, identity, or payment verification result.
Authorship and review
- Written by
- Random Address Generator Editorial Team
- Reviewed by
- Data and Format Review Team
- Latest substantive update
- Reviewed the field rules, test examples, and scope for “US ZIP Code and ZIP+4 Format.”