About great circle distance
Great circle distance is the shortest path between two points on the surface of a sphere, measured along the surface rather than straight through the interior. On a globe, that shortest path always lies on a great circle, a circle whose centre is the centre of the Earth, such as the equator or any line of longitude. Because the Earth is very nearly spherical, this is the distance that matters for navigation: it is why long-haul flight paths arc poleward on a flat map instead of following a straight ruled line, and why ships and aircraft plot routes along great circles to save fuel and time.
This calculator takes two pairs of latitude and longitude and returns the great circle distance between them in kilometres, miles, and nautical miles, plus the initial bearing (compass heading) from the first point to the second. It uses the haversine formula, a numerically stable way to compute the angle between two points from their coordinates. The classic worked case is New York (40.7128, -74.0060) to London (51.5074, -0.1278), which comes out to roughly 5,570 km, about 3,461 miles.
The straight-line "as the crow flies" distance people quote is exactly this great circle distance. It is always shorter than any road or sailing route, which must bend around terrain, coastlines, and airspace, so treat the result as the theoretical minimum. It is the right number for estimating flight times, comparing city separations, sanity-checking GPS data, and any geospatial work where you need the true surface distance between two coordinates.
How it works (the haversine formula)
The haversine formula computes the central angle between two points from their latitudes and longitudes, then multiplies that angle (in radians) by the Earth's radius to get the surface distance. It is preferred over the simpler spherical law of cosines because it stays accurate even for very small distances, where rounding can otherwise destroy precision.
First the coordinates are converted from degrees to radians. The term a captures how far apart the two points are as a fraction of a full sphere; atan2 turns it into the central angle c; and multiplying by the radius R gives the distance. Using 6,371 km treats the Earth as a perfect sphere, which is accurate to within about 0.5 percent. Survey-grade work uses an ellipsoidal model (Vincenty's formula) that accounts for the planet's slight flattening.
Worked example: New York to London
Take New York at latitude 40.7128, longitude -74.0060 and London at 51.5074, -0.1278.
- Differences: dphi = 51.5074 - 40.7128 = 10.7946 degrees; dlambda = -0.1278 - (-74.0060) = 73.8782 degrees, both converted to radians.
- Compute a: sin2(dphi/2) plus the cosine-weighted sin2(dlambda/2) term gives a value near 0.1908.
- Central angle: c = 2 x atan2(sqrt(a), sqrt(1-a)) is about 0.8745 radians.
- Distance: d = 6,371 x 0.8745 = approximately 5,570 km.
Reference: distances between major cities
Approximate great circle distances computed with the haversine formula and a 6,371 km Earth radius.
| Route | Kilometres | Miles | Nautical miles |
|---|---|---|---|
| New York to London | 5,570 | 3,461 | 3,008 |
| London to Tokyo | 9,560 | 5,940 | 5,162 |
| Los Angeles to Sydney | 12,051 | 7,488 | 6,507 |
| Paris to New York | 5,837 | 3,627 | 3,152 |
| Dubai to Singapore | 5,841 | 3,629 | 3,154 |
| Mumbai to London | 7,200 | 4,474 | 3,888 |
Common pitfalls
- Swapping latitude and longitude. Latitude runs -90 to 90, longitude -180 to 180. Reversing them sends the calculation to the wrong point entirely. Latitude always comes first.
- Wrong sign on the hemisphere. West longitude and south latitude are negative. Dropping the minus sign on a western city like New York puts it in Asia.
- Expecting road distance. Great circle is the straight-line surface minimum. Driving or sailing distance is always longer because routes bend around obstacles.
- Confusing the bearing with the whole route. The bearing shown is the initial heading. On a great circle the compass heading changes continuously, so it is not constant for the whole trip.
- Treating it as exact to the metre. The spherical model is accurate to roughly 0.5 percent. For survey precision use an ellipsoidal formula such as Vincenty's.
Frequently asked questions
What is the great circle distance?
It is the shortest distance between two points on the surface of a sphere, measured along the surface rather than through the interior. On Earth this is the true "as the crow flies" distance, and it always lies on a great circle whose centre is the centre of the planet. It is the path long-haul flights and ships follow to minimise travel.
What is the haversine formula?
The haversine formula computes the great circle distance from two latitude and longitude pairs. It finds the central angle between the points using a = sin2(dphi/2) + cos(phi1)cos(phi2)sin2(dlambda/2), then distance = R x 2 x atan2(sqrt(a), sqrt(1-a)). It is preferred over the law of cosines because it stays numerically accurate even for very short distances.
Why is the great circle distance shorter than the driving distance?
The great circle distance is the theoretical minimum across the Earth's surface, a smooth arc with no obstacles. Real roads and shipping lanes must bend around terrain, coastlines, borders, and traffic, so they are always longer. Treat the great circle figure as the floor and expect any actual route to exceed it.
How accurate is the haversine result for Earth?
Using a mean radius of 6,371 km treats the Earth as a perfect sphere, which is accurate to within about 0.5 percent for most routes. The planet is slightly flattened at the poles, so survey-grade work uses an ellipsoidal model such as Vincenty's formula. For travel planning and city-to-city estimates, haversine is more than precise enough.
What is a bearing and why does it change along the route?
The bearing is the compass heading from one point to another. The value shown is the initial bearing at the start of the journey. On a great circle path the heading shifts continuously as you travel, because the route curves relative to the lines of longitude, so a single constant compass heading would not follow the shortest path.
