Haversine Distance Calculator
Great-circle distance on a sphere of radius 6371.0088 km (IUGG mean). Type two WGS-style latitudes and longitudes in degrees. This is not driving directions, not rhumb line, and not a geodesic on the WGS 84 ellipsoid.
Rated 4.7 out of 5 based on 402 reviews
How to compute a great-circle distance
- Enter the first latitude from -90 to 90 and longitude from -180 to 180. The default first point is near New York City.
- Enter the second pair. The default second point is near London.
- Read kilometers, statute miles, and nautical miles. Miles divide km by 1.609344. Nautical miles divide km by 1.852.
- Treat the result as a spherical arc. Roads, airways, and ellipsoid geodesics differ.
Haversine great-circle distance
Spherical distance with IUGG mean radius
| Radius | 6371.0088 km (IUGG mean) |
|---|---|
| Formula | a = sin²(Δφ/2) + cos φ1 cos φ2 sin²(Δλ/2); c = 2 atan2(√a, √(1-a)); d = R c |
| Latitude | -90 to 90 degrees |
| Longitude | -180 to 180 degrees |
| Statute miles | km / 1.609344 |
| Not computed | Driving route, rhumb line, WGS 84 geodesic |
What haversine distance is
The haversine formula gives the central angle between two points on a sphere, then multiplies by a radius. This page uses 6371.0088 km, the IUGG mean radius. The default pair is a New York to London sketch, not an airport official distance. A plane Euclidean chord on x y is the distance between two points page and is the wrong model for long flights.
How this page computes the arc
Latitudes and longitudes convert to radians. Δφ and Δλ are the differences. a = sin²(Δφ/2) + cos φ1 cos φ2 sin²(Δλ/2). c = 2 atan2(√a, √(max(0, 1-a))). Distance km = 6371.0088 × c. Miles and nautical miles are unit conversions of that km figure. Antipodes can sit near a = 1. The clamp on 1-a avoids a negative sqrt from float noise.
Sphere, ellipsoid, and driving
Vincenty and Karney geodesics on WGS 84 differ from this sphere by a small fraction on long oceanic legs and more near poles. A rhumb line holds a constant bearing and is longer than the great circle except on meridians and the equator. Turn-by-turn driving uses a road graph, traffic, and ferries. None of those are this formula.
Use cases
A geography homework arc, a rough city-pair check, or comparing two GPS points you already have. Not an airline ticket, not a nautical chart, and not a hiking ETA.
Limits
Sphere only. No elevation. No magnetic variation. Latitudes outside -90 to 90 fail. Longitudes outside -180 to 180 fail. CZNull does not receive the coordinates.