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. A latitude outside ±90 or a longitude outside ±180 gives no result. 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, longitude from −180 to 180; values outside these ranges give no result.
- 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
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
A good test is London (51.5074, -0.1278) to Paris (48.8566, 2.3522), which comes out near 343.6 km. Enter latitude first and longitude second, and use negative numbers for south and west. If your source gives degrees, minutes and seconds, convert with degrees + minutes / 60 + seconds / 3600. The result is a straight line over the surface, so a road or flight route will be longer. Which kind of trip are you measuring?