Travel calculators

ZIP Code Distance Calculator

Updated Aug 20, 2026 By Jehan Wadia
Rate Formulas
Locations
    US ZIP (e.g. 90210) or Canadian postal code (e.g. M5V 3L9). City names 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 in each box. The tool finds both spots on the map and does the math for you.

      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. If you already know the coordinates, the lat/long distance calculator works from those numbers directly, and the distance between two locations calculator handles free-form place names. 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. 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. Need other conversions? Try the unit converter.

      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. To work backward from time to speed, use the speed, distance and time calculator.

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

      Clear / Reset: Click this to empty both fields and start a new search.

      ZIP Code Distance: What It Means

      A ZIP code is a short number the U.S. Postal Service uses to mark a delivery area. Canada uses postal codes instead, made of letters and numbers, like M5V 3L9. Each code covers a small piece of land, so every code has a center point with a latitude and longitude. 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. Nothing blocks it — no roads, rivers, or mountains. This is the same measure used by the air miles calculator for flight routes.
      • Driving distance follows real roads. It is always longer, because roads bend, curve, and go around things.

      Driving distance is usually about 1.2 to 1.4 times the straight-line distance. Short city trips have the biggest gap, since city streets zigzag. Long highway trips get closer to a straight line. For a plain coordinate-geometry version of the same idea, see the distance calculator.

      How the Straight-Line Math Works

      The math uses the haversine formula. 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 radius (about 3,959 miles or 6,371 km). 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. The midpoint calculator does the same job for plain coordinates.

      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. The drive time calculator and the ETA calculator help you pin down an arrival time, and the average speed calculator checks the pace you actually kept. For flights instead of drives, use the flight time calculator, and remember to check the time zone difference on long trips.

      Why People Measure ZIP Code Distance

      Things to Keep in Mind

      A ZIP code is an area, not a single dot. Big rural ZIP codes can stretch for many miles, so the center point may sit a few miles from your real address. Some ZIP codes only serve one building or a group of P.O. boxes and cover almost no land at all. For short trips, use a full street address for the best answer — or the walking distance calculator if you are on foot. For long trips, ZIP-to-ZIP distance is close enough, and the travel distance calculator covers routes that mix driving and flying.


      Formulas used

      Haversine term (a)
      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
      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
      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

      Why does my driving distance say Estimate instead of Live route?

      The tool first tries to pull a real road route from a live routing service. If that service is slow or busy, it falls back to a math estimate. The estimate multiplies the straight-line distance by a road-circuity factor (about 1.15 to 1.45). Click Calculate Distance again to try the live route once more.

      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.

      Why does my result say the match is approximate?

      Your code was not in the built-in list, so the tool picked the closest known code in the same area. It then checks live postal data to fix the spot. An orange box means approximate. A green box means an exact match.

      Can I use a ZIP+4 code like 90210-1234?

      Yes. The tool reads the first 5 digits and ignores the last 4. The extra 4 digits point to a street or building, which is smaller than what this tool measures.

      Do I have to type a full Canadian postal code?

      No. The first three characters are enough. That part is called the FSA, and it marks the area. So M5V works the same as M5V 3L9.

      Why can't the tool find my ZIP code?

      Check for typos first. US codes need 5 digits. Canadian codes follow a letter-number-letter pattern. If the code is still not found, type the city name instead, or use a nearby larger ZIP code.

      Does the calculator work outside the US and Canada?

      No. It reads US ZIP codes and Canadian postal codes only. For other countries, use a tool that takes latitude and longitude or full place names.

      How accurate is the distance?

      The straight-line math is very accurate, usually within a fraction of a mile. The driving distance is accurate when a live route loads. The main wobble comes from the ZIP code center point, which may sit a few miles from your exact address in big rural areas.

      Does the driving time include traffic, tolls, or stops?

      No. It is just road distance divided by your average speed. Add extra time for traffic, gas, food, and rest. A good rule is to add 10 to 20 percent to the number shown.

      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.

      Does swapping the two locations change the distance?

      No. The distance is the same both ways. The bearing does change, because you now start facing the other direction. Swapping is handy when you want to see the return trip direction.

      Why do I get an error when both boxes have the same place?

      Two matching locations give a distance of zero, so the tool asks you to pick a different second spot. This can happen if two nearby ZIP codes share the same center point in the data.

      How do I use the map?

      Use the buttons to zoom in, zoom out, or pan. Click Fit both points to see the whole trip. You can also click the map and use arrow keys to move, plus the + and - keys to zoom.

      What do the dashed and solid lines on the map mean?

      The blue dashed line is the straight-line distance. The red solid line is the road route. When a live route loads, the red line follows real roads. When it does not, the red line is a gentle curve that stands in for the road path.

      Can I type a city name instead of a code?

      Yes. Type the city and pick a match from the drop-down list. To narrow it down, add the state or province, like Springfield, MA. This helps when many cities share one name.

      Do I need to recalculate after switching miles to kilometers?

      No. The numbers convert right away. The cards, the chart, the map label, and the step-by-step math all update on their own.

      Can I use this for flight distance?

      Use the straight-line number. That is the same great-circle distance airlines use to measure routes. Real flights fly a bit farther because of air traffic paths and weather.

      Does this tool work on a phone?

      Yes. The boxes, buttons, chart, and map all resize for small screens. Nothing is saved or shared, and it is free to use as many times as you like.