Distance calculator
Distance between two places on Earth by latitude and longitude, or between two points on a graph.
About this calculator
This distance calculator finds how far apart two places are, as the crow flies, from their latitude and longitude. It also gives the starting compass bearing.
Switch to points to get the distance, midpoint and slope between two points on a graph, in two or three dimensions.
How it works
On Earth, the haversine formula gives the great-circle distance, the shortest path over a sphere with the Earth’s mean radius of 6,371 km. On a graph, the distance is √((x₂ − x₁)² + (y₂ − y₁)²), which is the Pythagorean theorem.
Last reviewed:
Worked example
- Between: Two places on Earth
- First place: latitude: 40.7128 °
- First place: longitude: -74.006 °
- Second place: latitude: 51.5074 °
- Second place: longitude: -0.1278 °
Distance: 3,461.2 mi (5,570.2 km)
Common questions
How is the distance between two coordinates calculated?
With the haversine formula, which finds the shortest path over the Earth's surface, the great-circle distance, from the two latitudes and longitudes.
Why do long flights look curved on a map?
Flat maps distort the round Earth. The shortest route, a great circle, looks curved on most maps, which is why flights between Europe and North America often head far north.
How do I find the distance between two points on a graph?
Use √((x₂ − x₁)² + (y₂ − y₁)²). From (1, 2) to (4, 6) the distance is √(9 + 16) = 5.
Sources and further reading
The story behind it
Where the idea came from: The haversine formula takes its name from the haversine, half of 1 − cos θ, which sailors looked up in printed tables to find distances at sea.
James Inman published tables of haversines for navigators in 1835. The formula stays accurate even for short distances, which is why mapping software still uses it.
Why you can trust this calculator
- It runs in your browser. Nothing you type into it is sent anywhere.
- The method is explained on this page, so you can check it yourself.
- Free to use, with no sign-up.
- Results are estimates, so please double-check anything important.
- Spotted a mistake? Tell us and we'll look into it.

After 15 years as a mathematics educator, I built CalculStore to give students, teachers, professionals and anyone working with numbers simple, reliable tools.
Meet the founder
