a = sin²(Δφ/2) + cos φ₁ · cos φ₂ · sin²(Δλ/2)
d = 2R · atan2(√a, √(1−a)) R = 6,371 km
How the Haversine formula works
The Haversine formula calculates the shortest distance between two points on the surface of a sphere (the great-circle distance), making it ideal for measuring distances on Earth. It accounts for the curvature of the Earth rather than drawing a straight line on a flat map.
Worked example: London to Paris
From London (51.5074°N, 0.1278°W) to Paris (48.8566°N, 2.3522°E) the great-circle distance is approximately 343.6 km (213.5 mi, 185.5 nmi), with an initial bearing of approximately 148° (SSE). This is the straight-line distance — the actual driving distance is longer, about 470 km, because roads follow terrain and route through Calais and the Channel Tunnel.
Units and conversions
1 kilometer = 0.621371 miles. 1 mile = 1.60934 kilometers. 1 nautical mile = 1.852 kilometers = 1.15078 miles.
Limitations
Calculates straight-line distance, not driving or walking routes; assumes a spherical Earth, so actual distance may vary slightly due to the Earth’s ellipsoidal shape; travel times are estimates based on average speeds (60 km/h driving, 5 km/h walking, 15 km/h cycling); does not account for terrain, traffic, borders or water crossings.
Frequently asked questions
How do I find the distance between two GPS coordinates?
+
Enter both coordinate pairs above and press Calculate & fly. The tool applies the Haversine formula and returns the distance in km, miles and nautical miles, plus the initial bearing, and flies the map between the two points.
How accurate is the Haversine formula?
+
Within about 0.5% of the true distance, because it assumes a spherical Earth. For most navigation and planning that is more than accurate enough.
What is the distance between New York and Los Angeles?
+
About 3,936 km (2,446 mi) in a straight line between city centres (40.7128, −74.0060 and 34.0522, −118.2437).
What is a bearing?
+
The compass direction from the first point to the second, measured clockwise from true north (0° = north, 90° = east).