Great Circle Distance (Haversine)

Also known as haversine formula · great circle distance · distance between two coordinates · distance between two lat long points · orthodromic distance · spherical distance

d=2Rarcsin⁡sin⁡2φ2−φ12+cos⁡φ1cos⁡φ2sin⁡2λ2−λ12d = 2R\arcsin\sqrt{\sin^{2}\frac{\varphi_2-\varphi_1}{2} + \cos\varphi_1\cos\varphi_2\sin^{2}\frac{\lambda_2-\lambda_1}{2}}
sig figs

Worked example: One minute of latitude → 1.000676 nautical miles on the mean sphere. Press Try an example to run it live, then adjust anything.

Enter your known values, leave one input blank, and solves for the missing one. Tap a variable’s symbol to see what it means, with a typical value. Change any unit and the answer follows.

Where Great Circle Distance (Haversine) fits

Missing an input?
Your answer feeds
In this toolkit

See also

Initial Great Circle Bearing: The course to steer at the start of this same track.Rhumb Line Distance: The other way to sail the same two points: longer, but at one steady course.Estimated Time En Route: Turns this distance into an arrival time once a ground speed is known.Latitude of a Traverse Leg: The surveyor's flat-earth cousin: the same north-south component, on a plane instead of a sphere.Destination Longitude from Course and Distance: Both use great circle distance and latitude of the first point.Destination Latitude from Course and Distance: Both use great circle distance and latitude of the first point.
3 more relatedAlong-Track Distance (the Companion of Cross-Track Error): Both use great circle distance.Cross Track Error: Both use great circle distance.Solar Azimuth Angle (Compass Bearing of the Sun): Both use latitude of the first point.
Here the solver did the work. Could you?

The great circle →

UniversityApplied Field Engineering

Test your skills in the Exam Room: new numbers every attempt. Free lessons for students, no sign-up, just pure learning.

See your Report Card
Learning zone

Great Circle Distance (Haversine) explained

dφ1λ1φ2λ2

Two points on a sphere are joined by exactly one shortest path, and it is the arc of the great circle through them: the circle whose centre is the centre of the earth. Every meridian is a great circle. The equator is a great circle. No other parallel of latitude is, which is the first surprise the subject hands you: the 60th parallel looks like a perfectly good road on a school globe, and following it is not the shortest way anywhere.

The formula on this page is R. W. Sinnott's 1984 restatement of a very old identity, published in Sky & Telescope under the title "Virtues of the Haversine". The haversine itself is just hav⁡θ=sin⁡2(θ/2)\operatorname{hav}\theta = \sin^{2}(\theta/2), and the virtue Sinnott was defending is numerical. The older spherical law of cosines, cos⁡d=sin⁡φ1sin⁡φ2+cos⁡φ1cos⁡φ2cos⁡Δλ\cos d = \sin\varphi_1\sin\varphi_2 + \cos\varphi_1\cos\varphi_2\cos\Delta\lambda, is algebraically correct and quietly useless on short legs: when the two points are close the cosine is within a hair of 1, and a machine carrying seven digits has nothing left to work with. Sinnott's example was a calculator returning zero distance for two points a kilometre apart. The haversine form never forms that difference and holds its precision all the way down.

The radius used here is 6 371 008.8 m, the IUGG mean radius of the WGS-84 ellipsoid. Be honest with yourself about what that costs. The earth is flattened by about one part in 298, and a spherical distance can differ from a true geodesic on the ellipsoid by up to roughly half a percent depending on how the track lies. On a thirty-mile coastal passage that is a couple of hundred metres and it does not matter. On a five-thousand-mile ocean crossing it is twenty-five miles, which is a real fuel figure and a real arrival time. When it matters, the tool is Vincenty's iterative method or a modern geodesic library, not a bigger radius.

The classic mistake here is not in the formula at all; it is in the longitudes going into it. This shard takes east as positive and west as negative, without exception, and a west longitude entered as a positive number is the single most common error in every coordinate calculation ever written. A Halifax longitude is −63.6°, not 63.6°. The second most common is mixing degrees-minutes-seconds with decimal degrees: 40°38'23" is 40.6398°, not 40.3823°, and the two are close enough to look plausible and far enough apart to lose a ship.

Great Circle Distance (Haversine) formula

d=2Rarcsin⁡sin⁡2φ2−φ12+cos⁡φ1cos⁡φ2sin⁡2λ2−λ12d = 2R\arcsin\sqrt{\sin^{2}\frac{\varphi_2-\varphi_1}{2} + \cos\varphi_1\cos\varphi_2\sin^{2}\frac{\lambda_2-\lambda_1}{2}}
Where
  • dd= Great circle distance (nmi)
  • φ1\varphi_1= Latitude of the first point (°)
  • λ1\lambda_1= Longitude of the first point (°)
  • φ2\varphi_2= Latitude of the second point (°)
  • λ2\lambda_2= Longitude of the second point (°)
Revised 1 November 2026
Cite this page

formula.expert. (2026, November 1). Great Circle Distance (Haversine) Formula & Calculator. https://formula.expert/solvers/haversine-great-circle-distance