ZIP Code Validator
Check if any US ZIP code is real, active, and correctly formatted — in under 100 milliseconds.
- ✓ Exactly 5 digits
- ✓ Only numbers (0–9)
- ✓ Must be an active USPS delivery area
- ✓ 41,000+ valid ZIPs covered
Format validation (regex) catches typos but will not catch inactive ZIPs. Always follow with a database lookup to confirm the ZIP is currently active in USPS records.
How to Use the ZIP Code Validator
Format validation (regex) catches typos but will not catch inactive ZIPs. Always follow with a database lookup to confirm the ZIP is currently active in USPS records.
Format Validation
Checks the 5-digit pattern before running the database lookup.
Active Status Check
Confirms the ZIP exists as an active, deliverable code in the current USPS database.
Type Detection
Identifies ZIP type: Standard (S), P.O. Box (B), Unique (U), or Military (M).
US ZIP Code Types: Distribution by Category
Not all ZIP codes serve residential addresses — type validation matters
Who Benefits from This ZIP Code Validator?
Beyond simple lookup, our data helps professionals across industries make accurate, location-based decisions.
Checkout Form Validation
Prevent invalid ZIP codes from entering your order system. Catch P.O. Box ZIPs that cannot receive packages before the order is placed.
Database Hygiene
Validate entire CRM database exports. Flag inactive, leading-zero-truncated, or format-invalid ZIP codes for correction.
Mailing List Prep
Verify every ZIP on a mailing list before printing and mailing. Remove undeliverable ZIPs to avoid wasted postage and NCOA surcharges.
How "Priya" Saved $12,000 in Wasted Direct Mail
Priya team mailed 50,000 pieces without validating ZIPs. 11% were returned — ZIP codes that had been retired, truncated (lost leading zero), or entered as 4 digits by customers.
She ran the list through our ZIP validator before the next campaign, fixed all 5,500 invalid records, and dropped undeliverables to under 1%. The savings paid for list hygiene many times over.
ZIP Code Validation — How to Verify a US ZIP Code is Real and Active
Check if any US ZIP code is real, active, and correctly formatted — in under 100 milliseconds.
ZIP code validation is a foundational data quality practice for any application that collects US addresses. A ZIP code can look valid — five digits, plausible range — yet be inactive, retired, or entirely fabricated. Without database validation, forms accept bad data that cascades into failed deliveries, incorrect tax calculations, broken analytics segments, and poor customer experiences. Our ZIP Code Validator checks every entered ZIP against the full active USPS ZIP code database to confirm it is both correctly formatted and currently active.
Two Levels of ZIP Code Validation
Effective ZIP code validation has two distinct levels that are frequently confused:
Level 1 — Format Validation (Regex): Does the input match the expected pattern of 5 digits, or 5 digits plus a hyphen and 4 more digits for ZIP+4? This can be done entirely client-side without any API call. The standard JavaScript regex is '/^\d{5}(-\d{4})?$/'. This catches obvious errors like letters, wrong length, or missing digits, but it cannot tell you whether the ZIP code actually exists.
Level 2 — Database Validation (Live Lookup): Does the ZIP code exist in the current USPS database as an active, deliverable ZIP code? Format validation would accept "99999" as a valid ZIP — it matches the pattern — but 99999 is not an active USPS ZIP code. Similarly, many 5-digit numbers in the valid range are not assigned. Only a database lookup confirms a ZIP is real. Our validator performs both levels: format check first, then live database lookup.
Format Validation: The Regex Pattern
The standard US ZIP code regex is '^\d{5}$' for 5-digit ZIP codes and '^\d{5}(-\d{4})?$' for ZIP+4. In JavaScript: 'const isValidFormat = /^\d{5}(-\d{4})?$/.test(zip)'. In Python: 'import re; is_valid = bool(re.match(r'^\d{5}(-\d{4})?$', zip))'. For form inputs, apply this regex validation immediately on input or on blur to give instant feedback before the user submits the form.
Common format errors include: entering 4 digits (missing a character), entering 6 digits (extra character), entering a ZIP+4 without the hyphen (e.g., "123456789" instead of "12345-6789"), and — most insidiously — losing the leading zero when a field is stored as a number type, turning "02134" into "2134".
The Leading Zero Problem
ZIP codes in eight states and Puerto Rico begin with 0: Connecticut (060–069), Maine (039–049), Massachusetts (010–027), New Hampshire (030–038), New Jersey (070–089), Rhode Island (028–029), Vermont (050–059), and parts of New York (100–149), plus Puerto Rico (006–009) and the US Virgin Islands (008). When these ZIPs are stored as integers or converted to numbers anywhere in the data pipeline, the leading zero is silently stripped. The resulting 4-digit value fails both format validation and database lookup. Prevention: always store ZIP codes as VARCHAR(5), STRING, or TEXT. In JavaScript, never parseInt() a ZIP code. In Excel, format ZIP columns as Text before entering data. In databases, reject numeric types for ZIP columns in your schema design.
When Format Validation is Insufficient
Many format-valid ZIP codes are not active. USPS periodically retires ZIP codes when delivery routes are consolidated or communities merge. A retired ZIP code retains its format (5 digits) but is no longer in the active database — mail addressed to it is typically returned as undeliverable or redirected. For e-commerce, accepting an inactive ZIP at checkout leads to a failed delivery attempt that triggers a return, a customer service call, and a chargeback. Database-level validation catches these cases at the point of entry.
Additionally, ZIP codes that serve only P.O. Boxes are legitimate, active ZIP codes — but they cannot accept physical package deliveries. If your application ships physical goods, validating ZIP type (Standard vs. P.O. Box) prevents failed deliveries to box-only ZIPs. Our validator returns the ZIP type along with the active/inactive status.
Implementing ZIP Validation in Web Forms
The recommended pattern for ZIP validation in web forms: (1) Apply regex validation client-side on blur to catch format errors instantly without an API call. (2) Call the ZIP validation API after the user finishes typing in the ZIP field (use a 500ms debounce). (3) If the ZIP is active, auto-populate city, state, and county fields. (4) If the ZIP is invalid, show a clear inline error message with guidance (e.g., "This ZIP code is not recognized. Please check and re-enter."). (5) For ZIP+4 fields, validate both the 5-digit and 4-digit components separately before combining.
ZIP Code Validation for CRM and Database Hygiene
Existing databases often contain ZIP codes that were valid when entered but have since been retired, or that were entered incorrectly in the first place. A ZIP code hygiene pass across a CRM database: run each ZIP through format validation first (flag those that fail regex), then run the format-valid ZIPs through database validation (flag inactive ZIPs), and finally append city, state, and county to all active ZIP records to complete the enrichment. This process dramatically improves the reliability of geographic segmentation in the database.
Batch ZIP Validation for Large Lists
For batch validation of thousands or millions of ZIP codes (e.g., a mailing list, a customer database export, or a prospect list from a data vendor), individual lookups are too slow. USPS offers bulk address validation through its Address Information Center products. Third-party data quality platforms (Melissa Data, SmartyStreets, USPS AIS) support batch ZIP validation with delivery point validation (DPV) that confirms deliverability at the individual address level, not just at the ZIP level.
Official Data Sources & Resources
We verify our data against official United States government databases to ensure accuracy.
*This website is a private tool and is not affiliated with the USPS or the US Government. "ZIP Code" is a registered trademark of the USPS.
🔗 Related ZIP Tools
View all tools →Frequently Asked Questions
Real questions from users — answered with detail and precision.
I enter ZIP 99999 and it passes my regex but your tool says invalid — why?▼
How do I implement ZIP code validation in a React checkout form?▼
A customer ZIP code passes validation but their package was returned. What happened?▼
What is the difference between a 'retired' ZIP code and an 'inactive' ZIP code?▼
Our database has thousands of 4-digit ZIPs — someone stored them as integers. How do we fix this at scale?▼
Can I validate ZIP codes that users enter with spaces or dashes, like '1 0 0 0 1' or '10-001'?▼
I am validating ZIP codes from a form where users can enter Canadian postal codes — how do I distinguish them?▼
What is a 'unique' ZIP code (type U) and should I reject orders from those ZIPs?▼
Does ZIP code validation catch fake addresses used for fraud?▼
How often do ZIP codes get retired and how do I keep my validation database current?▼
What happens if my e-commerce checkout accepts a P.O. Box ZIP code?▼
Is the ZIP Code Validator on TOOLTRIO free?▼
TOOLTRIO — Free ZIP Code Tool Suite
TOOLTRIO (also searched as Tool Trio, ToolTrio, Trio Tools) is a free suite of 35+ US ZIP code tools. No signup, no rate limits. Every tool is free forever on tooltrio.com.
