Haversine Great-Circle Distance Calculator
Computes the great-circle distance, bearings and midpoint between two coordinates on a sphere (IUGG mean radius by default), in kilometres, metres or nautical miles.
Inputs
Spherical great-circle distance, central angle, bearings and midpoint between two latitude/longitude points.
Enter the values and press Calculate.
Or load an example to see a worked result.
Batch from CSV
One row per calculation, with a header row. Values use the units currently selected in the form above. Up to 10,000 rows; nothing is uploaded.
How the method works
A fixed worked example to explain the method — it is not your result.
Before you rely on this: First-pass guide only. Verify safety-critical or regulated work against the relevant standards, your project requirements and a qualified professional.
How to use this calculator
- Enter both points' latitude and longitude.
- Leave the radius blank for the IUGG mean Earth radius (6,371,008.8 m), or enter your own.
- Press Calculate. Read the distance, the central angle, the initial and final bearings and the midpoint.
How it works
a = sin²(Δφ/2) + cos φ₁ cos φ₂ sin²(Δλ/2) and d = R·c, where c is the central angle.
c is evaluated as atan2(|v₁ × v₂|, v₁ · v₂). It is mathematically identical to 2·atan2(√a, √(1 − a)), but stays exact near antipodes, where the textbook form loses about 0.1 m.
Longitude differences are wrapped, so routes across the date line take the shorter crossing and reversing the points never changes the distance.
The initial bearing is undefined for coincident points; for antipodal points neither the bearing nor the midpoint is unique.
Worked example
Perth (−31.95°, 115.86°) → Melbourne (−37.81°, 144.96°). Central angle 24.473109°, distance 2,721.289 km (1,469.379 nmi), initial bearing 111.95°, final bearing 95.05°, midpoint −35.759822°, 129.879430°. The WGS84 ellipsoid gives 2,726.614 km for the same pair.
Common mistakes
- Treating the result as a road, terrain or grid distance. It is the surface distance on a sphere.
- Using it where survey accuracy matters. The gap to the ellipsoid depends on the route — about 5 km on the Perth–Melbourne line — so use the Vincenty tool there.
- Mixing a 6,371 km radius with a 6,371,008.8 m one when comparing results; the radius changes every distance in proportion.
Frequently asked questions
How accurate is haversine?
It is exact for a sphere. Its difference from the real (ellipsoidal) Earth depends on where and in which direction the route runs, so there is no single accuracy figure; for survey-grade distances use the Vincenty ellipsoidal tool.
Related tools
- Vincenty Ellipsoidal Distance Calculator
- Great-Circle vs Rhumb Line Distance Comparison
- Azimuth to Bearing Converter
- Bearing & Distance to Coordinates Calculator
- Coordinate Difference Calculator
- Coordinates to Bearing & Distance Calculator
Explore more in Surveying, Coordinates, GIS & CAD.
Cite this tool
Zerdly. (2026). Haversine Great-Circle Distance Calculator. Retrieved from https://www.zerdly.com/tools/haversine-great-circle-distance-calculator/
Tip: Enter any known values to calculate the remaining results.
Designed to run locally in your browser. Tool inputs are not intentionally stored by Zerdly unless stated otherwise.



