Math

Distance Between Coordinates Calculator

Enter the latitude and longitude of two places to get the straight-line distance between them in kilometres, miles and nautical miles, with the direction to head in.

Rules last checked 25 October 2026Every step shown

Your numbers are saved in this browser.

Decimal degrees; south is negative. Copy them from Google Maps by right-clicking a place.

West is negative.

Distance

1,033 km

In miles
641.88 mi
In nautical miles
557.78 nmi
Starting direction
42.6° (NE)

The two points are 1,033 km (641.9 miles) apart in a straight line over the Earth's surface, heading NE at the start.

How it's worked out

  1. Haversinea = sin²(Δlat ÷ 2) + cos lat₁ × cos lat₂ × sin²(Δlon ÷ 2)0.00655802
  2. Distance2 × 6,371.0088 km × atan2(√a, √(1 − a))1,033 km
  • This is the great-circle distance, “as the crow flies”; roads are longer. The Earth is treated as a sphere, which is accurate to within about 0.5%.

The haversine formula

a = sin²(Δlat ÷ 2) + cos lat₁ × cos lat₂ × sin²(Δlon ÷ 2)

distance = 2R × atan2(√a, √(1 − a)), R = 6,371 km

Examples

Karachi (24.8607, 67.0011) to Lahore (31.5204, 74.3587) is 1,033 km, starting at a bearing of 42.6° (NE). London to Paris is about 344 km.

Coordinates are in decimal degrees: south latitudes and west longitudes are negative.

Questions people ask

How far is Karachi from Lahore in a straight line?

About 1,033 km (642 miles), heading north-east. By road it is much further, roughly 1,200 km.

How do I get the coordinates of a place?

In Google Maps, right-click the spot and the latitude and longitude appear at the top of the menu; click them to copy.

What formula does it use?

The haversine formula, which gives the great-circle distance: the shortest path over the surface of a sphere.

How accurate is it?

Treating the Earth as a sphere is accurate to within about 0.5%, which is plenty for travel, delivery and planning.

About this calculator

Formula and rules last checked 25 October 2026Written and tested by the CalculatorDex teamReport a problem