Distance between two points

Two places, and the straight line between them: the great-circle distance in kilometres, miles and nautical miles, the bearing at each end, and the halfway point.

How to use it

  1. Type the first place, or press My location, or click the map.
  2. Type the second place the same way. The line, the distance and the bearings appear.
  3. Drag either pin to move it. Press Swap to reverse the direction.
  4. Copy the link to share the pair of points.

5 practical uses

  1. Estimate a flight distance and time between two airports.
  2. Check how far a coordinate in a log is from a known point.
  3. Work out the range needed for a radio link, a drone or a boat.
  4. Compare the straight-line distance with a road route to judge a detour.
  5. Settle how far apart two towns really are, as the crow flies.

The maths behind it

The distance is the great-circle distance from the haversine formula: a = sin²(Δφ/2) + cos φ₁ cos φ₂ sin²(Δλ/2), d = 2R·atan2(√a, √(1−a)), with R = 6,371.0088 km. The initial bearing is θ = atan2(sin Δλ cos φ₂, cos φ₁ sin φ₂ − sin φ₁ cos φ₂ cos Δλ); the final bearing is the reverse bearing from the end point plus 180°. The midpoint is found from the sum of the two unit vectors.

Questions and answers

Is this the driving distance?

No. It is the straight line over the surface of the Earth, the great-circle distance. For the road distance use the driving distance tool.

Why do the initial and final bearings differ?

A great circle is the shortest path on a sphere, and it curves relative to the lines of longitude. The compass direction changes along the way, so the bearing at the start differs from the one at the end.

How accurate is it?

The formula uses a sphere of mean radius 6,371 km. The real Earth is slightly flattened, so the result can differ from the ellipsoidal distance by up to 0.3 %.

Embed this tool on your website

Paste this code where the tool should appear. It shows the tool alone, without this page's text, and links back here. It is free to use; the map data credit stays on the map.

<iframe src="https://waymorphic.com/tools/distance-calculator?embed=1" width="100%" height="760" style="border:0;border-radius:12px;max-width:100%" loading="lazy" allow="geolocation; fullscreen; clipboard-write" title="Distance between two points – Waymorphic Map"></iframe>

Change height to suit your page. To open the tool with a place already set, add the settings from this page's address bar (the part after #) to the end of the src. The embedded tool asks the visitor's browser for their location only when they press the button, and the allow attribute lets that work inside the frame.