Great Circle Distance Calculator
Introduction to great-circle distance between two coordinates
A great circle is the intersection of a sphere with a plane through its centre; it is the largest circle that can be drawn on that sphere. Any two points on a sphere that are not antipodal lie on exactly one great circle, and the shorter of the two arcs between them is the shortest possible path across the surface. That arc length is the great-circle distance, and it is the quantity this calculator returns.
Great-circle distance is the working currency of long-range navigation. Flight planning systems build long-haul routes around it before layering on airway structure, oceanic tracks and wind optimisation; shipping departments use it to compare voyage options; radio and submarine-cable engineers use it to size path loss and cable length; and spatial analysts use it whenever a straight line drawn on a projected map would be badly misleading.
What makes the number interesting is that it is not the distance you would measure with a ruler on a Mercator chart. Mercator preserves angles, not distances, so the shortest real path between New York and London appears on that projection as a curve bowing north across the Atlantic. The great-circle distance is the length of that curve, and it is consistently shorter than the straight-looking line on the paper.
This tool computes the arc on a sphere with the haversine formula, reports it in kilometres, statute miles and nautical miles, gives the initial and final true bearings along the route, and cross-checks the spherical answer against the Vincenty inverse geodesic on the WGS 84 ellipsoid so you can see exactly how much the spherical approximation costs you on your particular pair of points.
How to use this tool with decimal degrees or DMS coordinates
Enter latitude and longitude for point A and point B. Each of the four boxes accepts either format:
- Decimal degrees —
40.7128,-74.0060. North and east are positive; south and west are negative. - Degrees, minutes, seconds —
40° 42′ 46″ N,40 42 46 N,74d 0m 21s W. Separators may be symbols, letters or plain spaces. - Degrees and decimal minutes —
40 42.767 N, the format used on most marine and aviation charts. - Hemisphere-suffixed decimals —
74.006 Wis read as −74.006.
A hemisphere letter and a minus sign together are contradictory, so -74.006 W is rejected rather than guessed at. Latitude must lie within ±90°; anything outside that range is a data-entry error and the calculator says so instead of silently clamping the value to the pole. Longitude outside ±180° is legitimate shorthand — 200° east is the same meridian as −160° — so it is wrapped rather than rejected, and the wrapped value is shown back to you.
Choose the Earth model beneath the coordinate boxes. The default is the IUGG and NGA arithmetic mean sphere; the equal-area and equal-volume spheres and a custom radius are also available, the last of which lets you run the same geometry on the Moon (1737.4 km) or Mars (3389.5 km). Press Calculate great-circle distance. The result panel reports the distance in three units, the central angle, both bearings, and the WGS 84 geodesic for comparison; the table underneath breaks the same route down by method so you can see the spread.
The haversine formula and the central angle
The haversine is an old navigational function, defined as half the versed sine of an angle. Sinnott popularised its modern floating-point use, but the function itself dates from nineteenth-century sight-reduction tables, where it earned its place because it is never negative and its logarithm is therefore always defined:
All angles below are in radians. Using
- φ1, φ2: latitudes of point A and point B
- λ1, λ2: longitudes of point A and point B
- Δφ = φ2 − φ1
- Δλ = λ2 − λ1, wrapped into the interval (−π, π]
- R: the radius of the sphere you have chosen
the intermediate quantity a is the haversine of the central angle:
Geometrically, a is the squared half-chord between the two points expressed on a unit sphere, so it always lies between 0 and 1. The central angle c, the angle the arc subtends at the centre of the Earth, is recovered with a two-argument arc tangent rather than an arc sine or arc cosine, because atan2 stays well conditioned across the whole range from coincident points to antipodes:
Because the arc is a fraction of a full circle of radius R, the surface distance d is simply the central angle multiplied by the radius:
The two unit conversions applied to d are exact by definition, not approximations: one international mile is 1.609344 km and one nautical mile is 1852 m, both listed as exact in NIST Special Publication 811, Appendix B.8. A great-circle calculator that multiplies kilometres by a rounded 0.621371 loses about one part in two million, which is small but entirely avoidable.
Why the spherical law of cosines fails in double precision
Textbooks often give a shorter-looking route to the same central angle, the spherical law of cosines:
In exact arithmetic the two expressions are identical. In IEEE 754 double precision they are not. For nearby points the bracketed argument tends to 1, and doubles are spaced about 2.2 × 10−16 apart near 1, so the argument retains almost no significant digits. The arc cosine then amplifies the damage, because its derivative diverges at 1. Take two points 0.000001° of latitude apart at 51.5° N: the true separation on the mean sphere is 111.1951 mm, and the law of cosines returns 134.2590 mm — an error of 20.7 percent on a sub-metre baseline. Move the points closer and the argument eventually rounds to exactly 1, at which point the formula reports a distance of zero for two genuinely distinct locations. Feed it a value that rounds a hair above 1 without a clamp and acos returns NaN.
The haversine formula avoids all of this because it never forms a quantity close to 1: it works with the sine of half the difference, which is itself small when the points are close, so relative precision is preserved. This calculator uses haversine for the headline answer and shows the law-of-cosines value in the method table purely so that the failure is visible rather than hypothetical. Where the law of cosines is evaluated, its argument is clamped to [−1, 1] so it can never emit NaN.
Initial and final bearing along a great circle
Except along the equator or a meridian, a great circle is not a constant-heading path. It crosses each successive meridian at a slightly different angle, so the true course changes continuously along the route. Conflating the two ends is a common and consequential error. The initial bearing — the course to steer on departure from A — is
and the final bearing — the course you are actually flying or steaming as you arrive at B — is obtained by running the same expression backwards from B to A and reversing it:
Both are reduced to the compass range 0° to 360°, measured clockwise from true north — not magnetic north, which requires a separate declination correction from a magnetic model such as the NOAA/NCEI World Magnetic Model. For a pair of antipodal points every great circle through them is equally short, so no bearing is defined at all and the calculator says so rather than printing an arbitrary number.
Interpreting the result you get
The headline number is the shortest distance over the surface of the chosen reference figure between the two coordinates. Several things follow from that:
- It is a surface arc, not a chord. The straight tunnel through the Earth between two points is shorter; for New York to London the chord is 5394.50 km against 5570.23 km along the surface.
- It is not a driving, sailing or flying distance. Roads, terrain, airways, traffic separation schemes and weather all lengthen the real path.
- The three unit figures are exact conversions of one another, not three independent computations, so any disagreement between them would indicate a bug rather than added information.
- The central angle is often the more useful number for downstream work: multiply it by any radius to change reference figure, or read it directly as the angular separation seen from the Earth's centre, which is what satellite visibility and radio-horizon calculations actually need.
A practical rule for sanity-checking a result: one degree of central angle is 111.195 km on the mean sphere, and one arcminute is 1.853 km — which is why the nautical mile was defined as one minute of arc in the first place, and why nautical miles and central angle stay so close on this page.
Worked example: New York City to London, step by step
Take the two city-centre coordinates in decimal degrees, on the default IUGG mean sphere with R = 6371.0087714 km:
- Point A, New York: φ1 = 40.7128°, λ1 = −74.0060°
- Point B, London: φ2 = 51.5074°, λ2 = −0.1278°
- Convert to radians: φ1 = 0.71057241, φ2 = 0.89897372, Δφ = 0.18840131, Δλ = 1.28941784.
- First haversine term: sin2(Δφ/2) = 0.0088475467.
- Second term: cos φ1 · cos φ2 · sin2(Δλ/2) = 0.1703888868.
- Sum: a = 0.1792364335, so √a = 0.4233632406 and √(1 − a) = 0.9059600248.
- Central angle: c = 2 · atan2(0.4233632406, 0.9059600248) = 0.8743089279 rad = 50.094212°.
- Distance: d = 6371.0087714 × 0.8743089279 = 5570.2298 km.
Converting exactly: 5570.2298 ÷ 1.609344 = 3461.180 statute miles, and 5570229.8 ÷ 1852 = 3007.684 nautical miles. The initial bearing is 51.2126° (north-east) and the final bearing is 108.3297° (east-south-east) — a swing of 57 degrees across the crossing, which is exactly why the route looks bent on a Mercator chart and why a constant-heading rhumb line is a different path.
Running the same pair through the Vincenty inverse solution on the WGS 84 ellipsoid gives 5585.2336 km, with an initial azimuth of 51.2412° and a final azimuth of 108.3690°. The sphere is therefore 15.00 km short, or 0.269 percent low, and the azimuths differ by about 0.03 degrees. For a route brief that is immaterial; for a cable procurement contract it is 15 km of cable.
Note how badly a five-digit answer would mislead here. The older version of this page quoted “roughly 5,580–5,600 km, or about 3,470 miles” for this route. The correct spherical value is 5570.23 km / 3461.18 mi and the correct ellipsoidal value is 5585.23 km / 3470.50 mi; the quoted range straddled the two models without matching either.
Choosing an Earth radius: R1, R2 and R3
“The radius of the Earth” is not a single number, because the Earth is not a sphere. WGS 84 defines an ellipsoid of revolution with semi-major axis a = 6378137.0 m exactly and reciprocal flattening 1/f = 298.257223563, from which the semi-minor axis b = 6356752.3142 m. Three different spheres are commonly derived from it, and NIMA TR8350.2 Table 3.3 lists all three. The arithmetic mean of the semi-axes is
and the radius of the sphere with the same volume as the ellipsoid is
The third, the radius of the sphere of equal surface area, is R2 = 6371007.1809 m. The spread between the three is under 8 m of radius, which moves a 5570 km answer by about 7 m — utterly negligible next to the roughly 15 km sphere-versus-ellipsoid difference on the same route. The familiar rounded value 6371 km sits 8.8 m below R1 and is fine for anything but bookkeeping-level reproducibility. What matters far more than which mean radius you pick is that the page tells you which one it used, so that another tool's answer can be reconciled with yours.
From sphere to ellipsoid: the Vincenty inverse geodesic
On an ellipsoid the shortest path is no longer a circular arc but a geodesic, and it has no closed-form length. Vincenty (1975) gave a compact iterative inverse solution built on nested equations for the elliptic terms; his equations (13) to (21) are what this page implements. The iteration solves for λ, the longitude difference on an auxiliary sphere, and the distance then follows from
where σ is the angular distance on the auxiliary sphere and A and Δσ are series in u2 = cos2α (a2 − b2)/b2. Vincenty reports a maximum disagreement of 0.01 mm against independent meridional-arc checks, and notes that inverse distances rounded to the millimetre may be in error by up to 0.5 mm.
Two independent checks confirm the implementation on this page. A quarter of the equator, from 0°N 0°E to 0°N 90°E, returns 10018.7542 km, which is πa/2 to the last digit shown. A pole-to-pole line returns 20003.9315 km, exactly twice the accepted WGS 84 meridian quadrant of 10001.9657 km. Neither of those numbers can be reproduced by a spherical formula, which gives 10007.5572 km and 20015.1144 km respectively.
Vincenty's own paper states the method's one failure mode plainly: “The inverse formula may give no solution over a line between two nearly antipodal points. This will occur when λ, as computed by eqn. (11), is greater than π in absolute value.” This page detects that condition, and a stalled iteration, and reports the geodesic as non-convergent instead of printing whatever the last iterate happened to be. Karney (2013) gives a modern replacement that converges for every pair of points, including antipodal ones, and is accurate to round-off; if you need a guaranteed answer near antipodes, that is the algorithm to reach for.
Great circle versus rhumb line
In navigation, a great circle route is not the only possible path between two points. Another important path type is the rhumb line (or loxodrome), which crosses all meridians at a constant bearing. The two differ in several ways:
| Aspect | Great circle route | Rhumb line route |
|---|---|---|
| Definition | Shortest path between two points on the surface of a sphere | Path that keeps a constant compass bearing |
| Distance | Minimal possible surface distance | Longer than the great circle distance (except along meridians or the equator) |
| Navigation complexity | Requires changing bearing over the course of the journey | Simpler steering with a fixed heading |
| Common uses | Long-range flights, ocean crossings, geodesy | Traditional marine navigation, simple chart work |
| Appearance on Mercator maps | Curved line between points | Straight line between points |
This calculator returns great-circle distance, not rhumb-line distance. On the New York to London pair the rhumb line runs 5794.13 km against 5570.23 km for the great circle, so the convenience of a fixed heading costs 4.0 percent in distance. On short legs the two converge and the difference stops mattering.
Where great-circle distance is actually used
- Flight planning: the great circle is the baseline route length before organised track systems, airway structure, ETOPS diversion constraints and cost-index wind optimisation are applied.
- Marine routeing: composite great-circle sailing follows the great circle until a limiting latitude, then a parallel, then a second great circle — a construction that only makes sense once you can compute the arcs.
- Submarine cable and microwave engineering: span length drives repeater count, optical budget and free-space path loss; the geodesic, not the great circle, is the number that goes in the contract.
- Radio and satellite work: the central angle, not the distance, is the natural input for slant range, elevation angle and horizon calculations.
- Spatial analysis: nearest-neighbour, catchment and gravity models over wide areas need a spherical or ellipsoidal metric; planar distance on lat/long degrees is wrong by the cosine of the latitude and is a persistent source of silent GIS errors.
Method comparison for one reference route
All five rows below are the same New York to London pair, differing only in method or reference figure. The deltas are measured against the WGS 84 geodesic, which is the most defensible of the five.
| Method and reference figure | Distance (km) | Delta vs geodesic (km) | Delta (%) |
|---|---|---|---|
| Haversine, IUGG mean sphere R1 = 6371.0087714 km | 5570.2298 | −15.0037 | −0.269 |
| Haversine, equal-area sphere R2 = 6371.0071809 km | 5570.2285 | −15.0051 | −0.269 |
| Haversine, equal-volume sphere R3 = 6371.0007900 km | 5570.2229 | −15.0107 | −0.269 |
| Haversine, rounded sphere R = 6371 km | 5570.2222 | −15.0114 | −0.269 |
| Vincenty inverse geodesic, WGS 84 ellipsoid | 5585.2336 | 0.0000 | 0.000 |
The lesson is that the choice of mean radius changes the answer by metres while the choice between sphere and ellipsoid changes it by kilometres. Arguing about the fourth decimal place of R while ignoring flattening is a common misallocation of effort.
Limitations, assumptions and the error budget
Every number on this page rests on assumptions that are worth stating explicitly.
- A sphere is not the Earth. Flattening is about 1/298, so the local radius of curvature varies from 6335.4 km (meridional, at the equator) to 6399.6 km (polar radius of curvature). A single mean radius therefore cannot be right everywhere. In practice the spherical answer runs about 0.56 percent long on a short north-south line at the equator, about 0.45 percent short on a short line near a pole, and within roughly 0.1 to 0.3 percent on long intercontinental routes.
- Sea level, not ground level. Both models measure on the reference figure, which is close to mean sea level but not to the terrain. Altitude and topography are ignored, so a mountain traverse is longer on the ground than either model reports.
- The geoid is not the ellipsoid. WGS 84 heights are ellipsoidal; the geoid separation reaches roughly ±100 m worldwide. This does not affect horizontal distance materially, but it does mean “height” from a GNSS receiver is not orthometric height.
- Datum matters at the metre level. Coordinates scraped from old maps may be on a local datum. A WGS 84 to local-datum shift can exceed a hundred metres, dwarfing the sphere-versus-ellipsoid difference on short lines.
- Input precision propagates. A coordinate quoted to four decimal places is located to about 11 m; to two decimal places, about 1.1 km. The output cannot be better than the input, no matter how many digits are printed.
- Vincenty has a known failure mode. Near-antipodal pairs may not converge. The page reports this rather than concealing it; Karney's algorithm is the fix if you need one.
- Not for safety-critical navigation. Use certified flight-planning or ECDIS software for operational use. This is a planning, teaching and estimation tool.
Frequently asked questions about great-circle distance
Is the great-circle distance the same as the distance an airliner actually flies?
No. The great-circle distance is the shortest path across an idealised sphere. A real flight adds departure and arrival manoeuvres, airway and airspace routing, oceanic track structures and wind-optimised deviations, so the flown track is normally 1 to 5 percent longer, and considerably longer when weather or overflight restrictions force a detour.
Which Earth radius does this calculator use, and does the choice matter?
The default is the arithmetic mean radius of the three WGS 84 semi-axes, R1 = (2a + b) / 3 = 6371.0087714 km, listed in NIMA TR8350.2 Table 3.3. You can switch to the equal-area sphere R2 = 6371.0071809 km, the equal-volume sphere R3 = 6371.0007900 km, or a custom radius. The three standard spheres differ by under 8 metres of radius, which moves the New York to London answer by about 7 metres out of 5570 km.
Why does this calculator use the haversine formula rather than the spherical law of cosines?
The two are algebraically equivalent but not numerically equivalent. The law of cosines takes the arc cosine of a quantity that approaches 1 for nearby points, and in IEEE 754 double precision that argument loses almost all of its significant digits. For two points separated by 0.000001 degrees of latitude at 51.5 degrees north the true separation is 111.1951 mm, and the law of cosines returns 134.2590 mm, an error of 20.7 percent; closer still, the argument rounds to exactly 1 and the formula returns zero. Haversine works with the sine of half the differences, so the small quantity stays small and the result stays accurate at every separation.
Why do the initial and final bearings of a great-circle route differ?
Except along the equator or a meridian, a great circle crosses successive meridians at a continuously changing angle, so the true course changes along the route. The initial bearing is the course to steer when leaving point A and the final bearing is the course you are on when arriving at point B. From New York to London they are 51.2126 and 108.3297 degrees on the sphere. Holding the initial bearing as a fixed heading produces a rhumb line instead, which is a different and longer path.
How are the poles, the 180th meridian and antipodal points handled?
Latitudes of exactly plus or minus 90 degrees are accepted, and at a pole the longitude has no effect on the geometry. The longitude difference is wrapped into the range minus 180 to plus 180 degrees before the haversine terms are formed, so crossing the 180th meridian is not mistaken for a trip nearly all the way around the world. Identical points return exactly zero. For antipodal and near-antipodal points every great circle through them has the same length, so no bearing is unique, and the Vincenty ellipsoidal solution is reported as non-convergent rather than forced to a wrong number.
How much error does treating the Earth as a sphere introduce?
For long intercontinental routes the spherical answer is usually within about 0.3 percent of the WGS 84 geodesic: New York to London is 5570.23 km on the mean sphere against 5585.23 km on the ellipsoid, a shortfall of 15.00 km. The largest relative errors appear on short lines, where the sphere replaces the local radius of curvature: a short north-south line on the equator comes out about 0.56 percent too long, and a short line near a pole about 0.45 percent too short. Switch to the ellipsoidal geodesic whenever the number feeds survey, legal or engineering work.
Sources. Ellipsoid and sphere constants: National Imagery and Mapping Agency, Department of Defense World Geodetic System 1984: Its Definition and Relationships with Local Geodetic Systems, NIMA TR8350.2, Third Edition, 4 July 1997 (Amendment 1, 3 January 2000) — Table 3.1 gives the defining parameters a = 6378137.0 m and 1/f = 298.257223563; Table 3.3 gives b = 6356752.3142 m, R1 = 6371008.7714 m, R2 = 6371007.1809 m and R3 = 6371000.7900 m. Ellipsoidal geodesic: T. Vincenty, “Direct and inverse solutions of geodesics on the ellipsoid with application of nested equations”, Survey Review 23(176), April 1975, 88–93, hosted by the NOAA National Geodetic Survey — inverse equations (13)–(21) and the stated non-convergence for nearly antipodal lines. Modern alternative: C. F. F. Karney, “Algorithms for geodesics”, Journal of Geodesy 87(1), January 2013, 43–55. Exact unit conversions (1 international mile = 1.609344 m × 103; 1 nautical mile = 1852 m): NIST Special Publication 811, Appendix B.8. The haversine and bearing identities are standard spherical trigonometry and are reproduced above in full so they can be checked directly.
Your route by method
Calculate a distance above and this table fills in with the same route evaluated four ways, so you can see how much the model choice is worth on your coordinates.
| Method | Distance (km) | Distance (nmi) | Delta vs geodesic |
|---|---|---|---|
| No route calculated yet. | |||
Mini-game: Jetstream Jockey
Feel why the shortest route bends on a flat map: ride the live great-circle lane, dodge storm cells, and scoop tailwind rings before the clock runs out.
Route complete
Controls: press the upper half of the canvas to climb north, press the lower half to dip south. Keyboard fallback: ↑ and ↓.
Compute a route above to update the flight lane. The game pauses automatically if the tab loses focus.
