Distance Calculator

Find the straight-line distance between two points on Earth from their latitude and longitude. The distance calculator gives kilometres, miles, nautical miles, and the compass bearing.

Updated
Runs in your browser. Your data is not uploaded.
Point A

Decimal (35.6892) or DMS (35°41′21″N)

Point B

Distance
–

How to use the Distance Calculator

  1. Enter the Latitude and Longitude of point A, in decimal degrees or DMS.
  2. Enter the coordinates of point B. Use Swap points to reverse the direction.
  3. Press Calculate. The distance appears in kilometres, miles, and nautical miles, with the bearing from A to B.

How it works

a = sin²(Δφ ÷ 2) + cos φ₁ × cos φ₂ × sin²(Δλ ÷ 2)
distance = 2 × R × asin(√a)
bearing = atan2(sin Δλ × cos φ₂, cos φ₁ × sin φ₂ − sin φ₁ × cos φ₂ × cos Δλ)
  • φ: latitude, λ: longitude, in radians
  • R: Earth's mean radius, 6,371.0088 km

Examples

  • Tehran (35.6892, 51.3890) to Istanbul (41.0082, 28.9784): about 2,035 km (1,265 miles), heading west-northwest.
  • New York (40.7128, −74.0060) to London (51.5074, −0.1278): about 5,570 km.

Great-circle versus road distance

The great-circle route is the shortest path over the Earth's surface, the one planes roughly follow. Roads wind around terrain and borders, so driving distances are usually 20% to 40% longer.

Limitations

  • Treats the Earth as a sphere. The difference from the true ellipsoid is under 0.5%.
  • Elevation is ignored.
  • The bearing is the starting direction; on a great circle it changes along the way.

Frequently asked questions

How do I calculate distance from latitude and longitude?

Use the haversine formula, which this calculator applies for you.

Can I enter degrees, minutes, and seconds?

Yes. Type something like 35°41′21″N, or 35 41 21 N.

What is a nautical mile?

Exactly 1,852 metres, used at sea and in aviation.

Often used together with the Distance Calculator.