Distance between coordinates

Enter two points as latitude and longitude. You get the great-circle distance, the bearing from the first point to the second, and the midpoint.

Point A
Point B

Decimal degrees, decimal minutes or DMS, with a sign or N/S/E/W.

Distance
3,935.75 km
2,445.56 mi
    Show on map

    The haversine formula

    The distance is computed with the haversine formula on a sphere of radius 6,371,000 m — the mean Earth radius, and the same model the Land Measure app uses for every side of a measured plot. φ is latitude and λ longitude, in radians:

    h = sin²((φ₂ − φ₁)/2) + cos φ₁ · cos φ₂ · sin²((λ₂ − λ₁)/2) d = 2R · atan2(√h, √(1 − h)) Initial bearing θ = atan2( sin Δλ · cos φ₂, cos φ₁ · sin φ₂ − sin φ₁ · cos φ₂ · cos Δλ )

    The bearing is measured clockwise from true north: 0° is north, 90° east, 180° south, 270° west. The final bearing is the direction you are heading as you arrive at point B.

    Worked example

    From New York City (40.7128, −74.0060) to Los Angeles (34.0522, −118.2437): the great-circle distance is 3,935.75 km (2,445.56 mi). You set off on a bearing of 273.7° (just north of due west) and arrive heading 245.9°. The midpoint is near 39.5103, −97.1601 in Kansas.

    Uses on the land

    • Check the length of a boundary line between two surveyed corners from a deed or plat.
    • Measure how far a well, building or tree is from a corner marker.
    • Compare a GPS reading with a known point to see how far off it is.

    To go the other way — from a start point, a distance and a bearing to a new point — use the destination point calculator. For the area of several corners, use area from coordinates.

    Frequently asked questions

    Is this the straight-line distance?

    It is the great-circle distance: the shortest path over the Earth’s surface between the two points, ignoring hills and roads. Driving or walking distances are longer.

    Why does the bearing change along the way?

    A great circle crosses each meridian at a different angle, so the compass direction you start with (initial bearing) differs from the one you arrive with (final bearing). Over a field or a property line the difference is negligible; across a continent it can be tens of degrees.

    How accurate is the haversine formula?

    On a sphere it is exact. Because the real Earth is slightly flattened, spherical distances can differ from precise ellipsoidal (WGS 84) distances by up to about 0.5%, depending on where and in which direction you measure. For land-measuring distances that’s well below GPS error.

    Are bearings true north or magnetic north?

    True (geographic) north. A magnetic compass differs by the local magnetic declination, which depends on where you are and changes slowly over the years.