How to use it
- Type the starting place in From: coordinates in any form, or a city name from the list.
- Type the destination in To, in the same way.
- Read Ellipsoidal distance in km, miles or nautical miles, or the Great-circle distance if you want the sphere value.
- Use Initial bearing as the compass direction to set off on, and open Working for each step.
Why there are two distances
The Earth is not a sphere: it is flattened at the poles, by about 21 km between the equatorial and the polar radius. The great-circle distance treats the Earth as a sphere of mean radius 6 371.0088 km, which is quick and needs no iteration. The ellipsoidal distance follows the WGS 84 shape, which is the one that surveyors and geodesists use. The two differ by a few tenths of a per cent.
Haversine:
a = sin²(Δφ ÷ 2) + cos φ₁ × cos φ₂ × sin²(Δλ ÷ 2)
d = 2R × atan2(√a, √(1 − a)), with R = 6 371.0088 km
Vincenty: an iterative solution on WGS 84 (a = 6 378 137 m, 1/f = 298.257223563)
- Movable Type Scripts gives the error of the spherical model for distances as up to about 0.3 %.
- Vincenty's iteration stops after at most 200 steps. For points almost opposite on the globe it does not settle, and the tool then gives only the sphere value.
Miles, nautical miles and bearings
One nautical mile is exactly 1 852 m and one statute mile is exactly 1 609.344 m (NIST, Special Publication 811). The initial bearing is the compass direction in which you set off, measured clockwise from true north. Along a great circle the bearing changes on the way, so the bearing at the destination is different.
- A bearing of 0 is north, 90 east, 180 south and 270 west.
What this tool does not cover
- Roads, flight routes and sea routes. A road follows the land, and an aircraft or a ship may follow a great circle or another path.
- Height. The distance is between points on the surface at sea level, not in three dimensions.
- Addresses. A city is its centre point in the GeoNames list.
Worked example: Istanbul to Ankara, from the coordinates 41.0082, 28.9784 to 39.9334, 32.8597
The haversine central angle is 3.142°, or 0.054835 radians, so the sphere gives 0.054835 × 6 371.0088 km = 349.36 km. Vincenty's iteration on WGS 84 settles and gives 350.08 km, which is the more exact figure.
The starting bearing is about 108.7 degrees, so the straight line leaves Istanbul towards the east, a little south.
| Result | Value |
|---|---|
| Ellipsoidal distance | 350.08 km, 217.53 mi, 189.03 NM |
| Great-circle distance | 349.36 km, 217.08 mi, 188.64 NM |
| Initial bearing (great circle) | 108.73° |
| Initial bearing (ellipsoid) | 108.66° |
Frequently asked questions
Is the straight-line distance the same as the road distance?
No. The distance here is the straight line over the Earth's surface, the geodesic. A road follows the land and is always longer than that line, so a route planner shows more kilometres. Road distances between Turkish provinces have their own page.
What is the difference between the great-circle and the ellipsoidal distance?
The great-circle distance assumes a sphere; the ellipsoidal distance follows the flattened WGS 84 shape of the Earth. The difference is usually below 0.3 %, and the ellipsoidal value is the more exact of the two.
Why is there no ellipsoidal distance for two points almost on opposite sides of the Earth?
The Vincenty iteration used for the ellipsoid does not settle for nearly antipodal points, so it gives no answer there. The great-circle value is still given, and on the sphere it is good to about 0.3 %.
Can I type a city name?
Yes. Names come from the GeoNames list of places with more than 15 000 people, and case and accents do not matter. When several places share a name, the most populous is used; add the country code after a comma, such as Ankara, TR, to choose another.
Which bearing should I follow on a long trip?
The initial bearing is where you set off. Along a great circle the compass direction keeps changing, so a ship or an aircraft that holds one heading follows a rhumb line instead. The bearing calculator gives the rhumb-line bearing and distance.
Are these results good enough for a land survey?
They are good for planning and for judging scale. A survey or a legal boundary needs measured distances on the ground, the correct datum and the heights of the points, so use the surveyor's own data for that.
Sources
- Movable Type Scripts: calculate distance, bearing and more (the haversine formula and its accuracy)
- Movable Type Scripts: Vincenty solutions of geodesics on the ellipsoid (with its test case)
- Wikipedia: Haversine formula (the White House to the Eiffel Tower example)
- NIST Special Publication 811, Appendix B: conversion factors (the nautical and statute mile)
- GeoNames, cities with more than 15 000 people (CC BY 4.0)
Figures and text last checked on Tuesday, November 10, 2026.