About the Lat/Long Distance Calculator
This latitude and longitude distance calculator finds the shortest distance over the Earth's surface — the great-circle or "as the crow flies" distance — between two points given in decimal degrees. It returns the distance in kilometres, statute miles and nautical miles, the initial compass bearing you would set off on, the final bearing on arrival and the geographic midpoint.
It is useful for estimating flight distances between airports, checking how far apart two GPS waypoints are, planning sailing or hiking routes, and for developers testing geolocation code. Enter southern latitudes and western longitudes as negative numbers (for example New York is 40.64, −73.78).
The calculation uses the haversine formula on a sphere with the mean Earth radius of 6,371.0088 km. Because the Earth is slightly flattened, results can differ from precise ellipsoidal (Vincenty or WGS-84) distances by up to about 0.5%, which is negligible for travel planning. Road and actual flight-path distances are always longer than the great-circle distance.
With the default inputs, the great-circle distance (selected unit) is 5,540.02. Change any value above to recalculate instantly.
How to use the lat/long distance calculator
- 1Enter the latitude and longitude of point A in decimal degrees.
- 2Enter the coordinates of point B (use negative values for south and west).
- 3Choose the unit you want as the headline result.
- 4Read the distance in km, miles and nautical miles, plus bearing and midpoint.
Formula and method
The haversine formula gives the central angle between two points on a sphere from their latitudes φ and longitudes λ (converted to radians). Multiplying that angle by the Earth's mean radius R = 6,371.0088 km gives the great-circle distance, which is then converted to statute miles (÷ 1.609344) and nautical miles (÷ 1.852). The haversine form stays accurate even for very short distances.
The initial bearing θ is the forward azimuth from point A toward point B, measured clockwise from true north. On a great circle the heading changes continuously, so the final bearing is found as the reverse bearing from B to A plus 180°. The midpoint is the point halfway along the great-circle path.
- φ₁, φ₂
- Latitudes of points A and B (radians)
- Δφ, Δλ
- Differences in latitude and longitude (radians)
- R
- Mean Earth radius, 6,371.0088 km
- d
- Great-circle distance
- θ
- Initial bearing from true north
Worked examples
New York JFK to London Heathrow
JFK (40.6413, −73.7781) to Heathrow (51.4700, −0.4543) is about 5,540 km or 3,442 miles on a great circle. The initial bearing is about 51° (north-east), which is why transatlantic flights head up toward Canada before curving south-east.
Sydney to Singapore in nautical miles
Sydney (−33.8688, 151.2093) to Singapore (1.3521, 103.8198) is about 6,307 km, or 3,405 nautical miles — the unit pilots and sailors use for navigation.
One degree of longitude on the equator
One degree along the equator is 2πR ÷ 360 = 111.195 km, or about 69.09 miles, heading due east (90°).
Frequently asked questions
What is great-circle distance?+
It is the shortest path between two points on the surface of a sphere, measured along the circle whose centre is the centre of the Earth. It is the "as the crow flies" distance and the basis for long-haul flight routes.
How accurate is the haversine formula?+
Haversine treats the Earth as a perfect sphere, so it can differ from the true ellipsoidal distance by up to about 0.5%. For travel planning that is a few kilometres on a long flight; surveyors use Vincenty or geodesic formulas on the WGS-84 ellipsoid instead.
How do I convert degrees, minutes and seconds to decimal degrees?+
Decimal degrees = degrees + minutes ÷ 60 + seconds ÷ 3600. For example 40° 38′ 29″ N is 40 + 38/60 + 29/3600 = 40.6414. Make the value negative for south latitudes and west longitudes.
Why is the flight path longer than this distance?+
Aircraft follow air-traffic routes, avoid restricted airspace and use jet streams, and they also climb, descend and hold. Real flown distances are typically a few percent longer than the great-circle distance.
What is the difference between a mile and a nautical mile?+
A statute mile is 1.609344 km. A nautical mile is exactly 1.852 km and corresponds to about one minute of latitude, which is why it is used in aviation and shipping.