United States ZIP code validator
How the ZIP code format works
- Format
- 5 digits, optionally followed by 4 more digits (ZIP+4)
- Example
- 90210
Things to watch for
- Format-only check — does not confirm the ZIP code actually exists
- Accepts both the 5-digit ZIP and the 9-digit ZIP+4 (written as 00000-0000) once spaces are stripped
^[0-9]{5}([0-9]{4})?$A US ZIP code is the address code the United States Postal Service uses to route mail, most often written as 5 digits (e.g. 90210) or extended to a 9-digit ZIP+4 (90210-1234) for more precise delivery. Anyone validating a shipping address, checking out a customer, or cleaning up a spreadsheet of US addresses needs the code to at least be the right shape before it’s trusted.
Typos are easy to make and easy to miss: a transposed digit still looks like a plausible ZIP code, and a 9-digit ZIP+4 with a missing hyphen or a stray letter can slip through a form that isn’t checking length or character type. Catching that at entry is far cheaper than a returned shipment or a failed checkout later.
What this validator checks
This tool confirms the input is exactly 5 digits, or 5 digits followed by 4 more (with or without the hyphen, since spaces and the separator are stripped before matching). It runs entirely in your browser — nothing is sent anywhere, and there’s no signup.
What a pass doesn’t tell you
A ZIP code doesn’t carry a check digit, so matching the shape is the most a client-side check can confirm. It doesn’t verify the ZIP is currently assigned, that the ZIP+4 suffix is real, or that the code matches the rest of the address. Confirming any of that requires the USPS’s own ZIP Code Lookup or an address-verification API with access to their database.
Scope: format validation only — not address lookup, deliverability, or ZIP+4 assignment, none of which a format check alone can tell you.
ZIP code FAQ
What's the difference between a ZIP code and ZIP+4?
The base ZIP code is 5 digits and routes mail to a delivery area served by one post office. ZIP+4 adds 4 more digits after a hyphen (e.g. 90210-1234) that narrow delivery down to a specific side of a street, a building, or even a single high-volume mailbox.
Does the first digit of a ZIP code mean anything?
Yes — the first digit broadly identifies one of ten geographic groups the USPS uses to sort mail, running roughly from the Northeast (0 and 1) to the West Coast (9). It's a routing hint, not a strict state boundary, so it isn't something a format check can rely on beyond confirming a digit is present.
Does a correctly formatted ZIP code mean it actually exists?
No. This tool only confirms the string is 5 digits, or 5 digits plus a hyphen and 4 more, once spaces are stripped. It doesn't check the code against the USPS's actual assignment list — that requires the USPS ZIP Code Lookup tool.