Distance Between Two Coordinates Calculator (Great-Circle)
Calculate the great-circle distance between two latitude and longitude points in kilometres, miles and nautical miles, with bearing and midpoint.
Results are planning estimates based on the values you enter. Check local rules, prices and real-world details before relying on them.
What is the distance between two coordinates?
The distance between two points given by latitude and longitude is usually measured along a great circle, the shortest path over the Earth's curved surface. The haversine formula calculates it from the angle between the points at the Earth's centre, multiplied by the Earth's radius.
How to use this calculator
Enter the latitude and longitude of two places in decimal degrees, using negative numbers for south and west. The calculator gives the shortest distance over the Earth's surface, the initial compass bearing and the midpoint of the route.
Formula
Haversine formula: a = sin²(Δφ/2) + cos φ₁ × cos φ₂ × sin²(Δλ/2), c = 2 × atan2(√a, √(1 − a)), distance = R × c with mean Earth radius R = 6,371.0088 km. Initial bearing θ = atan2(sin Δλ × cos φ₂, cos φ₁ × sin φ₂ − sin φ₁ × cos φ₂ × cos Δλ).
Terms in the formula
- φ₁, φ₂
- Latitudes of the two points, in radians.
- Δλ
- Difference in longitude.
- R
- Mean Earth radius, 6,371.0088 km.
- c
- Central angle between the points.
Understanding your result
The distance is the shortest surface path, the one aircraft and ships aim to follow. The initial bearing is the compass direction to start in; on a long route the bearing changes along the way. The spherical model is accurate to within about half a percent, which is ample for travel and planning.
Calculator credits
Calculator developmentJulia Edwards
Editorial supervisionSamad Aslam Khan
Published byThe Calculatorz
Last updated
Read how we research, test, review and correct our calculators in our editorial policy.
Frequently asked questions
What is a great-circle distance?
It is the shortest distance between two points on the surface of a sphere, measured along the circle whose centre is the centre of the Earth. Long-haul flights follow routes close to great circles.
How accurate is the haversine formula?
It treats the Earth as a sphere, which is accurate to within about 0.5%. For surveying, use an ellipsoidal method such as Vincenty's or Karney's, as used by the US National Geodetic Survey.
Why is the flight route curved on a flat map?
Flat maps distort the round Earth. The shortest route between London and New York looks curved on a Mercator map but is a straight line on a globe.
How do I convert degrees, minutes and seconds to decimal degrees?
Decimal degrees = degrees + minutes ÷ 60 + seconds ÷ 3,600. 51° 30′ 26″ N is 51.5072°; use a minus sign for south or west.
Is this the driving distance?
No. It is the shortest distance over the Earth's surface. Roads rarely follow that line, so driving distances are longer; use a route planner for road travel.
What is a nautical mile?
A nautical mile is exactly 1,852 metres, originally one minute of latitude. It is used in air and sea navigation.
References & methodology sources
These sources support the calculator’s formula, definitions, thresholds, units or result interpretation.
- Weisstein, E. W. (n.d.). Great circle. MathWorld—A Wolfram Web Resource. View source
- Karney, C. F. F. (2013). Algorithms for geodesics. Journal of Geodesy, 87(1), 43–55. View source
- Moritz, H. (2000). Geodetic Reference System 1980. Journal of Geodesy, 74(1), 128–133. View source
- National Oceanic and Atmospheric Administration, National Geodetic Survey. (n.d.). Inverse and forward geodetic calculations [Online tool]. View source