🔬
🔬 Science & engineering

Great-Circle Distance Calculator (Haversine)

Results update as you type.

Your numbers

Understanding the great-circle distance calculator — concept and principle

This calculator finds the shortest distance over Earth's surface between two points given by latitude and longitude, together with the initial compass bearing from the first point. The shortest path on a sphere follows a great circle, which long-haul flights approximate.

Great-circle distance from Seoul to TokyoThe haversine formula gives 1,149 km (714 miles, 621 nautical miles) from Seoul to Tokyo, starting on a bearing of 96.7°.Shortest path over a round EarthSeoulTokyo1,149 km714 mi621 nautical miEarth R 6,371 kmNEstart96.7°hav(d/R) = hav(Δφ) + cos φ₁ cos φ₂ hav(Δλ)Δlat −1.89°, Δlon +12.67°
The great-circle arc is the shortest route on a sphere; Seoul to Tokyo is 1,149 km heading just south of east.

How it is calculated

With latitudes φ₁, φ₂ and longitude difference Δλ in radians:

  1. a = sin²(Δφ / 2) + cos φ₁ × cos φ₂ × sin²(Δλ / 2)
  2. Central angle c = 2 × arcsin(√a)
  3. Distance d = R × c, with mean Earth radius R = 6,371.0088 km
  4. Initial bearing θ = atan2(sin Δλ × cos φ₂, cos φ₁ × sin φ₂ − sin φ₁ × cos φ₂ × cos Δλ), converted to 0–360°

Miles = km ÷ 1.609344 and nautical miles = km ÷ 1.852.

The principle

On a sphere, distance along the surface equals the radius times the angle between the two points measured at the centre. The haversine function, hav θ = sin²(θ/2), lets you compute that angle from the spherical law of cosines in a form that stays numerically accurate even for points very close together, where the ordinary cosine formula loses precision. The bearing formula comes from the same spherical triangle formed by the two points and the North Pole. Because a great circle is not a line of constant compass heading, the bearing changes along the way; the value shown is the heading at departure.

Worked example

  1. Inputs: Seoul (37.5665° N, 126.9780° E) to Tokyo (35.6762° N, 139.6503° E).
  2. Δφ = −1.8903°, Δλ = 12.6723°.
  3. a = sin²(−0.945°) + cos 37.5665° × cos 35.6762° × sin²(6.336°) = 0.0081144.
  4. c = 2 × arcsin(0.090080) = 0.180405 rad (10.34°).
  5. d = 6,371.0088 × 0.180405 = 1,149.358923 km = 714.1785245 mi = 620.6041703 nmi.
  6. Initial bearing = 96.69609077°, just south of due east.
How Distance (km) changes with Longitude 2How Distance changes with Longitude 202,5005,0007,50010,00012,50034.969.8105140175209279Example: 1,149.332662Longitude 2
Each point is the calculator re-run with only “Longitude 2” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
Longitude 2Distance (km)
34.97,849.009499
69.85,024.416886
1051,991.211592
1401,149.332662
1754,206.158541
2097,107.443055
27911,385.78578

How to read the result

The distance is "as the crow flies"; road, rail or flight routes are always longer because of terrain, airways and airports. Bearings are measured clockwise from true north (0° north, 90° east, 180° south, 270° west), not magnetic north.

Common mistakes

Keep in mind: The spherical model ignores Earth's flattening, terrain and altitude. For surveying, navigation or legal boundaries, use ellipsoidal methods on WGS 84 such as Vincenty's or Karney's algorithms.

Frequently asked questions

Why does a flight from Seoul to New York pass near the Arctic?

On a flat map the great circle looks curved, but on the globe it is the shortest path, and for northern-hemisphere routes it bends toward the pole.

Why use 6,371.0088 km for the radius?

It is the mean radius (2a + b)/3 of the GRS 80 / WGS 84 ellipsoid, as recommended by the IUGG.

What is the bearing for the return trip?

It is not simply the opposite heading; compute it again with the points swapped.

Sources: R. W. Sinnott, Virtues of the Haversine, Sky and Telescope 68(2), 159 (1984) · H. Moritz, Geodetic Reference System 1980, Journal of Geodesy 74, 128–133 (2000) · C. F. F. Karney, Algorithms for geodesics, Journal of Geodesy 87, 43–55 (2013)

Checked 8 Nov 2026. Standard textbook formulas in SI units, computed in your browser. For learning and estimates — real designs must follow your local codes and be checked by a qualified engineer.

</> Add this calculator to your website (free)

Copy this code into your blog or site. It is free to use; please keep the credit link.

Preview
🔬 All science & engineering tools →🌍 Calculators by country →