Haversine Distance Calculator
Compute exact great-circle distance between two latitude and longitude coordinates using the Haversine trigonometric formula.
📍 Select World Location Presets or Custom Coordinates
WGS-84 EllipsoidClick anywhere on the map or drag pins to update coordinates live.
Step-by-Step Mathematical Derivation
- Origin P1: (40.7128°, -74.006°)
- Destination P2: (51.5074°, -0.1278°)
d = 2R × arcsin(sqrt(sin²(Δφ/2) + cos(φ1)cos(φ2)sin²(Δλ/2)))R = 6,371 km, Δφ = 10.7946°, Δλ = 73.8782°The great-circle flight distance between (40.7128, -74.006) and (51.5074, -0.1278) is 5570.23 km.
Mathematical Formula
Overview & Explanation
Standard spherical distance formula accounting for Earth curvature.
How It Works
- Uses sine half-angles to maintain precision over both short and long distances.
Practical Applications
- Geolocation search radius.
- Spatial database queries.
How the haversine formula works
The haversine formula gives the great-circle distance between two points on a sphere from their latitudes and longitudes. With latitudes φ₁, φ₂ and longitudes λ₁, λ₂ in radians: a = sin²(Δφ/2) + cos φ₁ × cos φ₂ × sin²(Δλ/2), c = 2 × atan2(√a, √(1 − a)), and distance = R × c, where R is Earth's mean radius of about 6,371 km.
The great-circle route is the shortest path over the surface, which is why long-haul flights look curved on a flat map.
Worked example
Mumbai (19.076° N, 72.878° E) to Delhi (28.704° N, 77.102° E): Δφ = 9.628° and Δλ = 4.224°. Working through the formula gives c ≈ 0.1810 radians, so the distance is about 6,371 × 0.1810 ≈ 1,153 km in a straight line. Road distance is longer, about 1,400 km, because roads do not follow the great circle.
Accuracy
Earth is slightly flattened at the poles, so treating it as a sphere introduces an error of up to about 0.5 percent. For surveying or long distances where that matters, use the Vincenty distance calculator, which models the WGS-84 ellipsoid.
Worked Example: NY to LA
Compute Haversine distance.
Compute
3,936 km
Frequently Asked Questions
What Earth radius is used?
Related Calculators
Vincenty Distance Calculator
Calculate high-precision ellipsoidal geodesic distance on the WGS-84 ellipsoid using Vincenty inverse algorithm.
Distance Calculator
Calculate straight-line geodesic (Haversine) distance between geographic coordinates or world cities.
GPS Coordinate Converter
Convert GPS coordinates between Decimal Degrees (DD), Degrees Minutes Seconds (DMS), and Degrees Decimal Minutes (DDM).
Decimal Degrees to DMS Converter
Convert decimal degree coordinates to Degrees, Minutes, and Seconds (DMS) format.