---
title: "Distance Between Coordinates Calculator | North Pinnacle"
description: "Distance between two latitude/longitude points on the WGS84 ellipsoid by Karney's method, compared with Vincenty and haversine, in km, miles and nmi."
url: https://northpinnacle.top/distance-between-coordinates/
---

Sheet 2 · Distance

# Distance between two coordinates

The shortest distance over the earth's surface between two positions, measured on the ellipsoid and on a sphere so you can see how much the shape of the earth matters.

## Readout

Geodesic distance on WGS84

5,585.23 km

3,470.50 mi · 3,015.78 nmi

| Method | Distance | Versus Karney |
| --- | --- | --- |
| Karney (2013), ellipsoid | 5,585.23 km | reference |
| Vincenty (1975), ellipsoid | 5,585.23 km | +0.000 m (+0.000%) |
| Haversine, sphere R = 6,371.0088 km | 5,570.23 km | −15,004 m (−0.269%) |

## Sphere or ellipsoid?

The quick answer treats the earth as a sphere and uses the **haversine formula**, with φ for latitude, λ for longitude and R for the radius:

a = sin²(Δφ/2) + cos φ₁ · cos φ₂ · sin²(Δλ/2); d = 2R · atan2(√a, √(1−a))

But the earth is flattened at the poles by about 1 part in 298, so a sphere is off by up to about 0.5%. From London to New York the haversine answer, with the mean radius of 6,371.0088 km, comes out about 15 km short of the ellipsoidal 5,585 km.

Ellipsoidal methods solve the problem on the WGS84 ellipsoid itself. **Vincenty's formula** (1975) iterates to millimetre accuracy but can fail to converge when the points are almost opposite each other on the globe; try the "nearly antipodal" example. **Karney's algorithm** (2013) always converges and is accurate to about 15 nanometres, so it is the reference here.

## Units

- 1 nautical mile = 1,852 m exactly
- 1 mile = 1,609.344 m exactly
- 1′ of latitude ≈ 1 nautical mile

## Sources

- Karney CFF. Algorithms for geodesics. *Journal of Geodesy* 87 (2013), 43–55. [doi:10.1007/s00190-012-0578-z](https://doi.org/10.1007/s00190-012-0578-z); computed with the [GeographicLib](https://geographiclib.sourceforge.io/) JavaScript port.
- Vincenty T. Direct and inverse solutions of geodesics on the ellipsoid with application of nested equations. *Survey Review* 23 (1975), 88–93; his Flinders Peak to Buninyong line (54,972.271 m) is one of this page's tests.
- Veness C. [Calculate distance, bearing and more between latitude/longitude points](https://www.movable-type.co.uk/scripts/latlong.html) and [Vincenty solutions of geodesics on the ellipsoid](https://www.movable-type.co.uk/scripts/latlong-vincenty.html), Movable Type Scripts.

## Questions

**Is this the driving or flying distance?**

Neither. It is the shortest path over the ellipsoid's surface, ignoring roads, terrain and air routes. Long-haul flights roughly follow it, bent by winds and airspace.

**Why do distance calculators disagree slightly?**

Most use the haversine formula, some with a radius of 6,371 km and some 6,378 km; that choice alone moves results by about 0.1%. Ellipsoidal methods agree with each other to within a millimetre.

**What does "did not converge" mean?**

For nearly antipodal points Vincenty's iteration keeps overshooting and never settles. The Karney result is still exact, so the distance shown is reliable.
