Straight-line distance between two coordinates
Paste two GPS positions and the calculator gives the shortest distance between them over the globe, in kilometres, miles or nautical miles. It also shows the bearing to set off on, the bearing on arrival and the midpoint. Three more tabs cover related jobs: Destination point (where do you end up after 100 km on a bearing of 90°?), Route (total distance through a list of points) and Conversion between decimal degrees, degrees-minutes-seconds and degrees with decimal minutes.
Everything is worked out on the page itself. No map is loaded and no coordinates leave your device. The diagram only shows where the points sit relative to each other, with north at the top.
How to use it
- In Point A (latitude, longitude), type or paste a position:
51.5074, -0.1278,51°30'27"N 0°7'40"WorN 51° 30.444' W 0° 7.668'. Latitude comes first, unless N, S, E or W letters say otherwise. - Fill in Point B. The result appears straight away.
- Pick the Distance unit and the Coordinate display at the top. Both settings are remembered on this device.
- My location fills the field with your current position, only when you click it. It stays on the page and is never saved.
Haversine vs the ellipsoid
The haversine formula treats the Earth as a perfect sphere with a radius of 6,371 km:
a = sin²(Δφ/2) + cos φ₁ · cos φ₂ · sin²(Δλ/2), then d = 2R · atan2(√a, √(1 − a)), where φ is latitude and λ is longitude in radians.
The real Earth bulges at the equator: 6,378.137 km to the equator against 6,356.752 km to the poles. The Vincenty formula works on that flattened shape (the WGS84 ellipsoid used by GPS) and is accurate to within a millimetre. It refines its answer step by step; the calculator stops once a step changes the result by less than 10⁻¹² radian, usually after 3 to 6 rounds. For two points almost exactly opposite each other it cannot settle, so the tool says so and falls back to the sphere.
The two methods typically differ by 0.1 to 0.5 %. Worked examples from the calculator:
| Trip | Haversine | Vincenty | Initial bearing |
|---|---|---|---|
| London – Manchester | 261.983 km | 262.371 km (163.030 mi) | 327.65° |
| New York – Los Angeles | 3,935.746 km | 3,944.422 km (2,450.950 mi) | 273.73° |
| Paris – London | 343.556 km | 343.923 km | 329.95° |
Coordinates used: London 51.5074, -0.1278; Manchester 53.4808, -2.2426; New York 40.7128, -74.0060; Los Angeles 34.0522, -118.2437; Paris 48.8566, 2.3522. On the coast-to-coast trip the sphere comes up 8.676 km short. These are straight-line distances; roads are always longer.
In the Route tab, London, Birmingham (52.4862, -1.8904) and Manchester add up to 276.015 km. To convert by hand, remember that a degree has 60 minutes and a minute has 60 seconds: London's latitude 51.5074 is 51°30′26.64″ N, or 51° 30.4440′ N.
Frequently asked questions
How accurate is the result?
With Vincenty the maths is good to about a millimetre. The real limit is the input: four decimal places pin a point down to roughly 11 m, six decimal places to about 11 cm.
Why is the final bearing different from the initial one?
The shortest path on a globe is a great-circle arc, and it crosses each meridian at a slightly different angle. From New York you leave on 273.73° and reach Los Angeles heading 245.96°.
How do I enter west longitude or south latitude?
Use a minus sign (-0.1278) or the letter W or S (0°7'40.08"W). Both give the same point.
Is my location sent anywhere?
No. It is read only when you click My location, written into the field and gone when you close the page. Only your chosen unit, display and tab are remembered.