Article — Latitude Longitude Distance Calculator
Latitude longitude distance calculator: Haversine great-circle method
The great-circle distance from New York City (40.7128, -74.0060) to London (51.5074, -0.1278) is about 5,570 km (3,461 miles, 3,007 nautical miles). The latitude longitude distance calculator above uses the Haversine formula on a sphere of mean radius 6,371 km — the standard method published by NOAA and used in aviation, maritime navigation and most online mapping services. Accuracy is within 0.3% of the surveying-grade Vincenty ellipsoid result.
The calculator takes decimal-degree coordinates for two points and returns distance in kilometres, statute miles and nautical miles, plus the initial compass bearing. The Haversine formula assumes Earth is a perfect sphere — close enough for any non-surveying purpose.
What the distance calculator measures
Great-circle distance is the shortest path between two points along Earth’s curved surface. Think of stretching a string between two cities on a globe: the string traces the great circle. On a flat map the string appears curved, but on the sphere itself it is the straight line.
NYC → London 5,570 kmLA → Tokyo 8,815 kmSydney → London 16,983 kmGreat-circle distance is what pilots and ship captains use to plan routes. It is not the same as driving distance — roads detour around mountains, lakes and political borders, typically adding 15-30% to the straight-line figure. For radio range, flight time and geofencing, great-circle is the right number.
The name "haversine" comes from half-versed-sine, an old trigonometric function defined as (1 - cosθ)/2. James Inman, a 19th-century British professor of nautical astronomy, popularised the formula in 1835 for celestial-navigation tables. Sailors used printed haversine tables for over a century to compute great-circle distances by hand. Modern calculators implement the same formula with sin² identities, but the name and the method are unchanged from Inman’s.
The Haversine distance formula
The Haversine formula computes great-circle distance d between two coordinates as:
d = 2R · arcsin(√a), where a = sin²(Δφ/2) + cosφ₁ · cosφ₂ · sin²(Δλ/2).
R is Earth’s mean radius (6,371 km). φ is latitude in radians for each point. λ is longitude in radians. Δφ and Δλ are the differences between the two points. The arcsin form is numerically stable for all distances except the narrow band of antipodal points (where arccos would blow up).
The formula treats Earth as a sphere. Earth is actually an oblate spheroid — flatter at the poles by 21 km out of 6,378 — so the spherical assumption introduces a small error. For all practical navigation the error stays under 0.3%, which is roughly 30 km on a 10,000 km intercontinental route. Surveying-grade work uses the Vincenty inverse formula on the WGS-84 ellipsoid for sub-millimetre accuracy.
Decimal degrees versus DMS coordinates
Coordinates come in two formats. The calculator uses decimal degrees, the modern GPS standard.
Decimal degrees (DD). Example: New York City = 40.7128, -74.0060. Latitude runs from -90 (South Pole) to +90 (North Pole); longitude from -180 to +180 with negative values west of the Prime Meridian. This is what Google Maps, GPS devices and the Geolocation API all return.
Degrees-minutes-seconds (DMS). Example: NYC = 40° 42' 51" N, 74° 0' 22" W. The traditional nautical and aviation format. Convert to decimal degrees with DD = D + M/60 + S/3600, then apply a negative sign for South or West. 40° 42' 51" = 40 + 42/60 + 51/3600 = 40.7142°.
West longitude is negative; East is positive. South latitude is negative; North is positive. Dropping a sign moves the point thousands of kilometres, often to the opposite ocean. Sydney (-33.87, 151.21) becomes the equator near Hawaii if you forget the negative latitude.
Famous great-circle distances
Reference distances between well-known cities, computed with Haversine:
- NYC to London = 5,570 km (3,461 mi)
- LA to Tokyo = 8,815 km (5,478 mi)
- SF to NYC = 4,140 km (2,572 mi)
- Sydney to London = 16,983 km (10,553 mi)
- Paris to Rome = 1,105 km (687 mi)
- Cairo to Cape Town = 7,251 km (4,505 mi)
- antipodal max = 20,037 km
- equator length = 40,075 km
The maximum possible distance between any two points on Earth is 20,037 km — half the equatorial circumference. Points exactly this far apart are antipodal: examples include Wellington and Madrid, or Auckland and Seville (nearly so). Most commercial intercontinental routes top out around 15,000-17,000 km because polar overflight and refuelling logistics restrict practical antipode routing.
Bearing and compass direction
Initial bearing is the compass heading from Point A to Point B at the start of the journey. Bearings run 0-360°, with 0° = north, 90° = east, 180° = south, 270° = west.
The bearing changes continuously along a great-circle path. A flight from New York to Tokyo starts heading roughly northwest (310°), reaches its northernmost point over Alaska heading west (270°), and finishes heading southwest as it approaches Japan (230°). That curve is why long-haul flight tracks look so dramatic on flat-projection maps — the projection distorts the route, not the geography.
Haversine accuracy and limits
The Haversine formula has two known limitations: spherical-Earth error and antipodal numerical issues.
Haversine errors stay under 0.3% but grow with distance — about 30 km on a 10,000 km route. For surveying, land registration or any application requiring sub-metre precision, use the Vincenty inverse formula on the WGS-84 ellipsoid. Vincenty achieves sub-millimetre accuracy but requires iteration and may fail to converge for near-antipodal points (where Haversine handles them fine).
For navigation, flight planning, fleet logistics, geofencing, radio coverage estimation, sports tracking and most engineering work, Haversine on a sphere is the right tool. Reach for Vincenty only when the application is geodetic surveying or when comparing measurements against NOAA-published WGS-84 references requires sub-metre matching.
Latitude longitude distance mistakes
Four errors account for most wrong distances.
Dropping a hemisphere sign. West and South are negative in decimal degrees. Forgetting the minus on -74.0060 moves NYC across the Atlantic.
Mixing DD and DMS without converting. 40.7128 is not the same number as 40° 7' 12.8". Always convert to a single format before computing.
Using flat-Earth distance. Pythagorean distance on raw lat/lon coordinates is wildly wrong over any meaningful distance. A degree of longitude is 111 km at the equator but only 79 km at 45° latitude and 0 km at the poles.
Confusing great-circle with driving distance. The calculator returns straight-line distance through Earth’s surface. Road distance is typically 15-30% longer because roads route around terrain.