Travel

Distance Between Coordinates Calculator (Latitude and Longitude)

Enter two sets of coordinates to get the straight-line distance over the Earth’s surface and the direction to travel.

Your numbers

Your results

Distance (km)
Distance (km)
—
Distance (miles)
—
Distance (nautical miles)
—
Initial bearing from A (degrees from true north)
—
Initial direction
—
Midpoint (latitude, longitude)
—

Distance Between Coordinates Calculator (Latitude and Longitude) by TheCalcTools

How the Distance Between Coordinates Calculator (Latitude and Longitude) works

The shortest path between two points on a sphere is part of a great circle. The haversine formula gives its length from the two latitudes and the difference in longitude, and stays accurate even for very short distances.

The initial bearing is the compass direction you would set off in from point A. On a great circle the bearing changes along the way (except along the equator or a meridian), so the arrival bearing is usually different.

The Earth is slightly flattened, so the sphere model can differ from precise ellipsoid (WGS-84) distances by up to about 0.5%. That is fine for travel planning but not for surveying.

The formula

a = sin²(Δφ/2) + cos φ₁ cos φ₂ sin²(Δλ/2); d = 2R asin(√a), R = 6371.0088 kmθ = atan2( sin Δλ cos φ₂, cos φ₁ sin φ₂ − sin φ₁ cos φ₂ cos Δλ )

Worked example

Using the default values shown in the calculator:

Point A latitude (north positive)51.5072
Point A longitude (east positive)-0.1276
Point B latitude (north positive)48.8566
Point B longitude (east positive)2.3522
  1. London (51.5072, −0.1276) to Paris (48.8566, 2.3522): 343.5 km or 213.5 miles.
  2. Set off on a bearing of 148.1° (South-southeast); the midpoint is at 50.1885, 1.1467.

Result:

Distance (km)343.5
Distance (miles)213.5
Distance (nautical miles)185.5
Initial bearing from A (degrees from true north)148.1
Initial directionSouth-southeast
Midpoint (latitude, longitude)50.1885, 1.1467

Frequently asked questions

Is this the driving distance?

No. It is the straight-line (as the crow flies) distance over the Earth’s surface. Roads are usually 20% to 40% longer, and flights add a little for routing.

What format do the coordinates need?

Decimal degrees: north and east are positive, south and west are negative. 40° 26′ 46″ N is 40 + 26/60 + 46/3600 = 40.4461.

Why is the flight from Europe to North America curved on a map?

Flat maps distort the globe. The great-circle route, which is the shortest, looks curved toward the pole on most map projections.

Sources and further reading

More in Travel · All calculators

This calculator gives estimates for information only. Check important results independently before you rely on them. See our disclaimer.