The guide
Why the Shortest Flight Looks Bent: Measuring the Distance Between Two Cities on a Lumpy Earth
A straight line between two cities curves on a flat map, changes bearing as it goes, and is a few kilometers different on a ball than on the real, slightly flattened Earth.
- 9,584.9 km London to Tokyo along the shortest path on the WGS 84 ellipsoid
- 11,395.5 km the same trip if you follow a straight line drawn on a flat world map
- 0.56 percent the largest gap measured between a sphere and the ellipsoid
- 15 nanometers worst distance error against 500,000 published test geodesics
- 7,342 places public domain populated places the search can find
Read the full guide Fold the guide
Ask how far it is from London to Tokyo and you will hear several answers. A road atlas has nothing to say, a flight booking site quotes one number, a school globe and a piece of string give another. Most of the confusion comes from mixing up three separate questions: what the shortest path over the Earth is, what shape the Earth is taken to be, and whether you are allowed to leave the ground.
This page answers the first two exactly and refuses the third. It measures the straight-line distance, the one a crow would fly if crows flew at sea level over a smooth planet. That distance has a precise definition and a precise answer, and the gap between it and the numbers people usually quote is worth understanding.
A straight line that bends on paper
On a sphere, the shortest path between two points is an arc of a great circle: the circle you get by slicing the ball through its center and both points. Every flat world map distorts the sphere somehow, so the great circle cannot stay straight on paper. On the common rectangular projection, where longitude runs evenly across and latitude evenly up, a long route bows toward the nearer pole.
London to Tokyo shows this clearly. Both cities lie well north of the equator, so the shortest path climbs over Scandinavia and Siberia and passes its halfway point above 69 degrees north. On the flat map in the tool it looks like a generous detour. A straight ruler line between the same two dots on that map would look shorter, yet measured on the globe it is 11,395.5 km long, almost 1,800 km more than the true shortest path.
The reason is that the flat map stretches the north. Near the top of a rectangular map, a centimeter covers far less ground east to west than the same centimeter at the equator. A path that rides up into the high latitudes crosses many degrees of longitude quickly, because those degrees are short up there. The curve is not a detour. The map is the thing that is bent.
The same geometry explains why the direction keeps changing. A traveller on the London to Tokyo path sets off at a bearing of 31.62 degrees, a little east of north-northeast. By the time the path reaches Tokyo, the direction of travel is 156.29 degrees, pointing south-southeast. Nothing turned the wheel. Following the straightest possible line over a curved surface simply means the compass reading drifts the whole way.
That drift is not a navigation error waiting to be corrected. It is what going straight means on a curved surface, and a flat map can only hide it.
There is a famous constant hidden in this drift. On any surface shaped like a spinning ball, the sine of the bearing times the radius of the circle of latitude stays the same all along a shortest path. This is Clairaut’s relation, and it is the starting point of every method for computing these paths on the real Earth.
A ball, or a slightly squashed one
The real Earth is not a sphere. Its rotation flattens it a little at the poles, and WGS 84, the reference system behind GPS, is an ellipsoid with an equatorial radius of 6,378,137 meters and a flattening of 1 part in 298.257223563. Those two numbers are defined, not measured, by the National Geospatial-Intelligence Agency. The flattening is small but not negligible. From the equator to the North Pole along a meridian is 10,001.966 km on the ellipsoid. A quarter of the way around the equator is 10,018.754 km. A sphere with the mean radius usually recommended for this job, 6,371.009 km, gives 10,007.557 km for both. Neither answer can be right for both trips.
The error is not spread evenly. A degree of latitude near the equator covers 110,574 meters on the ellipsoid but 111,195 meters on that sphere, because the Earth is flatter, and so less curved, along a meridian near its middle. Near the poles the effect reverses. A spherical formula with this radius is usually described as accurate to about half a percent. Checked against the 455,077 published test geodesics longer than a kilometer, the largest gap found was 0.56 percent, for short north to south lines near the equator.
For London to Tokyo, the sphere says 9,561.3 km and the ellipsoid says 9,584.9 km, a difference of 23.6 km, or about a quarter of a percent. For planning a holiday that hardly matters. For anything where people compare numbers, it is the difference between two answers that disagree and one that can be checked. The sphere still earns its place in the tool. The haversine formula, which computes the great-circle distance from the latitudes and longitudes with a few sines and one inverse sine, is short, stable for small distances, and easy to verify by hand. Showing it beside the ellipsoidal figure makes the size of the flattening visible instead of hidden.
Solving the shortest path on the ellipsoid
On an ellipsoid the shortest path is called a geodesic, and it has no tidy closed form. The classic way round this, worked out by Bessel and Helmert in the nineteenth century, maps the ellipsoid onto an auxiliary sphere where the geodesic becomes a great circle, and then corrects the distance and the longitude with integrals that can be expanded in powers of the flattening.
For decades the standard computer method was one published by T. Vincenty in 1975. It is accurate to a fraction of a millimeter for most pairs of points, but its iteration fails to converge when the two points are nearly opposite each other on the globe. That is not a rare corner. On an ellipsoid, a point near the antipode of your starting point can be reached by more than one shortest path, and an iteration that hunts for a single longitude can circle forever.
Charles Karney’s 2013 paper, “Algorithms for geodesics”, solved the problem cleanly. It carries the series expansions to sixth order in the flattening, so their truncation error falls below the rounding error of ordinary double precision arithmetic. It treats the inverse problem as a search for the starting azimuth, uses Newton’s method with an exact formula for how fast the longitude changes as the azimuth turns, and supplies a good first guess for the nearly antipodal case from the shape of an astroid. The paper reports no convergence failures, typically two to four Newton steps per problem, and round-off errors below 15 nanometers for its own implementation.
This tool implements that method from the paper. It keeps a bracket around the azimuth and falls back to halving the bracket whenever a Newton step would leave it, so the search always ends.
The result was checked against the published test set of 500,000 geodesics computed with arithmetic carried to many more digits than a computer normally uses. The worst distance error was 15 nanometers, and none of the nearly antipodal cases failed. A deliberately broken copy using Vincenty’s iteration instead failed to converge on 13,673 of the 50,000 nearly antipodal cases in the same file.
What the tool will not tell you
The driving distance between two cities is a different kind of quantity. It depends on which roads exist, which ones a vehicle may use, where the junctions are, which streets are one way and how the route is chosen. Routing services answer it from mapped road data, and the OpenStreetMap wiki lists the kind of detail such engines weigh: the type of road, lanes, junctions, crossings and average speed.
This page has no road network and no routing service, so it gives no road distance. An earlier version of this page printed one anyway, a random number dressed up as a result. A fixed detour factor, say 1.2 times the straight line, would be no better. It would be a guess that is wrong in a different way for every trip, and it would look exactly as authoritative as the honest number beside it.
Flight distance is not this number either. A path flown at cruising height over the same ground is a little longer than the one at sea level, and an aircraft rarely follows the geodesic exactly. The sea level geodesic is a fair basis for comparison, not a record of any real journey.
Where the places come from
Finding Tokyo by name needs a list of places, and this tool carries one: the 1:10m populated places layer from Natural Earth, version 5.1.2, holding 7,342 cities and towns. Its terms put every version of the data in the public domain, with no permission needed. The tool keeps the name, a plain ASCII form of the name, the country, the first level region, the coordinates and a population rank, and loads the list only when you start typing.
Natural Earth says it favours regional importance over raw population when choosing places, so the list includes capitals, major cities and a sampling of small towns in sparse regions. It does not include every town. Paris, Texas is not in it, and the tool says so instead of quietly matching Paris, France. Any place that is missing can still be typed as coordinates, in decimal degrees or in degrees, minutes and seconds with hemisphere letters.
Search ignores accents. Names are decomposed so that a letter and its accent come apart, the accent is dropped, and letters such as the Scandinavian slashed o are spelled out, so typing Sao Paulo or Malmo finds the right city. Duplicates are common, with five Springfields in the list alone, so every suggestion shows its region and country, and the larger place comes first.
Exports follow published formats. The path is written as GeoJSON, whose specification asks for longitude before latitude in WGS 84 and asks that a line crossing the 180 degree meridian be cut in two, which is what happens to a Tokyo to Los Angeles path. The distance table goes out as a spreadsheet file in kilometers, statute miles and nautical miles, using the exact definitions of 1,609.344 and 1,852 meters.
The distance between two cities, then, is less a single fact than a choice of question. Pick the shortest path, pick the ellipsoid, and the answer can be given to a millimeter and reproduced by anyone. Every other number deserves to be labelled with the road, the airway or the assumption that produced it.
Sources
Every source consulted for this guide. Links checked October 21, 2026.
- Algorithms for geodesics Charles F. F. Karney, Journal of Geodesy 87 (2013), via arXiv
- GeographicLib: Geodesics on an ellipsoid of revolution Charles F. F. Karney, GeographicLib documentation
- Geodesics on an ellipsoid Wikipedia
- Great-circle distance Wikipedia
- Haversine formula Wikipedia
- NGA Geomatics - WGS 84 National Geospatial-Intelligence Agency, Office of Geomatics
- NIST Guide to the SI, Appendix B.8: Factors for Units Listed Alphabetically National Institute of Standards and Technology
- Natural Earth Terms of Use Natural Earth
- Populated Places - Free vector and raster map data at 1:10m, 1:50m, and 1:110m scales Natural Earth, 1:10m Cultural Vectors
- Land - Free vector and raster map data at 1:10m, 1:50m, and 1:110m scales Natural Earth, 1:110m Physical Vectors
- Release v5.1.2 of natural-earth-vector Nathaniel Vaughn Kelso and contributors, GitHub
- RFC 7946 - The GeoJSON Format Internet Engineering Task Force
- String.prototype.normalize() MDN Web Docs
- Routing - OpenStreetMap Wiki OpenStreetMap Wiki