Free tool ยท 149 countries
Postal code validator
Check whether a postal code has the right format for its country and whether it actually exists.
Two checks
- Format: does the code match the country's pattern? Instant, in your browser.
- Existence: is it a real code? Looked up in the zipcodestack database of 7 million codes.
Format and example
Pick a country to see its format.
Format rules for common countries
| Country | Format | Example |
|---|---|---|
| United States | 5 digits, optional +4 | 10001, 10001-2062 |
| United Kingdom | outward + inward code | SW1A 1AA |
| Canada | letter-digit-letter digit-letter-digit | K1A 0B1 |
| Germany | 5 digits | 10115 |
| France | 5 digits | 75008 |
| Netherlands | 4 digits + 2 letters | 1012 AB |
| India | 6 digits | 110001 |
| Brazil | 8 digits (CEP) | 01310-100 |
| Japan | 3 + 4 digits | 100-0001 |
| Australia | 4 digits | 2000 |
All 149 formats, with the regex for each, are on the postal codes by country pages.
Validate postal codes by API
The postal code validation API page explains every field and what the check does and does not cover.
curl "https://api.zipcodestack.com/v1/validate?code=10001&country=us" -H "apikey: YOUR-API-KEY"
The response tells you whether the code exists (valid), whether the format is right (format_valid), the normalized code and the matching places.
Frequently asked questions
How do I check if a postal code is valid?
Why is a code with the right format still invalid?
Can I validate postal codes in my checkout or sign-up form?
Postal code API
Get this data in your app
zipcodestack looks up, validates and searches postal codes in 149 countries: city, state, coordinates, distances and radius search, as JSON.
/v1/validate documentation Postal code validation API All documentation
300 free requests every month. No credit card required.
GET https://api.zipcodestack.com/v1/validate?code=10001&country=us
{
"results": {
"10001": [{
"postal_code": "10001",
"country_code": "US",
"latitude": 40.7484,
"longitude": -73.9967,
"city": "New York",
"state": "New York",
"state_code": "NY",
"province": "New York"
}]
}
}