Distance Calculator
This distance calculator finds how far apart two points are in three ways: GPS latitude-longitude pairs on Earth's surface, flat 2D coordinates, and full 3D space. Enter both points and you'll get the answer instantly, plotted on a live diagram, with the exact formula used. The GPS mode runs the haversine great-circle formula, so it returns the real over-the-globe distance in kilometers, miles, and nautical miles, not a flat-map guess.
- GPS great-circle
- 2D and 3D points
- Live plot
- Formula shown
- Miles, km, nautical
Last updated July 16, 2026 Haversine on Earth's mean radius, 6,371 km Reviewed by the Calcowa team
Prefilled with New York City to London. Use decimal degrees; south and west are negative. Your phone's GPS or any map app shows coordinates in this format.
How far is one degree of latitude or longitude?
A degree of latitude is nearly the same length everywhere, but a degree of longitude shrinks as you move toward the poles, because the lines of longitude converge. That's exactly why the GPS mode can't just plug degrees into the flat distance formula. Here's what one degree works out to at different latitudes.
| One degree of | Kilometers | Miles |
|---|---|---|
| Latitude (anywhere on Earth) | 111.32 km | 69.17 mi |
| Longitude at the equator | 111.32 km | 69.17 mi |
| Longitude at 30° latitude | 96.41 km | 59.91 mi |
| Longitude at 45° latitude | 78.72 km | 48.92 mi |
| Longitude at 60° latitude | 55.66 km | 34.59 mi |
| One minute of latitude | 1.852 km (1 nautical mile) | 1.15 mi |
How does this distance calculator work?
Flat coordinates use the distance formula, which is the Pythagorean theorem applied to the differences between the points. In 2D you square the horizontal and vertical differences, add them, and take the square root. In 3D there's one extra squared term for depth. GPS coordinates need a different tool entirely, because degrees aren't a fixed length and the surface curves, so the calculator uses the haversine formula to find the great-circle distance.
A worked example, both ways
On paper first: the distance between (2, 3) and (7, 11) starts with the differences, 7 - 2 = 5 and 11 - 3 = 8. Square them to get 25 and 64, add to get 89, and take the square root: about 9.43 units. That's the hypotenuse of the right triangle the plot draws for you.
Now on the globe: New York City sits at (40.7128, -74.0060) and London at (51.5074, -0.1278). Feed those into the haversine formula with Earth's mean radius of 6,371 km and the central angle comes out to about 50.1 degrees, which gives a great-circle distance of roughly 5,572 km, or 3,462 miles, or 3,009 nautical miles. That's the shortest possible surface route; a flat-map calculation on those coordinates would get it badly wrong.
One assumption to know about: the GPS mode treats Earth as a sphere, so results can differ from ellipsoid-based tools by up to about 0.5%. For navigation planning, distance between cities, or checking a hike, that's well inside the noise. If you also need the point halfway along a flat segment, the midpoint calculator pairs nicely with the 2D mode here.
Frequently asked questions
Subtract the coordinates to get the horizontal and vertical differences, square both, add them, and take the square root. That's the distance formula: d = sqrt((x2 - x1)^2 + (y2 - y1)^2). For (2, 3) and (7, 11), the differences are 5 and 8, the squares are 25 and 64, and the square root of 89 is about 9.43. The 2D mode above does this instantly and plots the triangle so you can see where the numbers come from.
Yes, it's the Pythagorean theorem in disguise. The two points sit at the ends of a right triangle's hypotenuse, the horizontal difference is one leg, and the vertical difference is the other. The theorem says the hypotenuse squared equals the sum of the squared legs, so the distance is the square root of that sum. The plot in the 2D mode draws those two legs as dashed lines, and that's exactly the triangle you're solving.
It's the same idea with one more term. Take the differences along x, y, and z, square all three, add them, and take the square root: d = sqrt(dx^2 + dy^2 + dz^2). A point 3 units over, 4 units up, and 5 units deep is sqrt(9 + 16 + 25) = sqrt(50), about 7.07 units away. It works because you're applying the Pythagorean theorem twice, once across the floor and once up the height.
You can't use the flat formula, because latitude and longitude wrap around a sphere. The standard method is the haversine formula, which converts both points to angles, finds the central angle between them through Earth's center, and multiplies it by Earth's mean radius, about 6,371 km. That gives the great-circle distance, the shortest path along the surface. The GPS mode here runs the whole calculation and reports kilometers, miles, and nautical miles.
It's the shortest route between two points along the surface of a sphere, the path an aircraft would ideally fly. A great circle is any circle around Earth whose center is Earth's center, like the equator. On a flat map these routes look curved, which is why flights from New York to London arc up near Greenland. A line that looks straight on a flat map is usually longer in reality than the great-circle route.
Within about 0.5% for almost any pair of points, which is plenty for planning and general use. The error comes from treating Earth as a perfect sphere when it's really slightly flattened at the poles, with about 21 km between the polar and equatorial radius. Surveying tools use ellipsoid methods like Vincenty's formula to shrink the error to millimeters, but for distances between cities, hikes, or waypoints, haversine is the standard choice.
No, and it's worth knowing why. This tool returns the straight-line or great-circle distance, sometimes called 'as the crow flies'. Roads bend around terrain, water, and property lines, so real driving routes typically run 20% to 40% longer than the straight line. The straight-line figure is still useful as a lower bound, for range checks, and for anything that really does travel in a straight line, like radio signals and flight planning.
A nautical mile is 1,852 meters, about 1.15 land miles, and it's the unit ships and aircraft use. It was defined so that one nautical mile equals one minute of latitude, 1/60 of a degree, which makes chart navigation clean: a degree of latitude is 60 nautical miles. Speed in knots is just nautical miles per hour, so an aircraft doing 300 knots covers 300 nautical miles of great-circle distance in an hour.
Related calculators
More coordinate and shape tools.
The point halfway between, with slope.
Trigonometry CalculatorAngles, sides, and the unit circle.
Area CalculatorEvery flat shape in one tool.
Measuring a shape next?
Volume, area, and surface area tools for every common shape.