Everyday

Latitude & Longitude Distance (Haversine)

Given two points on the globe, the Haversine formula finds the great-circle distance between them. Enter the decimal coordinates of both points to get the distance and bearing.

Reviewed and updated

How to use
  1. Enter the latitude and longitude of the first point.
  2. Enter the coordinates of the second point.
Route
Great-circle distance
5,570 km

Haversine, R = 6371 km

Miles
3,461 mi
Nautical miles
3,008 nm
Initial bearing
51.2°
Compass
NE
Estimates for general information, verify important figures before relying on them.
Was this helpful?

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.

d = 2R · arcsin( sin²(Δφ/2) + cosφ₁ cosφ₂ sin²(Δλ/2) )

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

KilometresMilesNautical miles
1 km0.621 mi0.540 nm
10 km6.21 mi5.40 nm
100 km62.1 mi54.0 nm
1,000 km621 mi540 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.

From the blog

Guides & how-tos

All articles →