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