Great-Circle Distance Calculator (Haversine and Vincenty)

The shortest route between two places on the Earth follows a great circle. Enter two latitude and longitude pairs to get the distance by the haversine formula on a spherical Earth and by Vincenty’s method on the WGS 84 ellipsoid used by GPS, together with the initial and final bearings.

Inputs

Advanced options (1)

Results

Distance on the WGS 84 ellipsoid (Vincenty)
5,555
Distance on a sphere (haversine)
5,540
Sphere minus ellipsoid
-0.268
%
Initial bearing (ellipsoid)
288
Final bearing (ellipsoid)
231.4
Initial bearing (sphere)
287.9
Central angle
49.82

    RefESS-NAV-001
    MethodHaversine (sphere, R = 6371.0088 km) and Vincenty inverse (WGS 84)
    UnitsSI
    Date2026-11-24

    Working

    Calculated in SI base units; inputs are converted from the units you choose.

    1. Haversinea = sin²(Δφ/2) + cosφ₁cosφ₂sin²(Δλ/2), c = 2·atan2(√a, √(1 − a)), d = Rca = 0.17742128, c = 0.86956699 rad, d = 5,540 km
    2. Vincenty inverse on WGS 84a = 6 378 137 m, f = 1/298.257 223 563; iterate λ until it changes by < 10⁻¹² radconverged in 3 iterations: s = 5,554.9088 km
    3. Bearingsθ = atan2(sinΔλ·cosφ₂, cosφ₁sinφ₂ − sinφ₁cosφ₂cosΔλ)initial 288° (sphere 287.9°), final 231.4° (sphere 231.4°)

    Sphere or ellipsoid?

    The haversine formula treats the Earth as a sphere and is numerically stable even for very short distances. The Earth is actually flattened at the poles by about 1 part in 298, so spherical distances can be off by up to about 0.5 %. Vincenty’s iterative method on the WGS 84 ellipsoid is accurate to about half a millimetre, though it can fail to converge for points almost exactly opposite each other on the globe.

    Assumptions and limits

    • Distances along the surface of the reference ellipsoid (sea level); altitude and terrain ignored.
    • Coordinates in decimal degrees on WGS 84 (as used by GPS).
    • The spherical result uses the IUGG mean radius 6371.0088 km unless changed.

    References

    • Vincenty, T. (1975), Direct and inverse solutions of geodesics on the ellipsoid with application of nested equations, Survey Review 23(176), 88–93.
    • Sinnott, R. W. (1984), Virtues of the haversine, Sky and Telescope 68(2), 159.
    • National Geospatial-Intelligence Agency, World Geodetic System 1984, NGA.STND.0036.

    Questions

    How far is it from London Heathrow to New York JFK?
    5555 km (3452 mi) on the WGS 84 ellipsoid and 5540 km by the haversine formula on a sphere, with an initial bearing of 288.0°.
    Why do the two methods differ?
    The sphere ignores the Earth’s flattening. For this route the spherical result is 0.27 % shorter.

    This calculator is a design aid. Check results against the governing code or standard and have critical work verified by a qualified engineer. Read the disclaimer.