Latitude Longitude Distance Calculator

Latitude Longitude Distance Calculator

Growing AI Skill PRO

Enter Calculation

Results

Great-Circle Distance
5,570.22
kilometers
Miles 3,461.17 mi
Nautical miles 3,007.68 nmi
Method Haversine (R = 6371 km)

Formula

d=2Rarcsin⁡sin2Δφ2+cos⁡φ1cos⁡φ2sin2Δλ2where{R=6371kmφ1=Lat 1·π180,φ2=Lat 2·π180Δφ=(Lat 2−Lat 1)·π180Δλ=(Lon 2−Lon 1)·π180\begin{gathered} d = 2R\,\arcsin\!\sqrt{\sin^{2}\!\frac{\Delta\varphi}{2} + \cos\varphi_1\,\cos\varphi_2\,\sin^{2}\!\frac{\Delta\lambda}{2}} \\[1.5em] \text{where}\quad \left\{ \begin{aligned} R &= 6371\ \text{km} \\ \varphi_1 &= \text{Lat 1}\cdot\tfrac{\pi}{180}, \quad \varphi_2 = \text{Lat 2}\cdot\tfrac{\pi}{180} \\ \Delta\varphi &= \left(\text{Lat 2} - \text{Lat 1}\right)\cdot\tfrac{\pi}{180} \\ \Delta\lambda &= \left(\text{Lon 2} - \text{Lon 1}\right)\cdot\tfrac{\pi}{180} \end{aligned} \right. \end{gathered}
Usage stats

Advertisement

Report an error on this page

What this calculator does

The Latitude Longitude Distance Calculator finds the shortest distance over the Earth's surface between two points given by their geographic coordinates. This "great-circle" distance is computed with the Haversine formula, which treats the Earth as a sphere of radius 6,371 km. It is the standard tool for measuring how far apart two GPS locations are, ignoring roads or terrain.

Great-circle arc between two points on a globe versus the straight chord
The Haversine distance is the great-circle arc along the sphere's surface, not the straight-line chord.

How to use it

Enter the latitude and longitude of your first point, then the latitude and longitude of your second point. Use decimal degrees: positive values for North latitude and East longitude, negative values for South and West. The calculator returns the distance in kilometers, statute miles, and nautical miles.

The formula explained

Let \(\varphi_1\), \(\varphi_2\) be the two latitudes and \(\lambda_1\), \(\lambda_2\) the two longitudes, all in radians. With \(\Delta\varphi = \varphi_2 - \varphi_1\) and \(\Delta\lambda = \lambda_2 - \lambda_1\), the Haversine formula is:

$$a = \sin^{2}\!\frac{\Delta\varphi}{2} + \cos\varphi_1\cdot\cos\varphi_2\cdot\sin^{2}\!\frac{\Delta\lambda}{2}$$, then $$d = 2R\cdot\arcsin\!\left(\sqrt{a}\right)$$, with \(R = 6371\ \text{km}\). The Haversine form is numerically stable even for very small distances.

Advertisement
Globe with latitude and longitude angles for two points showing delta phi and delta lambda
The formula uses each point's latitude (\(\varphi\)) and the differences in latitude (\(\Delta\varphi\)) and longitude (\(\Delta\lambda\)).

Worked example

From New York City (40.7128°, −74.0060°) to London (51.5074°, −0.1278°): converting to radians and applying the formula gives \(a \approx 0.1390\), \(c \approx 0.7674\), so $$d \approx 6371 \times 0.7674 \approx 5{,}570\ \text{km}$$ which is about 3,461 miles or 3,008 nautical miles — matching the well-known NYC–London air distance.

Constants and Conversion Factors Used

Quantity Value
Mean Earth radius (R) used in the haversine formula 6,371 km = 3,958.8 mi = 3,440.1 nmi
Equatorial radius (WGS-84) 6,378.137 km
Polar radius (WGS-84) 6,356.752 km
Kilometres to miles 1 km = 0.621371 mi
Kilometres to nautical miles 1 km = 0.539957 nmi
Nautical mile 1 nmi = 1.852 km (exact, by international definition)
Degrees to radians multiply by \(\pi/180 \approx 0.0174533\)

The calculator converts each latitude and longitude to radians with \(\varphi = \text{degrees}\times\pi/180\). It then computes the central angle between the two points and multiplies by R to get kilometres. Miles and nautical miles follow from the factors above.

Advertisement

Key Terms: Latitude, Longitude and Great Circle

Latitude
The angle north or south of the equator, measured from −90° (South Pole) to +90° (North Pole). The equator is 0°.
Longitude
The angle east or west of the prime meridian (0°, through Greenwich, England), from −180° to +180°. East is positive and west is negative.
Decimal degrees
A way of writing coordinates as a single decimal number (e.g. 48.8566) rather than degrees, minutes and seconds. To convert, use degrees + minutes/60 + seconds/3600, and make south and west values negative.
Great circle
A circle on a sphere whose centre is the sphere's centre. The shortest path between two points on the surface lies along an arc of a great circle.
Haversine
The function \(\text{hav}(\theta)=\sin^2(\theta/2)\). The haversine formula uses it to compute great-circle distance. It stays numerically stable for short distances.
Nautical mile
A unit used in aviation and marine navigation, defined as exactly 1,852 m. It is roughly one minute of latitude of arc.
Geodesic vs. spherical distance
The haversine formula treats the Earth as a perfect sphere, which can differ from the true shortest path on the WGS-84 ellipsoid (a geodesic) by up to roughly 0.3–0.5%. Methods such as Vincenty's or Karney's give ellipsoidal geodesic distances when higher precision is needed.

FAQ

Is this driving distance? No. It is the straight-line distance across the globe's surface, like an aircraft's path, not a road route.

How accurate is it? Because the Earth is slightly ellipsoidal, the spherical Haversine result can differ from true geodesic distance by up to about 0.3%. For most purposes this is negligible.

What coordinate format should I use? Decimal degrees. Convert degrees-minutes-seconds first (e.g. 40°42′46″N ≈ 40.7128°).

Last updated:

Most popular in Personal Finance

View all Personal Finance calculators