Haversine Distance Calculator
Instantly convert haversine distance with our free converter. See conversion tables, formulas, and step-by-step explanations.
Reviewed for accuracy by Manoj Kumar, Mathematics Educator
Haversine Distance Calculator
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser โ no data is sent to any server.
Formula: d = 2R x arcsin(sqrt(sin2(dLat/2) + cos(lat1) x cos(lat2) x sin2(dLon/2)))
Worked example โ 5,570.25 km (3,461.02 miles, 3,007.69 nautical miles)
Formula
d = 2R x arcsin(sqrt(sin2(dLat/2) + cos(lat1) x cos(lat2) x sin2(dLon/2)))
The Haversine formula finds the central angle between two points using their latitude and longitude differences, then multiplies by Earth's radius to get the arc length. The haversine function (sin squared of half angle) provides numerical stability for both small and large distances.
Worked Examples
Example 1: New York to London
Problem:Calculate the distance from New York (40.7128 N, 74.006 W) to London (51.5074 N, 0.1278 W).
Solution:dLat = 10.7946 deg, dLon = 73.8782 deg a = sin2(5.3973) + cos(40.71) x cos(51.51) x sin2(36.94) a = 0.00887 + 0.7608 x 0.6241 x 0.3609 = 0.1803 c = 2 x atan2(0.4246, 0.9054) = 0.8866 rad d = 6371 x 0.8866 = 5,648 km
Result:5,570.25 km (3,461.02 miles, 3,007.69 nautical miles)
Example 2: Short Distance
Problem:Calculate distance from Times Square (40.7580, -73.9855) to Central Park (40.7829, -73.9654).
Solution:dLat = 0.0249 deg, dLon = 0.0201 deg Very short distance, Haversine still accurate d = approximately 3.14 km
Result:Approximately 3.14 km (1.95 miles)
Frequently Asked Questions
What is the Haversine formula?
The Haversine formula calculates the great-circle distance between two points on a sphere given their latitude and longitude. It uses the haversine function (half of the versine), which is hav(theta) = sin2(theta/2). The formula accounts for the curvature of the Earth by working with angular distances. It is more numerically stable than the simpler spherical law of cosines for short distances, making it the preferred method for geographic distance calculations in navigation and mapping applications.
How accurate is the Haversine distance calculation?
The Haversine formula assumes a perfectly spherical Earth with a mean radius of 6,371 km. Since Earth is actually an oblate spheroid (slightly flattened at the poles), the Haversine formula can have errors up to about 0.3% compared to the more accurate Vincenty formula which uses the WGS84 ellipsoid. For most practical purposes including flight planning, shipping routes, and general navigation, the Haversine distance is sufficiently accurate. For surveying or precision mapping, the Vincenty method is preferred.
What is a great-circle distance?
A great-circle distance is the shortest distance between two points on the surface of a sphere, measured along the surface. It follows the path of a great circle, which is the intersection of the sphere with a plane that passes through the center of the sphere. On Earth, this is the shortest flight path between two cities. Great-circle routes can appear curved on flat Mercator projection maps even though they represent straight paths on the globe, which is why transatlantic flights often pass over Greenland or Iceland.
What is the initial bearing and why does it change along a great circle?
The initial bearing (also called forward azimuth) is the compass direction you face at the starting point when heading toward the destination along the great-circle path. Unlike a rhumb line (constant bearing), the bearing along a great circle changes continuously because you are following a curved path on a sphere. For example, a flight from New York to London starts heading northeast but gradually shifts to east and then southeast. The initial bearing is calculated using the atan2 function applied to the coordinates of both points.
References
Reviewed for accuracy by Manoj Kumar, Mathematics Educator ยท Editorial policy
Related Calculators
๐งฎDistance Between Coordinates Calculator
Calculate distance between coordinates with inputs, formulas, and instant results.
๐งฎDistance on MAP Calculator
Calculate distance on map with inputs, formulas, and instant results.
๐งฎGreat Circle Distance Calculator
Calculate great circle distance with inputs, formulas, and instant results.
๐งฎMAP Scale to Distance Calculator
Calculate map scale to distance with inputs, formulas, and instant results.
๐งฎStep Length to Distance Converter
Calculate step length to distance converter with inputs, formulas, and instant results.
๐งฎFeet to Meters Converter
Convert between feet, meters, yards, and miles for distance and height.
๐งฎMiles to Kilometers Converter
Convert distance between miles, kilometers, nautical miles, and meters.
๐งฎAstronomical Unit Calculator
Calculate astronomical unit with inputs, formulas, and instant results.