Latitude Longitude Distance Calculator

Calculate distance between two latitude and longitude coordinates with the Haversine formula.

Everyday Haversine Great-circle
Rate this calculator · 4.0 (2)

Distance between two coordinates

Haversine great-circle · km, miles, nautical miles · bearing

Instructions — Latitude Longitude Distance Calculator

1

Enter decimal coordinates

Type latitude and longitude for both points in decimal degrees. Latitude runs from -90 (South Pole) to +90 (North Pole). Longitude runs from -180 to +180, with negative values west of the Prime Meridian. New York City is 40.7128, -74.0060; London is 51.5074, -0.1278.

2

Or pick an example route

Six famous city pairs come preloaded: NYC to London, LA to Tokyo, Sydney to London, Paris to Rome, Cairo to Cape Town, San Francisco to New York. Selecting any preset fills both coordinate sets so you can verify the answer against well-known great-circle distances.

3

Read distance and bearing

The result shows distance in kilometres, statute miles and nautical miles, plus the initial bearing in degrees and a 16-point compass direction. Bearing is the compass heading from Point A to Point B at the start of the journey — it changes along a great-circle path, which is why long-haul flight paths curve on flat maps.

Negative signs matter. 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. Google Maps and GPS apps always include the sign in decimal-degrees format.
Great-circle, not driving. Distance from the calculator is the shortest line through Earth’s surface — "as the crow flies." Road distance is typically 15-30% longer, depending on terrain. Use this for flight times, ship routes and radio-range estimates, not road trips.

Formulas

The calculator uses the Haversine formula — the industry-standard great-circle distance method, treating Earth as a sphere with mean radius 6,371 km. NOAA and the U.S. Geological Survey publish the same formula in their geodesy references.

Haversine great-circle distance
$$ d = 2R \arcsin\left(\sqrt{\sin^2\left(\tfrac{\Delta\varphi}{2}\right) + \cos\varphi_1 \cos\varphi_2 \sin^2\left(\tfrac{\Delta\lambda}{2}\right)}\right) $$
R = 6,371 km (Earth mean radius), φ = latitude in radians, λ = longitude in radians. The formula is numerically stable for all distances except near-antipodal points.
Initial bearing (azimuth)
$$ \theta = \arctan2\left(\sin\Delta\lambda \cos\varphi_2,\, \cos\varphi_1 \sin\varphi_2 - \sin\varphi_1 \cos\varphi_2 \cos\Delta\lambda\right) $$
Compass direction from Point A to Point B at the start of the journey. Converted from radians to degrees, then normalised to 0-360°. On great-circle routes the bearing changes continuously along the path.
Kilometres to miles
$$ \text{miles} = \text{km} \times 0.621371 $$
Statute miles, the standard US/UK road distance. 100 km = 62.14 miles. 1,000 km = 621.37 miles. 10,000 km = 6,213.71 miles.
Kilometres to nautical miles
$$ \text{nm} = \text{km} \times 0.539957 $$
Nautical miles are used in aviation and maritime navigation. One nautical mile equals one minute of latitude at the equator (about 1,852 m). 1 nm = 1.852 km.
Decimal degrees from DMS
$$ DD = D + \frac{M}{60} + \frac{S}{3600} $$
Convert degrees-minutes-seconds to decimal degrees. 40° 42' 51" N = 40 + 42/60 + 51/3600 = 40.7142°. Apply a negative sign for South or West.
Earth radius variation
$$ R_{eq} = 6{,}378.137, \quad R_{pol} = 6{,}356.752 $$
WGS-84 equatorial and polar radii in kilometres. Earth is an oblate spheroid; the difference is 21.385 km (0.3%). The mean radius used in Haversine is 6,371 km.

Reference

Famous great-circle distances
RouteKilometresMilesNautical miBearing from A
New York to London5,5703,4613,00751° (NE)
Los Angeles to Tokyo8,8155,4784,760302° (WNW)
Sydney to London16,98310,5539,170310° (NW)
Paris to Rome1,105687597137° (SE)
Cairo to Cape Town7,2514,5053,915197° (SSW)
San Francisco to New York4,1402,5722,23570° (ENE)
Equator antipodes20,03712,45110,819any

How accurate is the Haversine formula

Haversine assumes a spherical Earth. Real Earth is an oblate spheroid, so there is a small error that grows with distance. For most practical uses the error is under 0.3%.

Haversine error budget
DistanceTypical errorUse case
1 km~3 mGPS waypoints
10 km~30 mCity-scale
100 km~300 mRegional
1,000 km~3 kmDomestic flights
10,000 km~30 kmIntercontinental
Compass bearing key
Degrees16-pointCardinal
0° or 360°NNorth
45°NENortheast
90°EEast
135°SESoutheast
180°SSouth
225°SWSouthwest
270°WWest
315°NWNorthwest

For surveying-grade accuracy (under one metre at any distance), the Vincenty inverse formula on the WGS-84 ellipsoid is the standard. NOAA, the FCC and most national mapping agencies publish coordinates and bearings using WGS-84. Haversine on a sphere is good enough for navigation, flight planning, geofencing and most engineering work.

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.

Great-circle distance examples
NYC → London 5,570 km
LA → Tokyo 8,815 km
Sydney → London 16,983 km

Great-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.

Did you know

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°.

Sign convention

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.

NYC → London
51°
northeast
LA → Tokyo
302°
WNW
Cairo → Cape Town
197°
SSW

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.

Use Vincenty for surveying

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.

FAQ

Use the Haversine formula, the standard great-circle distance method. It treats Earth as a sphere with radius 6,371 km, then computes the shortest arc between the two points along the surface. The result is in kilometres; multiply by 0.621371 for miles or 0.539957 for nautical miles. The formula is accurate to within 0.3% for any practical distance.
The Haversine formula computes great-circle distance d between two coordinates using d = 2R · arcsin(√a), where a = sin²(Δφ/2) + cosφ₁ · cosφ₂ · sin²(Δλ/2). R is Earth’s radius (6,371 km), φ is latitude in radians, λ is longitude in radians, and Δ means the difference between the two points. It was named by James Inman in 1835 from a 19th-century shipping navigation table.
About 5,570 km (3,461 miles, 3,007 nautical miles) by great-circle distance. The initial bearing from NYC is 51° — roughly northeast. Commercial flights cover this in 6-8 hours depending on jet stream conditions. The actual flight path curves north over Newfoundland and southern Iceland, which appears longer on a flat map but is the shortest path on a sphere.
Great-circle distance is the straight-line path through Earth’s surface — "as the crow flies." Driving distance follows roads, which curve around terrain, lakes and city blocks. Driving distance is typically 15-30% longer than great-circle, more in mountainous regions. Use great-circle for flight times and ship routes; use a routing service for car trips.
Decimal degrees (DD) is the modern GPS format: 40.7128° N. Degrees-minutes-seconds (DMS) is the older nautical format: 40° 42' 51" N. To convert DMS to DD: degrees + minutes/60 + seconds/3600. For example, 40° 42' 51" = 40 + 0.7 + 0.0142 = 40.7142°. Apply a negative sign for South or West.
1,852 metres — equivalent to one minute of latitude at the equator. Aviation and maritime navigation use nautical miles because they map directly to coordinate grids on charts. 1 nautical mile = 1.151 statute miles = 1.852 km. A nautical chart with 1° latitude spacing covers 60 nautical miles vertically.
Simplicity and accuracy trade-off. Earth is actually an oblate spheroid — flatter at the poles by 21 km out of 6,378 — but assuming a sphere introduces only 0.3% error, well under one kilometre per 300 km of distance. For surveying-grade accuracy, the Vincenty inverse formula on the WGS-84 ellipsoid achieves sub-millimetre precision at the cost of iterative computation.
20,037 km (12,451 miles) — half the Earth’s equatorial circumference. Any two antipodal points (on exactly opposite sides of Earth) are this far apart. Examples: Wellington (New Zealand) and Madrid (Spain) are nearly antipodal. The Haversine formula can compute this correctly; the Vincenty formula fails for antipodal points and needs the Haversine as a fallback.