Distance Between Coordinates
Find the distance between two GPS coordinates.
Result
How it is calculated
The haversine formula gives the great-circle (shortest path over the surface) distance between two points on a sphere. With latitudes φ and longitudes λ in degrees, it computes a = sin²(Δφ/2) + cos φ1 × cos φ2 × sin²(Δλ/2) and then d = 2R × asin(√a), where R = 6371 km is the mean Earth radius. The result is in kilometres.
Enter coordinates as decimal degrees: north and east are positive, south and west are negative. Treating the Earth as a perfect sphere introduces an error of up to roughly half a percent compared with ellipsoidal methods. The result is the straight path over the surface, not the road, rail or flight route, and it ignores altitude.
Worked example
Istanbul is at (41.0082, 28.9784) and Ankara at (39.9334, 32.8597). The latitude difference is −1.0748° and the longitude difference is 3.8813°. These go into the haversine expression for a, and then d = 2 × 6371 × asin(√a). The result is 349.36 km along the surface of the Earth.
Common mistakes
- Swapping latitude and longitude. Latitude comes first and ranges from −90 to 90.
- Entering degrees, minutes and seconds (41°00′29″) instead of decimal degrees.
- Forgetting the minus sign for south latitudes and west longitudes, which puts the point on the wrong side of the globe.
- Expecting driving distance. The road distance is usually longer than this straight-line figure.
About this calculator
This calculator uses the haversine formula to compute the great-circle distance between two points given as latitude and longitude, treating the Earth as a sphere with a radius of about 6,371 km — the shortest path a plane or ship would actually travel, not a straight line through the ground.
It's used in logistics and shipping to estimate travel distances, by developers building "distance from you" features, and by pilots, sailors and travelers curious about the true distance between two cities or coordinates.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
No calculators found
Comments (0)