You have two coordinate pairs — a start and an end — and you want a single number back: how far apart are they, in kilometres or miles? Here's the right way to measure that distance across the curved surface of the Earth: the Haversine formula with one worked example, a rule of thumb you can do in your head, and why plain flat-map geometry lies to you over long spans.
Why coordinate distance is not just a ruler
If two points were printed on a flat sheet of paper, the distance between them would be the straight line you learned in school: the hypotenuse of a right triangle, from the Pythagorean theorem. Coordinates are not on a flat sheet. They live on the surface of a sphere — or more precisely an ellipsoid, the slightly squashed shape of the Earth. The shortest path between two points on a sphere is not a straight line through the rock; it is an arc that hugs the surface.
That arc is called a great-circle distance. A great circle is any circle drawn on the globe whose centre is the centre of the Earth — the equator is one, and every line of longitude paired with its opposite is one. Slice the planet through both of your points and through its core, and the shorter piece of that circle's rim is the great-circle distance. It is the "as the crow flies" number, and it is what every coordinate-distance calculation is really computing.
This is also why long flights look curved on a flat map. A plane from London to Tokyo arcs north over the Arctic because that great-circle path is genuinely shorter than the straight east–west line the flat map suggests — the map is distorted, not the route.
The Haversine formula, in plain terms
The Haversine formula is the standard way to compute great-circle distance from two latitude/longitude pairs. It treats the Earth as a perfect sphere, accurate to within about 0.5%: more than good enough for hiking, driving, and almost everything short of survey-grade work.
It takes four inputs — two latitudes and two longitudes — plus the Earth's radius, and returns one distance. The name comes from the haversine, an old trigonometric function equal to sin²(θ/2), which navigators used precisely because it stays numerically stable for the very small angles you get between nearby points.
Here is the formula. Every angle must be in radians, not degrees, before it goes into a sine or cosine — that is the single most common mistake, so convert first by multiplying degrees by π / 180.
- a = sin²(Δφ / 2) + cos(φ₁) · cos(φ₂) · sin²(Δλ / 2)
- c = 2 · atan2(√a, √(1 − a)) — equivalently, c = 2 · asin(√a)
- distance = R · c
Where φ (phi) is latitude, λ (lambda) is longitude, Δφ is the difference in latitude (φ₂ − φ₁), Δλ is the difference in longitude (λ₂ − λ₁), and R is the Earth's mean radius — 6,371 km (about 3,959 miles). The intermediate value a is the square of half the chord length between the points; c turns that back into an angle in radians; multiplying by R turns the angle into a real-world arc length.
One worked example, step by step
Let's measure the distance between two clean points so the arithmetic stays readable:
- Point A: latitude 50.0000, longitude 5.0000
- Point B: latitude 58.0000, longitude 3.0000
Work top to bottom. Keep a few extra decimals through the middle and only round at the very end — rounding early throws the answer off.
- Find the differences in degrees. Δφ = 58 − 50 = 8.0°. Δλ = 3 − 5 = −2.0°. (The sign of Δλ does not matter here because it gets squared, but keep your bookkeeping honest.)
- Convert everything to radians (× π / 180). Δφ = 0.13963 rad, Δλ = −0.03491 rad. You also need the two latitudes in radians for their cosines: cos(50°) = 0.64279, cos(58°) = 0.52992.
- First term: sin(Δφ / 2) = sin(0.069816) = 0.069756, and squaring gives 0.004866.
- Second term: sin(Δλ / 2) = sin(−0.017453) = −0.017452, squared = 0.000305. Multiply by the two cosines: 0.64279 × 0.52992 × 0.000305 = 0.000104.
- Add them to get a: 0.004866 + 0.000104 = 0.00497.
- Get c: √a = 0.0705, so c = 2 · asin(0.0705) = 0.14111 radians.
- Multiply by R: 6,371 × 0.14111 = 899.0 km.
To convert to miles, multiply kilometres by 0.621371: 899.0 × 0.621371 ≈ 558.6 miles. (Or use R = 3,959 miles directly in the last step and skip the conversion.) That is the great-circle distance between the two points — the straight-line-on-the-globe answer.
Reading the result back
Notice that the latitude term (0.004866) dwarfs the longitude term (0.000104) here, because the points differ by 8° of latitude but only 2° of longitude — and that longitude gap is further shrunk by the cosines, since meridians crowd together as you move away from the equator. That cosine factor is the whole reason the next two sections exist.
The one-degree-equals-111-km rule of thumb
For a fast mental estimate without any trigonometry, lean on a single fact: one degree of latitude is about 111 kilometres (roughly 69 miles) everywhere on Earth. Latitude lines are evenly spaced from pole to pole, so this holds anywhere. Break it down and it gets even handier:
| Unit of latitude | Approximate ground distance |
|---|---|
| 1 degree | 111 km (69 mi) |
| 1 minute (1/60°) | 1.85 km — almost exactly one nautical mile |
| 1 second (1/3600°) | 31 m |
| 0.0001° (4th decimal) | about 11 m |
Longitude is the catch. One degree of longitude is 111 km only at the equator. As you move toward the poles the meridians converge, so a degree of longitude shrinks — scaled by the cosine of your latitude. At 50° north a degree of longitude is about 111 × cos(50°) ≈ 71 km; at 60° it is about 55 km; at the pole it collapses to zero. So a quick estimate is: north–south distance ≈ 111 × Δlatitude, and east–west distance ≈ 111 × Δlongitude × cos(latitude), then combine the two with Pythagoras. For our worked example that shortcut gives roughly √((8 × 111)² + (2 × 71)²) ≈ 899 km — bang on, because the points are close enough in longitude for the flat approximation to survive.
Why flat Pythagorean distance goes wrong
It is tempting to skip all the trigonometry and treat the two coordinate pairs as plain (x, y) points: distance = √((Δlat)² + (Δlon)²), maybe scaled by 111 km. Over a few kilometres this is fine. Over long distances, or anywhere far from the equator, it breaks in two ways.
- It ignores curvature. Flat geometry measures a straight chord; the Earth curves underneath it. The error grows with distance and is what makes flat estimates drift over hundreds of kilometres.
- It treats a degree of longitude as a degree of latitude. They are only equal at the equator. Forgetting the cosine factor stretches the east–west component, inflating the distance — and the further you are from the equator, the worse it gets.
Concretely: take our same two points and naively assume 111 km per degree on both axes. You would get √((8 × 111)² + (2 × 111)²) ≈ 915 km — about 16 km too long, an error of nearly 2% on a fairly short trip, entirely because the longitude degrees were not shrunk by cos(latitude). Push the points further apart, or up to high latitudes, and a naive flat calculation can be off by tens of percent. Worse, it can produce nonsense near the ±180° longitude line (the antimeridian), where two points one degree apart on the ground look 359° apart to flat arithmetic. Haversine handles all of these correctly; flat geometry does not.
Picking the right method for the job
Match the tool to the precision you actually need:
- Mental estimate: the 111-km rule, with the cosine correction for the east–west part. Good to a few percent for short, mid-latitude hops.
- Everyday accurate: Haversine. Treats the Earth as a sphere, accurate to roughly 0.5%, and is the right default for hiking, driving, geofencing, and "how far apart are these?" answers.
- Survey-grade: Vincenty's formulae or Karney's geodesic algorithm, which model the Earth as an ellipsoid and reach sub-millimetre accuracy. Overkill unless you are doing professional surveying or geodesy — and Haversine is far easier to reason about and debug.
One last reminder that catches people: great-circle distance is "as the crow flies," not "as the road runs." It is the shortest path across open ground or sea. Driving or walking distance follows actual routes and is always longer — sometimes much longer in mountains or around water.
Let a tool do the arithmetic
Working the formula by hand once is worth it: it shows you why curvature and the cosine factor matter, and lets you sanity-check a result that looks off. For real use, paste your two pairs into our distance between coordinates tool, which runs Haversine and returns both kilometres and miles instantly, with no radians, sign errors, or antimeridian surprises.
No coordinates yet? Grab your current position from what are my coordinates, and if your pairs arrived in DMS or another format, normalise them first with the coordinate converter so both ends are clean decimal degrees. For the point exactly halfway between them, the midpoint calculator finds the great-circle midpoint. If the numbers themselves still feel fuzzy, see how to read latitude and longitude, and how accurate is GPS for how much to trust the coordinates you started with.