Latitude Longitude Distance Calculator

Find the shortest surface distance between two points on Earth from their latitude and longitude, using the haversine great-circle formula.

🌍 Latitude Longitude Distance Calculator
Latitude 1 (φ1)40.7128
deg
-9090
Longitude 1 (λ1)-74.006
deg
-180180
Latitude 2 (φ2)51.5074
deg
-9090
Longitude 2 (λ2)-0.1278
deg
-180180
Great-circle distance
—
Distance in miles
—
Distance in nautical miles
—
Central angle
—
Step-by-step working

🌍 What is Latitude Longitude Distance?

Latitude longitude distance, more formally called great-circle distance, is the shortest path between two points measured across the curved surface of the Earth rather than through it. Because Earth is very nearly a sphere, that shortest path is always an arc of a great circle, the circle formed where a plane through the centre of the Earth cuts the surface. The haversine formula converts two coordinate pairs into the central angle between them, and multiplying that angle by Earth's radius gives the surface distance directly.

This is one of the most widely implemented calculations in software. Ride-hailing and delivery apps use it to rank nearby drivers before ever calling a routing engine, because a great-circle distance costs microseconds while a road-network route costs milliseconds. Airlines use it to publish stage lengths and to estimate fuel burn on a proposed city pair. Amateur radio operators use it to work out the path length and beam heading to a distant station. Ecologists use it to measure animal displacement between GPS collar fixes. Real estate and retail analysts use it to define catchment radii around a store.

The most common mistake is treating great-circle distance as travel distance. It is a pure geometric shortest path, so a road journey between the same points is usually 20 to 40 percent longer, and a walking route inside a city can be far longer again. A second frequent error is applying the plane-geometry Pythagorean formula to raw latitude and longitude values. That fails badly because a degree of longitude shrinks from about 111 km at the equator to zero at the poles, so the longitude difference must be scaled by the cosine of the latitude, which is exactly what the haversine formula does.

This calculator takes two coordinate pairs in decimal degrees and returns the great-circle distance in kilometres, statute miles and nautical miles at once, plus the central angle and the true great-circle midpoint. It also charts the latitude profile of the actual route against a straight line drawn on a flat map, which makes the poleward bow of long-haul routes immediately visible.

📐 Formula

a = sin²(Δφ ÷ 2) + cosφ1 × cosφ2 × sin²(Δλ ÷ 2)   →   d = 2R × atan2(√a, √(1−a))
φ1, φ2 = latitude of point 1 and point 2 (radians)
Δφ = φ2 − φ1, the latitude difference
Δλ = λ2 − λ1, the longitude difference
R = Earth's mean radius, 6371.0088 km per the IUGG mean-radius definition
c = 2 × atan2(√a, √(1−a)), the central angle in radians
Example: New York to London gives a = 0.179236, c = 0.874309 rad, d = 5570.23 km.

📖 How to Use This Calculator

Steps

1
Enter the first coordinate pair. Type the latitude and longitude of the first point in decimal degrees, using negative values for south latitudes and west longitudes.
2
Enter the second coordinate pair. Type the latitude and longitude of the second point in decimal degrees, again using negative values for south and west.
3
Read the great-circle distance. The calculator applies the haversine formula and reports the distance in kilometres, statute miles and nautical miles, along with the central angle.

💡 Example Calculations

Example 1 — New York to London

40.7128°N, 74.0060°W to 51.5074°N, 0.1278°W

1
Δφ = 10.7946°, Δλ = 73.8782°
2
a = sin²(5.3973°) + cos(40.7128°)×cos(51.5074°)×sin²(36.9391°) = 0.179236
3
c = 2×atan2(√0.179236, √0.820764) = 0.874309 rad = 50.0942°
4
d = 6371.0088 × 0.874309 = 5570.23 km
Distance = 5570.23 km (3461.18 mi, 3007.68 nmi)
Try this example →

Example 2 — Delhi to Mumbai

28.6139°N, 77.2090°E to 19.0760°N, 72.8777°E

1
Δφ = −9.5379°, Δλ = −4.3313°
2
a = 0.008097, which is small because the two cities are relatively close together.
3
c = 0.180206 rad = 10.3251°, so d = 6371.0088 × 0.180206 = 1148.10 km
Distance = 1148.10 km (713.39 mi, 619.92 nmi)
Try this example →

Example 3 — Sydney to Los Angeles

33.8688°S, 151.2093°E to 34.0522°N, 118.2437°W

1
Δφ = 67.9210°, Δλ = −269.4530°, a route that crosses the date line and most of the Pacific.
2
a = 0.659311, giving c = 1.895072 rad = 108.5797°, well over half a right angle of arc.
3
d = 6371.0088 × 1.895072 = 12073.52 km, one of the longest regularly flown non-stop city pairs.
Distance = 12073.52 km (7502.14 mi, 6519.18 nmi)
Try this example →

❓ Frequently Asked Questions

How do I calculate the distance between two latitude and longitude points?+
Use the haversine formula. Compute a = sin squared of half the latitude difference, plus cos(lat1) times cos(lat2) times sin squared of half the longitude difference. Then c = 2 * atan2(sqrt(a), sqrt(1-a)) and the distance is R * c, where R is Earth's mean radius of 6371.0088 km.
What is the haversine formula used for?+
The haversine formula computes the great-circle distance between two points on a sphere from their latitudes and longitudes. It is the standard method in GPS software, mapping libraries, flight planning and any application that needs an accurate straight-line surface distance without the complexity of a full ellipsoidal geodesic.
What Earth radius should I use for great-circle distance?+
This calculator uses the IUGG mean radius of 6371.0088 km. Common alternatives are 6371 km (rounded), 6378.137 km (equatorial) and 6356.752 km (polar). The choice changes the answer by up to about 0.3 percent, which is well within the error already introduced by treating Earth as a sphere.
What is the central angle in the results?+
The central angle is the angle subtended at Earth's centre by the two points, expressed in degrees. Multiply it by 60 to get the distance in nautical miles almost exactly, since one nautical mile was defined as one arc-minute along a meridian. New York to London spans 50.0942 degrees.
Why is the great-circle route different from a straight line on a map?+
Flat maps distort the sphere. On the common Mercator projection a straight line is a rhumb line of constant bearing, which is longer than the great circle. The true shortest path bows toward the nearer pole, which is why the chart on this page shows the route reaching a higher latitude than a straight map line would.
How accurate is the haversine distance compared with real distance?+
Against a WGS-84 geodesic the spherical haversine result is typically within about 0.3 percent, or roughly 15 km on a 5000 km route. That is fine for planning, sorting nearby locations and radio path estimates, but not for surveying or precise geodetic work.
Can I use this to find driving distance?+
No. This returns the shortest surface distance in a straight line over the globe. Real driving distance follows roads and is usually 20 to 40 percent longer, more in mountainous terrain or where a river or coastline forces a detour.
How do I convert degrees, minutes and seconds to decimal degrees?+
Decimal degrees = degrees + minutes/60 + seconds/3600. So 51 degrees 30 minutes 26 seconds becomes 51 + 30/60 + 26/3600 = 51.5072. Make the whole result negative if the coordinate is south of the equator or west of the prime meridian.
What is the maximum possible great-circle distance on Earth?+
Half of Earth's circumference, about 20,015 km or 12,437 miles, which occurs between a point and its exact antipode. Any pair of points farther apart than that in one direction is closer going the other way around, which is why the central angle never exceeds 180 degrees.
Why does the calculator show three different distance units?+
Different fields use different units. Kilometres are standard in science and most of the world, statute miles in the United States and United Kingdom for land distance, and nautical miles in aviation and marine navigation because they map directly onto arc-minutes of latitude.
Does the order of the two points matter?+
No. Great-circle distance is symmetric, so swapping point 1 and point 2 gives exactly the same answer. Bearing is different: the azimuth from A to B is generally not the reverse of the azimuth from B to A.
What is the great-circle midpoint shown in the working?+
It is the coordinate halfway along the great-circle arc, not the simple average of the two latitudes and longitudes. For New York to London the true midpoint is 52.3684 degrees north, 41.2903 degrees west, noticeably farther north than the naive average of 46.1101 degrees would suggest.

How do I calculate the distance between two latitude and longitude points?

Use the haversine formula. Compute a = sin squared of half the latitude difference, plus cos(lat1) times cos(lat2) times sin squared of half the longitude difference. Then c = 2 * atan2(sqrt(a), sqrt(1-a)) and the distance is R * c, where R is Earth's mean radius of 6371.0088 km.

What is the haversine formula used for?

The haversine formula computes the great-circle distance between two points on a sphere from their latitudes and longitudes. It is the standard method in GPS software, mapping libraries, flight planning and any application that needs an accurate straight-line surface distance without the complexity of a full ellipsoidal geodesic.

What Earth radius should I use for great-circle distance?

This calculator uses the IUGG mean radius of 6371.0088 km. Common alternatives are 6371 km (rounded), 6378.137 km (equatorial) and 6356.752 km (polar). The choice changes the answer by up to about 0.3 percent, which is well within the error already introduced by treating Earth as a sphere.

What is the central angle in the results?

The central angle is the angle subtended at Earth's centre by the two points, expressed in degrees. Multiply it by 60 to get the distance in nautical miles almost exactly, since one nautical mile was defined as one arc-minute along a meridian. New York to London spans 50.0942 degrees.

Why is the great-circle route different from a straight line on a map?

Flat maps distort the sphere. On the common Mercator projection a straight line is a rhumb line of constant bearing, which is longer than the great circle. The true shortest path bows toward the nearer pole, which is why the chart on this page shows the route reaching a higher latitude than a straight map line would.

How accurate is the haversine distance compared with real distance?

Against a WGS-84 geodesic the spherical haversine result is typically within about 0.3 percent, or roughly 15 km on a 5000 km route. That is fine for planning, sorting nearby locations and radio path estimates, but not for surveying or precise geodetic work.

Can I use this to find driving distance?

No. This returns the shortest surface distance in a straight line over the globe. Real driving distance follows roads and is usually 20 to 40 percent longer, more in mountainous terrain or where a river or coastline forces a detour.

How do I convert degrees, minutes and seconds to decimal degrees?

Decimal degrees = degrees + minutes/60 + seconds/3600. So 51 degrees 30 minutes 26 seconds becomes 51 + 30/60 + 26/3600 = 51.5072. Make the whole result negative if the coordinate is south of the equator or west of the prime meridian.

What is the maximum possible great-circle distance on Earth?

Half of Earth's circumference, about 20,015 km or 12,437 miles, which occurs between a point and its exact antipode. Any pair of points farther apart than that in one direction is closer going the other way around, which is why the central angle never exceeds 180 degrees.

Why does the calculator show three different distance units?

Different fields use different units. Kilometres are standard in science and most of the world, statute miles in the United States and United Kingdom for land distance, and nautical miles in aviation and marine navigation because they map directly onto arc-minutes of latitude.

Does the order of the two points matter?

No. Great-circle distance is symmetric, so swapping point 1 and point 2 gives exactly the same answer. Bearing is different: the azimuth from A to B is generally not the reverse of the azimuth from B to A.

What is the great-circle midpoint shown in the working?

It is the coordinate halfway along the great-circle arc, not the simple average of the two latitudes and longitudes. For New York to London the true midpoint is 52.3684 degrees north, 41.2903 degrees west, noticeably farther north than the naive average of 46.1101 degrees would suggest.