Great Circle Distance Calculator

Calculate the shortest distance between any two points on Earth using latitude and longitude.
Uses the Haversine formula for accurate results.

Distance

The great circle distance is the shortest path between two points on the surface of a sphere. Slice the globe through both points and through its centre, and the cut edge is the great circle; the shorter arc between your two points is the route. On a flat map that arc bends, which is why a London to Tokyo flight tracks up over Siberia instead of running along the latitude line you might expect.

The calculation uses the Haversine formula, named after the haversine trigonometric function:

a = sin²(Δlat/2) + cos(lat₁) × cos(lat₂) × sin²(Δlon/2) c = 2 × atan2(√a, √(1−a)) d = R × c

Where R is Earth’s mean radius (6,371 km / 3,959 miles), lat₁ and lat₂ are the latitudes of the two points in radians, and Δlat and Δlon are the differences in latitude and longitude.

This formula is accurate to within 0.3% for any distance on Earth. For extreme precision (geodetic surveying), the Vincenty formula accounts for Earth’s ellipsoidal shape, but the Haversine is more than sufficient for navigation, travel planning, and distance estimation.

Practical uses:

  • Flight distance planning (great circle = shortest flight path)
  • Ship routing (great circle routes cross fewer nautical miles)
  • Hiking and wilderness navigation
  • Satellite ground track calculations
  • Estimating driving vs flying time comparisons

Example: London (51.5074°N, 0.1278°W) to New York (40.7128°N, 74.006°W) works out at 5,570 km / 3,461 miles / 3,008 nautical miles, on an initial heading of 288°, which is west-northwest. Set off on 288 and you finish the crossing pointing at roughly 236. That heading change is the thing that surprises people: on a great circle your compass reading drifts the whole way, because you are following the shortest path over a curved surface rather than a constant bearing.

The constant-bearing alternative is the rhumb line, at 5,794 km. That is 224 km further, about 4% of the trip, and you can steer the whole thing on one number, which is why it ruled navigation for four centuries. The penalty depends entirely on the route: it is 4% across the North Atlantic, 2% from Lisbon to Havana, and effectively nothing between Sydney and Tokyo, because a route running almost due north-south is very nearly a great circle already. The calculator reports both, so you can see what the easy course costs on yours.

Actual travel distance by road or airway is always longer again, since neither follows a mathematical arc.

Earth isn’t actually a sphere. It is an oblate spheroid, flattened at the poles by about 21 km against a 6,378 km equatorial radius, so any formula treating Earth as a sphere carries up to roughly 0.5% error. For navigation, hiking, and travel planning this is invisible; you would be out by 50 metres on a 10 km walk. For geodetic surveying, GPS precision work, or aircraft instrument approaches, the Vincenty formula on the WGS-84 ellipsoid (the geometric model GPS satellites are built on) gets to about 0.5 mm. The Haversine result here is the right tool for everything short of professional surveying.

Always work in radians. Latitudes and longitudes both have to be converted from degrees first, by multiplying by π/180. Forgetting that is the most common bug in great-circle code, and it is a nasty one, because the answer comes back a plausible-looking number with no error to catch. This calculator handles the conversion for you.


How we build and check this calculator

This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.

SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.


Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.