Haversine Distance Calculator
Measure the great-circle geodesic distance between coordinates, determine bearings, and compute midpoints.
Quick-Select Landmarks
Geographic Coordinates
Point A
Parsed: 40.71280°
Parsed: -74.00600°
Point B
Parsed: 51.50740°
Parsed: -0.12780°
Planetary Preset (Radius)
Geodesic Path Visualization
Distance Outcomes
Kilometers:5570.22 km
Miles:3461.17 mi
Nautical Miles:3007.68 nm
Navigation Coordinates
Compass Bearing:51.2° (NE)
Geographic Midpoint
Lat: 52.36844°, Lon: -41.29031°
DMS Support: Enter raw values like
40° 42' 46" N directly into coordinate fields. The parser handles degree, minute, and second notations automatically.Understanding Haversine Geodesic Math
The Haversine formula measures spherical distances:d = 2R × arcsin(√[sin²(Δφ/2) + cos(φ1)cos(φ2)sin²(Δλ/2)]).
Bearings represent navigation angles between geographic nodes. Midpoints calculate the midpoint on a great-circle path.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Getting the great-circle distance between two coordinate pairs.
- Checking a distance a mapping API returned.
- Calculating a straight-line distance for a service radius.
- Comparing two locations' separation without a routing engine.
- Building a distance filter for a dataset of coordinates.
Frequently Asked Questions
- What does the haversine formula compute?
- Great-circle distance — the shortest path over a sphere's surface, which is what an aircraft flies rather than the straight line through the earth. It uses the half-versed-sine of the central angle, then multiplies by the radius.
- Why haversine rather than the spherical law of cosines?
- Numerical stability at short distances. The law of cosines needs the arc-cosine of a value extremely close to 1 for nearby points, where floating-point precision collapses — errors of kilometres on a metre-scale distance. Haversine stays well-conditioned everywhere.
- Which Earth radius should I use?
- 6,371 km is the mean, and the default. The Earth is an oblate spheroid — 6,378 km at the equator, 6,357 at the poles — so a spherical model carries up to about 0.5% error. For sub-metre accuracy you need Vincenty's formulae on an ellipsoid instead.
- What is the bearing the tool also reports?
- The initial compass heading from the first point to the second. On a great circle it changes continuously — an aircraft flying from London to Tokyo starts heading roughly north and ends heading south — so the initial bearing is not the direction you hold for the whole route.
- Does this account for terrain or roads?
- No. It is the distance a bird flies over a smooth sphere. Road distance is typically 15–40% longer depending on the network, and elevation change adds more, so a haversine figure is a floor rather than an estimate of travel.
Common errors and gotchas
- Reading the result as a travel distance, when it is a straight line over a sphere and ignores roads entirely.
- Swapping latitude and longitude, which is the most common coordinate error there is.
- Passing degrees to a formula expecting radians.
- Assuming a spherical Earth is accurate enough, when Vincenty's formula matters over long distances.
- Using a decimal sign convention inconsistently, so a southern latitude comes out northern.
Related Calculators tools
Percentage Calculator
Solve percentage, increase, and change calculations.
Age Calculator
Calculate exact age in years, months, and days.
Unix Timestamp Converter
Convert Unix epoch timestamps to and from human dates.
Tip Calculator
Calculate tip and split the bill between people.
Aspect Ratio Calculator
Solve width or height for a target aspect ratio.
Temperature Converter
Convert between Celsius, Fahrenheit, and Kelvin.
Data Storage Converter
Convert between bytes, KB, MB, GB, TB, and more.
Discount Calculator
Calculate sale price and savings from a discount.