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?

Enter the first ZIP code under From, one or more ZIP codes under To, pick the country and the unit, and click Calculate. You get the straight-line distance between the centres of the ZIP code areas.

Is it driving distance?

No, it is the straight-line distance. Driving distance is usually 20 to 30 percent longer, depending on the road network. Straight-line distance is what most shipping-zone, tax and radius calculations use.

How far is it from 10001 to 90210?

About 2,450 miles (3,950 km) in a straight line, from Manhattan, New York to Beverly Hills, California.

Can I calculate distances in Excel?

Yes, with ZIP code coordinates and the Haversine formula. See our guide distance between ZIP codes 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"
    }]
  }
}

Free postal code tools

Start using our ZIP Code API for free today!

Get 300 requests / month for free