Haversine Distance Calculator
The Haversine distance calculator finds the shortest path along the surface of a sphere between two geographic coordinates. Enter the latitude and longitude of two points in decimal degrees (negative for south latitude and west longitude) and the calculator applies the Haversine formula to return the great-circle distance in both kilometers and miles. This is the industry-standard method used by GIS software, navigation systems, and mapping APIs for computing surface distances without complex ellipsoidal models.
Point 1
Point 2
Haversine formula
a = sin((lat2-lat1)/2)^2 + cos(lat1)*cos(lat2)*sin((lon2-lon1)/2)^2
c = 2 * atan2(sqrt(a), sqrt(1-a))
d = R * c
Where R = 6,371 km (mean Earth radius), all angles in radians, and atan2 is the two-argument arctangent. The result d is the great-circle distance.
How to use this calculator
- Enter coordinates in decimal degrees. To convert from degrees-minutes-seconds: decimal = degrees + minutes/60 + seconds/3600.
- Latitudes south of the equator are negative. Longitudes west of the prime meridian are negative.
- Valid latitude range: -90 to 90. Valid longitude range: -180 to 180.
- For highest precision over long distances, use an ellipsoidal model such as Vincenty. Haversine error is under 0.3%.
Haversine distance calculator: frequently asked questions
What is the Haversine formula?
The Haversine formula calculates the shortest distance between two points on the surface of a sphere using their latitude and longitude. It accounts for the curvature of the Earth, making it accurate for navigation and mapping applications.
How accurate is the Haversine distance?
The Haversine formula assumes a perfectly spherical Earth (radius 6,371 km). Real Earth is slightly oblate, so errors can reach about 0.3% for very long distances. For most surveying and navigation purposes this accuracy is sufficient.
What is the difference between great-circle distance and straight-line distance?
A straight-line distance passes through the Earth. Great-circle distance follows the surface of the Earth along the shortest arc, which is the actual travel distance between two surface points.
Can I use decimal degrees or degrees/minutes/seconds?
This calculator accepts decimal degrees. Convert DMS to decimal by: degrees + minutes/60 + seconds/3600. Southern latitudes and western longitudes are negative values.
What Earth radius does this calculator use?
The calculator uses the IUGG mean radius of 6,371.0 km (3,958.8 miles), which is the standard value recommended for geodetic calculations where high-precision ellipsoidal models are not required.
Official sources
- USGS: Coordinate distance reference.
- NOAA National Geodetic Survey: NGS geodetic tools and references.
Reviewed by the CalculatorHub team, edited by James Graham, 15 June 2026. See our methodology.