How to use the distance calculator
- Choose what you are measuring: 2D points on a flat grid, 3D points in space, or places on Earth given by latitude and longitude.
- For points, enter the coordinates of both. For places, pick a city from each list or choose Enter coordinates and type the latitude and longitude in decimal degrees.
- Read the distance at the top, with the working underneath. For places you also get miles, nautical miles and the compass bearing to set off on.
Latitudes run from −90° (South Pole) to 90° (North Pole). Longitudes run from −180° to 180°, with west negative, so New York is about 40.71°, −74.01°.
The distance formulas
The 2D and 3D formulas are the Pythagorean theorem: the differences in each coordinate are the sides of a right triangle (or box), and the distance is the diagonal. On a globe, the shortest route between two places is an arc of a great circle, a circle that shares the Earth's center. The Haversine formula finds the angle between the two places as seen from the center, using φ for latitude and λ for longitude in radians, and multiplies it by the Earth's mean radius.
Worked example
The calculator starts with the 2D points (1, 2) and (7, 10).
- Δx = 7 − 1 = 6 and Δy = 10 − 2 = 8.
- d = √(6² + 8²) = √(36 + 64) = √100 = 10.
In 3D mode the points become (1, 2, 0) and (7, 10, 24), adding Δz = 24: d = √(36 + 64 + 576) = √676 = 26.
For places, the default is New York to London. With New York at 40.7128°N, 74.0060°W and London at 51.5074°N, 0.1278°W, the Haversine formula gives a central angle of about 0.874 radians, and 6,371 km × 0.874 ≈ 5,570 km, or about 3,461 miles. New York to Tokyo comes out at about 10,852 km.
Sample distances between cities
| Route | Kilometers | Miles |
|---|---|---|
| New York to London | 5,570 | 3,461 |
| New York to Tokyo | 10,852 | 6,743 |
| New York to Los Angeles | 3,936 | 2,446 |
| London to Paris | 344 | 213 |
| London to Sydney | 16,994 | 10,560 |
These are great-circle distances between city centers on a spherical Earth. Flights follow similar paths but are a little longer because of air routes, winds and the airports' locations, and road trips are longer still.
How accurate is it?
The Earth is slightly flattened at the poles, so a sphere is a simplification. Great-circle distances on a sphere are typically within about 0.5% of the more exact ellipsoid results that surveyors use. That is close enough for travel planning, fuel estimates and geography homework, but not for property boundaries or navigation charts. For plane coordinates, the 2D and 3D answers are exact apart from rounding.
Frequently asked questions
Why is the flight path on a map curved?
Flat maps stretch the globe, so the shortest route, a great circle, looks curved on them. A flight from New York to Tokyo heads north over Canada and Alaska, which looks like a detour on a flat map but is the shortest way around the ball.
What is the initial bearing?
It is the compass direction you would set off in from the first place to follow the great circle, measured clockwise from north. On a great circle the bearing changes along the way, except when you travel due north, due south or along the equator.
How do I convert degrees, minutes and seconds to decimal degrees?
Divide the minutes by 60 and the seconds by 3,600 and add them to the degrees. 40° 42′ 46″ N is 40 + 42/60 + 46/3600 ≈ 40.7128°. Make the value negative for south latitudes and west longitudes.
What is a nautical mile?
A nautical mile is exactly 1,852 meters, close to one minute of latitude. Ships and aircraft use it because distances in nautical miles line up with the degrees and minutes on a chart. One nautical mile is about 1.15 ordinary miles.
Related calculators
- Slope Calculator — Slope of a line from two points, or its equation from a point and a slope, with intercepts, angle and distance.
- Pythagorean Theorem Calculator — Find the hypotenuse or a missing leg of a right triangle with a² + b² = c², shown step by step.
- Speed Calculator — Speed from distance and time, distance from speed and time, or time from distance and speed, in any unit.
- Unit Conversion Calculator — Convert length, weight, temperature, area, volume, speed, time, data, pressure, energy, power and fuel economy.
Results are calculated in your browser. Double-check anything important before you rely on it. See our disclaimer.