Measurement tool

As the crow flies distance calculator

Straight-line miles, kilometers, and nautical miles between two places, with bearings and the formula worked with your numbers.

Short answer

A straight-line (as the crow flies) distance is the length of the shortest path over the Earth's surface. From Denver, CO to Salt Lake City, UT it is 370.9 miles, heading WNW at the start. Enter any two places below to get yours.
Denver to SLC
371mi
Start heading
283°
370.9 miDenver, COSalt Lake City, UTgraticule 5° · azimuthal equidistant

Formula with your numbers

φ1 = 39.7390°   φ2 = 40.7770°
Δφ = 1.0380°   Δλ = -6.9030°
h  = sin²(Δφ/2) + cos φ1 · cos φ2 · sin²(Δλ/2) = 0.00219260
c  = 2 · asin(√h) = 0.093685 rad
d  = R · c = 6,371.0088 km × 0.093685 = 596.87 km
     596.87 km × 0.621371 = 370.87 mi

Straight-line result

Miles
370.9
Kilometers
596.9
Nautical miles
322.3
Initial bearing
283.4° WNW
Final bearing
278.9° W
Midpoint
40.3093° N, 108.4100° W
Haversine on a sphere of radius 6,371.0088 km. Bearings are true north.

Worked example: Denver to Salt Lake City

The two capital coordinates stored on this site are 39.739, -104.985 for Denver and 40.777, -111.888 for Salt Lake City. The haversine formula turns the latitude and longitude differences into a central angle, then multiplies by the Earth's mean radius.

The result is 596.9 km, which is 370.9 miles or 322.3 nautical miles. A traveler following the great circle leaves Denver on a bearing of 283.4° and arrives on 278.9°. The two bearings differ because a great circle crosses each meridian at a slightly different angle.

How the distance is calculated

Each place becomes a latitude and longitude. Towns come from the Census 2024 Gazetteer internal point, ZIP codes from the ZCTA internal point, and addresses from the Photon geocoder, which searches OpenStreetMap. Pasted coordinates are used as typed.

The calculator then applies the haversine formula on a sphere with a radius of 6,371.0088 km. The formula works with half the chord between the points, which keeps it numerically stable for short hops across town and for long hauls across the country. The panel beside the result prints every intermediate value with your own inputs, so you can check the arithmetic by hand or in a spreadsheet.

Bearings use the same spherical model. The initial bearing is the compass direction you would face when leaving the first place. The final bearing is the direction you would be traveling when you arrive. Both are measured from true north. Magnetic declination is not applied, so a handheld compass will read differently by the local declination.

How to read the result

Miles are statute miles of 1,609.344 meters. Nautical miles are 1,852 meters, the unit pilots and sailors use. The dimension line on the drawing is scaled to the map: the sheet uses an azimuthal equidistant projection centered on the midpoint, which keeps distances from the center true to scale.

The midpoint in the readout lies on the great circle, halfway along it. It is usually not the average of the two latitudes and two longitudes, because meridians converge toward the pole. For towns near that point, use the halfway point finder.

How accurate is a spherical distance?

The Earth is slightly flattened at the poles. On the WGS84 ellipsoid one degree of latitude measures 110.574 km at the equator and 111.694 km near the pole, while the sphere used here gives 111.195 km everywhere. That puts the sphere 0.56% long on north-south legs at the equator and 0.45% short near the poles. For trips inside the lower 48 states the difference is smaller than the uncertainty in where a town's point is placed.

The larger source of error is the input. A town is a single internal point, not its whole footprint, and an address match can land on a street centerline. If you need survey-grade distances, use surveyed coordinates and an ellipsoidal solver.

Why driving distance is longer

Roads follow terrain, property lines, rivers, and bridges. The optional driving check sends both points to the Valhalla router on OpenStreetMap data, and falls back to OSRM if Valhalla does not answer. When both fail, the page says driving distance is unavailable. It never multiplies the straight line by a detour factor, because the ratio varies too much from trip to trip to publish as a single number.

Questions people ask

What does as the crow flies mean?

It means the straight-line distance over the Earth's surface between two points, ignoring roads. On a globe that line is an arc of a great circle.

Which formula does this calculator use?

The haversine formula on a sphere of radius 6,371.0088 km. The page prints the formula with your own coordinates substituted so you can check each step.

Is the distance between two ZIP codes exact?

No. A ZIP code is matched to the Census internal point of its ZIP Code Tabulation Area, so the result is the distance between those two points, not between any two addresses in them.

Why is the final bearing different from the initial bearing?

A great circle is not a line of constant compass heading. It crosses each meridian at a different angle, so the heading changes along the way unless you travel due north, due south, or along the equator.

Can I get the driving distance too?

Yes. Press the driving comparison button. It asks the Valhalla router, then OSRM. If neither responds, the page says so and shows no driving figure.

Sources and data as of

Data as of: Census Vintage 2024 population estimates, 2024 Gazetteer land area and internal points, SAIPE 2023 median household income.

  1. 01Census 2024 Gazetteer, places
  2. 02Census 2024 Gazetteer, ZCTAs
  3. 03Photon geocoder (OpenStreetMap data)
  4. 04Valhalla routing, FOSSGIS public instance
  5. 05OSRM public demo router

How every number is computed: methodology. Spotted a wrong figure? Report an error.