Distance Between Coordinates Calculator
Straight-Line Distance Between Any Two Points on Earth
Latitude and longitude describe a position, not a distance, and the relationship between the two isn't as simple as Pythagoras' theorem — the Earth is a sphere, and a degree of longitude shrinks toward the poles while a degree of latitude stays roughly constant. This calculator applies the haversine formula, the standard method for computing the true great-circle distance between two coordinate pairs.
The Formula
a = sin²(Δlat÷2) + cos(lat1)·cos(lat2)·sin²(Δlon÷2)
c = 2·atan2(√a, √(1−a))
d = R × c, R = 6371 km (mean Earth radius)
c = 2·atan2(√a, √(1−a))
d = R × c, R = 6371 km (mean Earth radius)
Worked Example
New York City (40.7128° N, 74.0060° W) to London (51.5074° N, 0.1278° W):
| Unit | Distance |
|---|---|
| Kilometers | 5,570.22 km |
| Miles | 3,461.17 mi |
Where This Calculation Is Used
- Logistics and shipping — estimating as-the-crow-flies distance between warehouses, ports, or delivery points as a baseline before applying real road or shipping routes.
- "Find nearby" features — store locators and location-based apps use this exact formula to rank results by proximity to a user's coordinates.
- Geography and GIS coursework — the standard introduction to spherical distance calculation before moving on to ellipsoidal models like Vincenty's formula.
Note: This is a great-circle (shortest-path-on-a-sphere) distance, not a driving or walking route distance. It also treats Earth as a perfect sphere, which introduces a small error (typically well under 0.5%) compared to more precise ellipsoidal models.
How to Use This Calculator
- Enter the first point's latitude in decimal degrees.
- Enter the first point's longitude in decimal degrees.
- Enter the second point's latitude and longitude in decimal degrees.
- Select Calculate to get the distance in kilometers and miles.
Related Calculations
Need the compass direction between the two points as well? See the Compass Bearing Calculator. For flight-planning distances in nautical miles, use the Great Circle Distance Calculator.