Great-Circle Distance Calculator

Compute the shortest path between any two points on Earth — with bearings, midpoint, and Vincenty precision.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

The great-circle distance is the shortest possible path between any two points on the surface of a sphere, following the curvature of the Earth rather than cutting through it. This calculator implements both the Haversine formula (fast, spherical model, within 0.5%) and the Vincenty inverse formula (WGS-84 ellipsoid, sub-millimetre accuracy), so you can pick the level of precision the task requires.

In addition to the raw distance in kilometres, miles, and nautical miles, the tool computes the forward and reverse initial bearings (shown on interactive compass roses), the geographic midpoint of the route, and a side-by-side comparison of the two formulas so you can see exactly how much the Earth’s oblateness matters for any given pair of coordinates.

How the formulas work

Haversine (spherical Earth)

The Haversine formula derives the central angle c subtended by the two surface points at the Earth’s centre:

a = sin²(Δφ/2) + cos(φ₁) · cos(φ₂) · sin²(Δλ/2)
c = 2 · asin(√a)
d = R · c

where φ is latitude, λ is longitude (both in radians), and R = 6,371.009 km (IUGG mean radius). The name “Haversine” refers to the half-versine trig identity that makes the formula numerically stable even for very short distances, unlike the simpler spherical law of cosines which suffers from floating-point cancellation at small angles.

Vincenty (WGS-84 ellipsoid)

The WGS-84 reference ellipsoid has a semi-major axis of 6,378,137 m, a semi-minor axis of 6,356,752.314 m, and a flattening of 1/298.257. Vincenty’s inverse method iterates on the longitude difference λ until it converges (typically within 4–5 iterations for most routes, at most ~200 for near-antipodal points). The resulting distance can differ from Haversine by up to ~22 km on very long routes and far more near the poles — the comparison table in the tool shows the exact difference for your inputs.

Initial bearing

The initial bearing (also called the forward azimuth) is computed from:

y = sin(Δλ) · cos(φ₂)
x = cos(φ₁) · sin(φ₂) − sin(φ₁) · cos(φ₂) · cos(Δλ)
θ = atan2(y, x)  converted to 0°–360°

Because great-circle routes curve relative to lines of constant latitude (rhumb lines), the bearing changes continuously along the route. A flight from London to New York starts heading west-southwest but arrives heading almost due west — the initial bearing shown is the heading to set at the very start of the journey.

Worked example

London (51.5074° N, 0.1278° W) to New York (40.7128° N, 74.0060° W):

  • Haversine: 5,570.2 km (3,460.9 mi, 3,007.6 NM)
  • Vincenty: 5,570.5 km (difference of ~300 m)
  • Forward bearing: 288.3° (WNW)
  • Return bearing: 51.2° (NE)
  • Midpoint: approximately 53.5° N, 40.2° W — over the North Atlantic

The great-circle path passes far north of the straight line you might draw on a Mercator map, swinging up over Scotland and Iceland before curving south toward New York. This northward arc is shorter because the Earth’s circumference is smaller near the poles.

RouteDistance (km)Forward bearing
London → New York5,570288° WNW
Sydney → Tokyo7,82360° ENE
Paris → Dubai5,240113° ESE
Yerevan → Tbilisi24717° NNE

Why this matters

Understanding great-circle distances is essential in aviation (route planning, fuel calculations), maritime navigation (voyage planning, logbook entries), telecommunications (satellite footprint coverage), and any geospatial analysis that involves comparing or sorting locations by distance. Mapping libraries like PostGIS, Turf.js, and GeoPandas all use variants of these same formulas under the hood.

Ad placeholder (rectangle)