SuperDevTools

GPS distance calculator: distance between two coordinates

Examples

Accepted formats: 48.8566, 2.3522 · 48°51'24"N 2°21'8"E · N 48° 51.4' E 2° 21.1'. Latitude comes first, unless the letters N, S, E or W show the order. South and west: minus sign or the letter S, W.

Diagram of the points
Diagram, not a map: relative position of the points, north at the top, longitudes narrowed according to latitude. The line follows the great circle.
Formulas used

    Only your settings (unit, display, tab) are remembered on this device. Coordinates and your location are never stored or sent.

    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

    1. In Point A (latitude, longitude), type or paste a position: 51.5074, -0.1278, 51°30'27"N 0°7'40"W or N 51° 30.444' W 0° 7.668'. Latitude comes first, unless N, S, E or W letters say otherwise.
    2. Fill in Point B. The result appears straight away.
    3. Pick the Distance unit and the Coordinate display at the top. Both settings are remembered on this device.
    4. 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:

    TripHaversineVincentyInitial bearing
    London – Manchester261.983 km262.371 km (163.030 mi)327.65°
    New York – Los Angeles3,935.746 km3,944.422 km (2,450.950 mi)273.73°
    Paris – London343.556 km343.923 km329.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.