Skip to content

Latitude/Longitude Distance Calculator

Distance between two GPS points on the WGS 84 ellipsoid and by haversine, with bearing and midpoint.

Your details

Unit system

Decimal degrees (48.8566, 2.3522) or degrees-minutes-seconds (48°51′24″N 2°21′08″E). South and west are negative.

Results update as you type

Distance (WGS 84 ellipsoid)

213.704 mi

Great-circle distance (haversine)
213.476 mi
Sphere minus ellipsoid
-1,202.7 ft
Initial bearing
329.95° (NW)
Final bearing (on arrival)
328.05° (NW)
Midpoint (great circle)
50.188595, 1.146618
Point A in decimal degrees
48.856600, 2.352200
Point B in decimal degrees
51.507400, -0.127800

Step-by-step solution
  1. φ₁ = 48.8566°, λ₁ = 2.3522°, φ₂ = 51.5074°, λ₂ = -0.1278°
  2. h = sin²(Δφ/2) + cos φ₁ · cos φ₂ · sin²(Δλ/2)
  3. d = 2R · asin(√h), R = 6,371.0088 km → 343.557 km
  4. Vincenty (WGS 84: a = 6 378 137 m, 1/f = 298.257223563) → 343.923 km

How far is it from one GPS point to another as the crow flies? This calculator takes two pairs of coordinates and returns the shortest distance over the Earth's surface, the initial bearing to follow, the bearing on arrival and the midpoint of the route.

It gives two answers on purpose. The headline value uses Vincenty's method on the WGS 84 ellipsoid, the same Earth model as GPS, accurate to well under a millimetre. The second uses the haversine formula on a sphere of mean radius 6,371.0088 km, the simple formula found in most code snippets. The difference between the two (up to about 0.5%) shows how much the Earth's flattening matters for your route.

Coordinates can be typed in decimal degrees (48.8566, 2.3522) or in degrees, minutes and seconds with hemisphere letters (48°51′24″N 2°21′08″E). Distances can be shown in kilometres, miles, nautical miles or metres. To change the notation of a coordinate itself, use the coordinate converter.

How to use this calculator

  1. Enter point A as "latitude, longitude": north and east are positive, south and west negative (or use N/S/E/W letters).
  2. Enter point B the same way.
  3. Read the distance on the WGS 84 ellipsoid; switch the unit to miles or nautical miles if needed.
  4. Compare with the haversine distance and the difference between them.
  5. Use the initial bearing (degrees clockwise from true north) to set off, and the midpoint for a halfway meeting place.

The formula

Haversine (sphere of radius R=6 371.0088R = 6\,371.0088 km, the IUGG mean radius), with latitudes φ\varphi and longitudes λ\lambda in radians:

h=sin⁡2Δφ2+cos⁡φ1cos⁡φ2sin⁡2Δλ2d=2R arcsin⁡hh = \sin^2\frac{\Delta\varphi}{2} + \cos\varphi_1 \cos\varphi_2 \sin^2\frac{\Delta\lambda}{2} \qquad d = 2R\,\arcsin\sqrt{h}

Initial bearing on the sphere:

θ=atan2⁡(sin⁡Δλcos⁡φ2,  cos⁡φ1sin⁡φ2−sin⁡φ1cos⁡φ2cos⁡Δλ)\theta = \operatorname{atan2}\left(\sin\Delta\lambda \cos\varphi_2,\; \cos\varphi_1 \sin\varphi_2 - \sin\varphi_1 \cos\varphi_2 \cos\Delta\lambda\right)

Vincenty's inverse method works on the ellipsoid (a=6 378 137a = 6\,378\,137 m, f=1/298.257223563f = 1/298.257223563). It maps each latitude to a reduced latitude tan⁡U=(1−f)tan⁡φ\tan U = (1-f)\tan\varphi, then iterates on the longitude difference λ\lambda on an auxiliary sphere until it changes by less than 10−1210^{-12} rad, and finally computes the geodesic length s=bA(σ−Δσ)s = bA(\sigma - \Delta\sigma) from series coefficients AA and BB. The bearings shown come from the same solution.

Worked example

Paris (48.8566, 2.3522) to London (51.5074, −0.1278)

  • Haversine: d=343.56d = 343.56 km
  • WGS 84 ellipsoid: 343.92 km
  • Initial bearing 330.0°, roughly north-west; midpoint 50.1885, 1.1466, out in the English Channel, about 30 km off the coast of Picardy.

Paris to New York (40.7128, −74.0060): haversine 5,837.2 km, ellipsoid 5,852.9 km. Over this long route the sphere underestimates by 15.7 km, and you leave Paris heading 291.8°, well north of due west, because the shortest path curves towards the pole.

Sphere or ellipsoid: which distance should I use?

The Earth is about 21 km wider at the equator than from pole to pole. A sphere ignores this, so the haversine result can be off by up to roughly 0.5%, depending on direction and latitude: routes running north-south in mid-latitudes tend to show the largest gaps.

Use Recommended
Quick estimates, games, sorting by proximity Haversine is fine
Surveying, aviation and marine planning, legal boundaries Ellipsoid (WGS 84)
Matching GPS devices and mapping software Ellipsoid (WGS 84)

Both are "as the crow flies". Road distance is longer, often by 20 to 40%.

Bearings, midpoint and antipodes

On a great circle the compass heading changes along the way: the initial bearing is only valid at the start, which is why the final bearing is shown too. A route that keeps a constant heading (a rhumb line) is longer except along a meridian or the equator.

Vincenty's iteration can fail for nearly antipodal points, on almost opposite sides of the globe. Karney's 2013 algorithm solves those cases; here the calculator falls back to the haversine value and says so, which is accurate to within about 0.5% at that scale.

Frequently asked questions

How do I calculate the distance between two latitude and longitude points?

Convert the coordinates to radians and apply the haversine formula, d = 2R·asin(√h), with R = 6,371 km. For GPS-grade accuracy use an ellipsoidal method such as Vincenty’s on WGS 84, which this calculator does automatically.

Which Earth radius does the haversine formula use?

This calculator uses the IUGG mean radius, 6,371.0088 km. Some sources use 6,371 km or 6,378 km (the equatorial radius); the result scales in proportion to the radius chosen.

How accurate is the haversine formula?

Because the Earth is flattened, a spherical formula can be wrong by up to about 0.5% (roughly 5 m per kilometre). The difference row shows the exact gap for your two points.

Can I enter coordinates in degrees, minutes and seconds?

Yes. Type for example 48°51′24″N 2°21′08″E, or 48 51 24 N, 2 21 8 E. Decimal degrees with a minus sign for south and west work too.

What is the initial bearing?

It is the direction to set off in, measured clockwise from true north (0° = north, 90° = east). It is not a constant heading: following the shortest path, the bearing slowly changes until you reach the final bearing.

Sources

Last updated:

More Other calculators

People also use