Free tool ยท miles & km
Distance between ZIP codes
Calculate how far apart two ZIP codes are, or compare one code with several others at once.
How ZIP code distances are calculated
Every ZIP code has a centre point (latitude and longitude). The distance between two codes is the great-circle distance between these points, calculated with the Haversine formula, which accounts for the curvature of the earth:
d = 2r ยท asin( โ( sinยฒ(ฮฯ/2) + cos ฯ1 ยท cos ฯ2 ยท sinยฒ(ฮฮป/2) ) )
where ฯ is latitude, ฮป is longitude and r is the earth’s radius (3,959 miles or 6,371 km).
Distances by API
Pricing, limits and the radius endpoint are on the ZIP code distance and radius API page.
Compare one code with up to 100 others in a single request:
curl "https://api.zipcodestack.com/v1/distance?code=10001&compare=90210,60601&country=us&unit=miles" \
-H "apikey: YOUR-API-KEY"
Frequently asked questions
How do I calculate the distance between two ZIP codes?
Is it driving distance?
How far is it from 10001 to 90210?
Can I calculate distances in Excel?
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/distance documentation Distance & radius API All documentation
300 free requests every month. No credit card required.
GET https://api.zipcodestack.com/v1/distance?code=10001&compare=90210,60601&country=us&unit=miles
{
"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"
}]
}
}