Distance Between Two Lat Long Guide: Great-Circle Distance, Worked Out

Ask how far apart two cities are, and the answer depends on what kind of distance you mean. A road distance follows highways, with bends, borders, and detours. A straight-line distance on a flat map ignores the Earth's curvature, and over long distances that error grows large enough to matter. The great-circle distance is the third kind, and the one this guide covers: the shortest path between two points on the surface of a sphere, following the arc of the great circle that passes through both points. It is the distance an aircraft approximately flies, the distance that matters for radio range and time zones, and the distance a coordinate calculator reports. It is not a driving distance, and confusing the two is the most common error in reading a result.

The Distance Between Two Lat Long tool lets you enter two latitude and longitude pairs and get the great-circle distance between them. Latitude measures how far north or south of the equator a point is, from -90 at the South Pole through 0 at the equator to 90 at the North Pole, with positive values north and negative values south. Longitude measures how far east or west of the prime meridian a point is, from -180 to 180, with positive values east and negative values west. A pair such as 40.7128, -74.0060 describes New York: about 40.7 degrees north, about 74 degrees west. The signs are part of the coordinates, not decoration: dropping a minus sign moves a point to the opposite hemisphere or the opposite side of the prime meridian, and the distance computed from the wrong point is a distance to somewhere else entirely.

The calculation behind the tool is the haversine formula, which deserves a plain explanation rather than a wall of symbols. The Earth is treated as a sphere with a mean radius of about 6,371 kilometres. Each latitude and longitude is converted from degrees to radians, because the trigonometric functions in the formula work in radians. The differences in latitude and longitude are combined into a quantity called a, which captures how far apart the points are in angular terms, and the central angle between the points is recovered from a. Multiplying that angle by the Earth's radius gives the surface distance. The formula handles the curvature correctly, including the awkward cases: points near the poles, where longitude lines converge, and points on opposite sides of the 180-degree meridian, where a naive subtraction of longitudes would give a huge difference instead of a small one. Those edge cases are exactly where flat-map arithmetic fails and haversine earns its keep.

The spherical assumption is also the result's main limit, and it should be stated plainly. The Earth is not a perfect sphere; it bulges at the equator, so a spherical calculation is an estimate, typically within a fraction of a percent of more elaborate ellipsoidal models. For most purposes, that is more than accurate enough: a journey planned from a great-circle distance does not need centimetre precision. What the result is not, under any model, is a road distance, a shipping time, or a flight time. Roads bend, flights follow air corridors and winds, and both add distance and time that a surface arc cannot capture. Use the great-circle figure for what it is: the shortest surface distance, and the right starting point for range, coverage, and rough travel estimates.

A worked example you can follow

Take two sample points: New York at latitude 40.7128, longitude -74.0060, and London at latitude 51.5074, longitude -0.1278. First, find the differences. The latitude difference is 51.5074 minus 40.7128, which is 10.7946 degrees. The longitude difference is -0.1278 minus -74.0060, which is 73.8782 degrees, because subtracting a negative number adds its magnitude. Convert both differences to radians by multiplying by pi divided by 180, which is about 0.0174533 per degree. The latitude difference in radians is 10.7946 times 0.0174533, or about 0.1884 radians. The longitude difference in radians is 73.8782 times 0.0174533, or about 1.2894 radians. Those conversions are the step most often skipped in hand calculations, and skipping them produces nonsense, because the formula's trigonometry expects radians, not degrees.

Applying the haversine steps to those radian values, with the latitudes themselves also converted, gives a central angle of about 0.8743 radians between the two cities. Multiply by the Earth's mean radius: 0.8743 times 6,371 kilometres equals about 5,570 kilometres. That is the great-circle distance between New York and London, and it matches the well-known figure for that route, which is a useful sanity check: a calculation that returned 500 kilometres or 50,000 kilometres for this pair would be visibly wrong, and the known answer is what reveals the error. In miles, 5,570 kilometres divided by 1.60934 kilometres per mile gives about 3,461 miles, since 5,570 divided by 1.60934 is 3,461 when rounded. Both figures describe the same arc; the unit conversion is the only difference.

Now take a short-distance sample to show the other end of the scale: two points in the same city, the first at 40.7128, -74.0060 and the second at 40.7580, -73.9855. The latitude difference is 40.7580 minus 40.7128, or 0.0452 degrees. The longitude difference is -73.9855 minus -74.0060, or 0.0205 degrees. In radians, those are 0.0452 times 0.0174533, or about 0.000789 radians, and 0.0205 times 0.0174533, or about 0.000358 radians. The haversine calculation gives a central angle of about 0.000834 radians, and multiplying by 6,371 gives about 5.3 kilometres. A flat approximation over such a short distance would give a similar answer, because curvature barely matters at 5 kilometres, but the same formula handles both the 5-kilometre and the 5,570-kilometre case without modification, which is its strength. Always sanity-check a result against a known distance at a similar scale before trusting it for planning.

Mistakes to avoid

The first mistake is dropping a minus sign, which moves a point across the equator or the prime meridian and produces a distance to the wrong place. The second mistake is swapping latitude and longitude, which places a point somewhere it was never meant to be, often in an ocean. The third mistake is reading a great-circle distance as a road distance, and then being surprised when a journey is longer. The fourth mistake is entering degrees where radians are expected, or vice versa, when doing the calculation by hand; the tool handles the conversion, but a hand check that forgets it will disagree wildly with the tool, and the disagreement is the checker's error, not the tool's.

The Length Converter tool converts the result between kilometres, miles, and other units, and the Unit Price Comparison Calculator tool shows the same compare-like-for-like discipline in a different domain. For background on coordinates in two formats, see Coordinates in Two Formats: Decimal Degrees and DMS.

Checking the result before you rely on it

Treat a distance result as an estimate to be sanity-checked, not as a surveyed measurement. Confirm the coordinates are in the right order with the right signs, compare the result with a known distance at a similar scale, and convert the units explicitly rather than assuming kilometres or miles. If the distance will drive a decision, such as a delivery range or a coverage radius, add a margin for the spherical approximation and for the difference between surface distance and travelled distance. A distance that is entered correctly, sanity-checked, and unit-confirmed is a figure you can plan from; a distance copied without those checks is a number that merely looks precise.