Travel calculators

ZIP Code Distance Calculator

Updated Nov 18, 2026 By Infinity Calculator Formulas Sources
Rate
Locations
    US ZIP (e.g. 90210) or Canadian postal code (e.g. M5V 3L9). City names from the list work too.
    Swap Locations
      Both US and Canadian formats are detected automatically — no country selector needed.
      Output Units & Travel Speed
      Distance Unit
      Switching units converts the results instantly — no recalculation needed.
      Used only for the estimated driving-time output.
      Distance Results
      Straight-Line Distance (As the Crow Flies)
      —
       
      Direct point-to-point geodesic distance between the two resolved coordinates (great-circle, read-only).
      Driving Distance (By Road)
      —
       
      Distance following navigable roads between the two locations (read-only).
      Estimated Driving Time
      —
       
      Road distance divided by your average driving speed — excludes stops and traffic.
      Resolved coordinates and bearing details for the current calculation
      Location A (resolved)—
      Location B (resolved)—
      Initial bearing (A → B)—
      Great-circle midpoint—
      Road / straight-line ratio—
      Step-by-Step Solution
      Straight-Line vs. Driving Distance
      Interactive Map
      Dashed line — Straight-line distance Solid line — Road route Marker A / B — resolved locations
      Focus the map and use the arrow keys to pan, + / - to zoom, or use the buttons above.

      Map of the two resolved locations


      Introduction

      The ZIP Code Distance Calculator tells you how far apart two places are. Type a ZIP code, a Canadian postal code, or a city name from the drop-down list in each box. The tool finds both spots on the map and calculates the distance between them.

      You get three answers right away:

      • Straight-line distance: the direct path, as the crow flies.
      • Driving distance: how far you really drive on roads.
      • Driving time — how long the trip takes at your chosen speed.

      You can switch between miles and kilometers with one click. The results update at once. A chart compares the two distances, and a map shows both points with a dashed line for the straight path and a solid line for the road route.

      Want to see the math? The step-by-step section shows how the great-circle (haversine) formula turns latitude and longitude into a distance. This helps with trip planning, shipping costs, job searches, moving, or just checking how far away a friend lives.

      How to use our ZIP Code Distance Calculator

      Enter two places (ZIP codes, postal codes, or city names) and the calculator shows the straight-line distance, the driving distance by road, and how long the drive takes.

      Location A: Type your start point. You can use a US ZIP code like 90210, a Canadian postal code like M5V 3L9, or a city name. Pick a match from the drop-down list. Only the cities in the list are recognized, and a town whose name matches or is part of a listed city's name is matched to that city, so check the match shown under the box. For any other town, use its ZIP code or postal code instead. A green check means the place was found.

      Location B: Type your end point the same way. It must be a different place than Location A.

      Swap Locations: Click the round arrow button to trade Location A and Location B.

      Distance Unit: Choose Miles or Kilometers. The results change right away.

      Average Driving Speed: Type the speed you expect to drive, then pick mph or km/h. This is used only to guess your driving time.

      Calculate: Click this button to get your results, the step-by-step math, a bar chart, and a map with both points.

      Reset: Click this to empty both fields, set the speed back to 60 mph, and start a new search.

      ZIP Code Distance: What It Means

      A ZIP Code is a code the U.S. Postal Service created to coordinate mail handling and delivery, and the USPS assigns ZIP Codes to delivery routes.1 Canada uses postal codes instead: six characters of letters and numbers in the form ANA NAN.2 An example is M5V 3L9. To measure a distance, the tool uses a center point with a latitude and longitude for each code's general area. When you measure the distance between two ZIP codes, you are really measuring the distance between those two center points.

      Straight-Line Distance vs. Driving Distance

      There are two ways to answer "how far is it?"

      • Straight-line distance (also called "as the crow flies" or great-circle distance) is the shortest path over the curved surface of Earth.3 Nothing blocks it: no roads, rivers, or mountains.
      • Driving distance follows real roads. It is almost always longer, because roads bend, curve, and go around things.6

      How much longer depends on the roads. For trips from every census tract in the United States to the nearest hospital, the road distance was about 1.4 times the straight-line distance, and it ran longest near shorelines, on islands, and near lakes, rivers, and mountains.6 When the routing service finds no road between the two places, such as Honolulu and Los Angeles, the tool shows no driving distance or driving time. When the live routing service is unavailable, the tool estimates the ratio as 1.15 + 0.30 × e−d/150 (d in km), so short trips get the biggest factor and long trips get closer to 1.15. An estimated ratio depends on distance alone, so it says nothing about the roads on your route.

      How the Straight-Line Math Works

      The math uses the haversine formula of spherical trigonometry.3 It takes the latitude and longitude of both points, finds the angle between them at the center of the Earth, and multiplies that angle by Earth's mean radius, about 6,371 km.4 That is about 3,959 miles. This works better than flat-map math because Earth is a ball, not a sheet of paper. On a flat grid you would instead use the Pythagorean theorem.

      Bearing and Midpoint

      The bearing is the compass direction you would head at the start of the trip, from 0° (north) to 360°. On a long trip the direction slowly changes as you follow the curve of the Earth, so the starting bearing is called the "initial bearing." The midpoint is the halfway spot along that curved path, handy if two people want to meet in the middle.

      Driving Time

      Driving time is simple: road distance divided by your average speed. A 300-mile drive at 60 mph takes 5 hours. Real trips take longer because of traffic, red lights, gas stops, food, and weather. Add extra time when you plan.

      Why People Measure ZIP Code Distance

      • Shipping: carriers set rates by zones based on how far a package travels.
      • Job hunting: checking how long a daily commute would be.
      • Moving: comparing towns and figuring out truck mileage.
      • Business: picking delivery areas or store locations.
      • Trip planning: estimating fuel cost and time on the road.

      Things to Keep in Mind

      A ZIP Code covers the addresses on its delivery routes, not a single dot. Big rural ZIP Codes can cover hundreds of square miles, so the center point may sit many miles from your real address. If a code is not in the tool's list and the live postal lookup fails, the tool uses a code from its list that starts with the same characters and marks the match as approximate. That point can be hundreds of miles from the place you typed. Some delivery units are single high-rise buildings or individual business locations with high mail volumes.1 For short trips, a tool that works from full street addresses gives a better answer. For long trips, ZIP-to-ZIP distance is close enough.


      Formulas used

      Haversine term (a) 3
      a = \sin^2\!\left(\frac{\Delta\varphi}{2}\right) + \cos\varphi_1\cos\varphi_2\sin^2\!\left(\frac{\Delta\lambda}{2}\right)
      Central angle 3
      c = 2\,\operatorname{atan2}\!\left(\sqrt{a},\ \sqrt{1-a}\right)
      Straight-line (great-circle) distance
      d = R\,c, \quad R = 6371.0088\ \text{km}
      Kilometers to miles conversion 5
      d_{\text{mi}} = \frac{d_{\text{km}}}{1.609344}
      Road circuity factor and driving distance
      f = 1.15 + 0.30\,e^{-d/150}, \qquad d_{\text{road}} = d \times f
      Estimated driving time
      t = \frac{d_{\text{road}}}{v}
      Initial bearing (A to B)
      \theta = \operatorname{atan2}\!\left(\sin\Delta\lambda\cos\varphi_2,\ \cos\varphi_1\sin\varphi_2 - \sin\varphi_1\cos\varphi_2\cos\Delta\lambda\right)
      Great-circle midpoint
      \varphi_m = \operatorname{atan2}\!\left(\sin\varphi_1 + \sin\varphi_2,\ \sqrt{(\cos\varphi_1 + B_x)^2 + B_y^2}\right),\quad \lambda_m = \lambda_1 + \operatorname{atan2}\!\left(B_y,\ \cos\varphi_1 + B_x\right)

      Frequently asked questions

      What does the road / straight-line ratio mean?

      It shows how much longer the road trip is than the direct path. A ratio of 1.25 means the drive is 25% longer than flying straight. Low ratios mean a clear highway route. High ratios mean lots of turns, water, or mountains in the way.6

      Do you need a full Canadian postal code to identify a general area?

      No. The first three characters are enough. That part is called the Forward Sortation Area (FSA), and it identifies a major geographic area.2 So M5V works the same as M5V 3L9.

      What speed should I enter?

      Use 60 mph (about 97 km/h) for mostly highway trips. Use 25 to 35 mph for city driving. Use 45 to 50 mph for a mix of both. The default is 60 mph.


      Sources

      1. ZIP Code Tabulation Areas (ZCTAs). U.S. Census Bureau. Accessed September 29, 2026.
      2. Addressing guidelines: Postal codes. Canada Post. The structure of the postal code. Accessed September 29, 2026.
      3. American Practical Navigator (Bowditch), Pub. No. 9, Volume II: Useful Tables, Calculations, Glossary of Marine Navigation, 2024 Edition. National Geospatial-Intelligence Agency. 2024;§ 147 Haversine Formulas, p. 206; § 903 Great Circles, p. 284. Accessed September 29, 2026.
      4. Williams DR. Earth Fact Sheet. NASA Goddard Space Flight Center. 2024;Bulk parameters. Accessed September 29, 2026.
      5. NIST Handbook 44 (2026), Appendix C: General Tables of Units of Measurement. National Institute of Standards and Technology. 2026;Units of Length, p. C-23. Accessed September 29, 2026.
      6. Boscoe FP, Henry KA, Zdeb MS. A Nationwide Comparison of Driving Distance Versus Straight-Line Distance to Hospitals. The Professional Geographer. 2012;64(2), Results and Table 1, Discussion and Conclusions. doi:10.1080/00330124.2011.583586. Accessed November 18, 2026.