The great-circle distance, treating Earth as a sphere
Haversine finds the shortest path between two points over the curved surface. It plugs both latitudes and the longitude gap into one formula, then multiplies by the Earth's radius. The result is the flat "as the crow flies" line, not the road distance.
Here φ is latitude, λ is longitude, and R = 6,371 km is the Earth's mean radius. Change R to 3,959 miles or 3,440 nautical miles to get the answer in those units directly.
Convert the result between km, miles and nautical miles
| Kilometres | Miles | Nautical miles |
|---|---|---|
| 1 km | 0.621 mi | 0.540 nm |
| 10 km | 6.21 mi | 5.40 nm |
| 100 km | 62.1 mi | 54.0 nm |
| 1,000 km | 621 mi | 540 nm |
One nautical mile is 1.852 km, defined as one minute of latitude — which is why ships and aircraft use it. Multiply km by 0.621371 for statute miles, or by 0.539957 for nautical miles.
Two things that trip people up
- A degree of longitude is not a fixed distance. A degree of latitude is always about 111 km, but a degree of longitude shrinks toward the poles: 111 km at the equator, 79 km at 45°, and zero at the poles where the meridians meet.
- Flat-map straight lines lie. On a globe the shortest route curves. New York to Tokyo is 10,853 km over the pole, not the 8,600 km a flat map suggests due east — which is why long flights arc north.
Common questions
Is this the driving distance between the two points?
No. It is the straight great-circle distance over the curved surface of the Earth, the "as the crow flies" line. Road distance is always longer because it follows highways and terrain.
How accurate is the Haversine formula?
It treats the Earth as a perfect sphere, so it is off by about 0.3% at most. That is roughly 3 metres over 1 km and about 30 km on a 10,000 km intercontinental route. For surveying you need an ellipsoidal method like Vincenty.
Do I put a minus sign on south and west coordinates?
Yes. South latitude and west longitude are negative. New York is 40.7128, minus 74.0060. Dropping the sign is the most common mistake and puts your point in the wrong hemisphere.


