Distance Calculator
Three different questions get called "distance", so pick the one you mean. The great-circle mode measures across the curved surface of the Earth between two latitude/longitude points — the "how far is New York from London" question — using the haversine formula and a mean Earth radius of 6371.0088 km, reported in kilometres, miles and nautical miles with the initial bearing. The 3D mode is the ordinary straight line √(Δx² + Δy² + Δz²) between two Cartesian points, which collapses to the familiar 2D distance when both z values match. The Manhattan mode is the taxicab metric |Δx| + |Δy| + |Δz|, the shortest path when you may only travel along the axes. If what you actually want is the geometry of the line through two points — slope, y-intercept, the equation — the slope calculator is the page for that, and it reports the 2D distance too.
- Accurate
- Real-time
- Easy to use
- 100% free
Great-circle distance
5,570.23 km
Distance in nautical miles
3,007.68 nmi
Details
Updates as you typeGreat-circle measures across the curved surface of the Earth between two lat/long points. The other two measure between two Cartesian points — straight through, or along the axes.
Between −90 (South Pole) and 90 (North Pole). Southern latitudes are negative. The default is New York City.
Between −180 and 180. Western longitudes are negative.
Between −90 and 90. The default is London.
Between −180 and 180. Going from 179 to −179 is a two-degree hop across the antimeridian, and is measured as one.
Used by the two Cartesian modes. Negative coordinates are fine.
Vertical coordinate of the first Cartesian point.
Depth coordinate of the first point. Set both z values equal for a plain 2D problem.
Horizontal coordinate of the second Cartesian point.
Vertical coordinate of the second Cartesian point.
Depth coordinate of the second point. The defaults differ by 3, 4 and 12 — a Pythagorean quadruple whose distance is exactly 13.
Summary
Distance
5,570.23 km
- Distance in miles
- 3,461.18 mi
- Distance in nautical miles
- 3,007.68 nmi
- Central angle
- 50.0942 °
- Initial bearing from A
- 51.2126 °
- Final bearing at B
- 108.3297 °
- Straight chord through the Earth
- 5,394.502 km
- Great-circle distances here model the Earth as a sphere of mean radius 6371.0088 km. The Earth is an oblate spheroid, so this is an approximation: compared with a geodesic on the WGS 84 ellipsoid (the model GPS uses), a haversine distance is typically within about 0.3% and worst-case around 0.5%. On the 5,570 km between New York and London that is a band of roughly ±20 km. Treat the answer as good to three or four significant figures, not to the metre.
- Longitude wraps: 179° and −179° are two degrees apart, so a hop across the antimeridian near Fiji is a short flight, not a trip most of the way round the planet. The longitude difference is folded into (−180, 180] before use, and the shorter of the two ways round is always the one reported.
- The initial bearing is the heading you leave on, not one you hold. A great circle continuously changes its true heading — that is why the final bearing at B is a different number — and it is also why great-circle routes look curved on a Mercator map.
- This is a surface distance between two points on the globe. For the geometry of a line through two points on a graph — slope, y-intercept, the equation, the angle — use the slope calculator, which also reports the plain 2D distance between them.
How this is calculated
- Point A (latitude, longitude)
- (40.7128°, -74.006°)
- Point B (latitude, longitude)
- (51.5074°, -0.1278°)
- Δφ = lat₂ − lat₁
- 10.7946 °
- Δλ = lon₂ − lon₁, wrapped into (−180, 180]
- 73.8782 °
- a = sin²(Δφ/2) + cos φ₁ · cos φ₂ · sin²(Δλ/2)
- 0.1792364335
- c = 2 · atan2(√a, √(1−a))
- 50.0942 °
- d = R · c, with R = 6371.0088 km
- 5,570.230 km
- d ÷ 1.609344
- 3,461.180 mi
- d ÷ 1.852
- 3,007.684 nmi
- Cross-check by the spherical law of cosines
- 5,570.230 km
- Straight chord through the Earth, 2R · sin(c/2)
- 5,394.502 km
Compare scenarios
See how one change moves the result
- CurrentYour inputs as they stand5,570.23 kmCurrent
- Point A latitude° 50.8914,919.97 km
- Point A longitude° -92.5086,738.21 km
- Point B latitude° 64.3845,250.89 km
Frequently asked questions
How do I calculate the distance between two cities from latitude and longitude?
Use the haversine formula: a = sin²(Δφ/2) + cos φ₁ · cos φ₂ · sin²(Δλ/2), then c = 2 · atan2(√a, √(1−a)), then multiply c by the Earth's radius. With the IUGG mean radius of 6371.0088 km, New York (40.7128, −74.0060) to London (51.5074, −0.1278) comes out at 5,570 km, or 3,461 miles — the figure published city-pair tables quote. That is the surface distance between the two points; a flight is longer, because it follows air corridors and rarely flies the perfect great circle.
How accurate is the haversine formula?
It is exact for a sphere and the Earth is not one — it is about 21 km wider through the equator than through the poles. Measured against a true geodesic on the WGS 84 ellipsoid, which is what GPS uses, a haversine distance is typically within about 0.3% and worst-case around 0.5%. On the 5,570 km New York to London that is a band of roughly ±20 km. So trust three or four significant figures and no more. If you need metre-level answers, you want Vincenty's or Karney's ellipsoidal method, not this.
Does it handle the international date line correctly?
Yes. Longitude 179° and longitude −179° are two degrees apart, not 358, and the calculator folds the longitude difference into the range (−180, 180] before using it, so a hop across the antimeridian near Fiji reports a short distance rather than a near-global one. Two points on the equator at 179° and −179° come out at 222.39 km, which is exactly two degrees of arc. Getting this wrong is the classic great-circle bug.
What is the difference between Manhattan distance and straight-line distance?
They are different metrics, not different accuracies. The straight line is √(Δx² + Δy² + Δz²), the shortest path if you may travel in any direction. The Manhattan or taxicab distance is |Δx| + |Δy| + |Δz|, the shortest path if you may only move parallel to the axes — a car on a perfect street grid. Manhattan is never shorter: from (0,0,0) to (1,2,2) the straight line is exactly 3 and the taxicab route is 5. The two are equal only when the points differ along a single axis.
Where is the plain 2D distance between two points?
It falls out of the 3D mode: leave both z coordinates the same and Δz is zero, so √(Δx² + Δy² + Δz²) reduces to √(Δx² + Δy²). There is no separate mode because there is no separate formula. The slope calculator also reports the 2D distance alongside the slope, the y-intercept, the line equation, the midpoint and the angle of inclination, so use that one if you want the whole line rather than just the gap.
What is the initial bearing, and why does it change along the way?
It is the compass heading you set off on, measured clockwise from true north, computed as atan2(sin Δλ · cos φ₂, cos φ₁ · sin φ₂ − sin φ₁ · cos φ₂ · cos Δλ). A great circle is not a constant-heading path, so the heading rotates continuously as you travel: New York to London starts at about 51° and arrives on about 108°. A route flown at a fixed heading instead is a rhumb line, which is longer.
Why does the calculator show a straight chord through the Earth?
Because the great-circle distance is measured over the surface, and it is worth seeing how much of it is the curvature. The chord is the straight line an imaginary tunnel would take, 2R · sin(c/2). New York to London is 5,570 km across the surface but only 5,395 km through the rock — about 175 km shorter. At antipodal points the surface distance is half the circumference, 20,015 km, while the chord is one diameter, 12,742 km.