InfyCalculator
🔬

Great-Circle Distance Calculator

Compute the shortest distance between two latitude/longitude points on Earth with the haversine formula — in nm, km and miles.

Latitude 1
Longitude 1
Latitude 2
Longitude 2
Loading calculator…

How it works

a = sin²(Δφ/2) + cos φ₁·cos φ₂·sin²(Δλ/2) · c = 2·atan2(√a, √(1−a)) · distance = R·c (R = 6371 km)

The shortest path between two points on a sphere follows a great circle — the circle whose plane passes through the Earth’s centre. The haversine formula computes the central angle between the points from their latitudes and longitudes in a way that stays numerically stable even for nearby points, then multiplies by the Earth’s mean radius to get distance. The initial bearing is the compass heading at the start; on a long great-circle route the required heading changes continuously along the way.

Worked example

From JFK (40.6413, −73.7781) to LAX (33.9416, −118.4085): the haversine central angle works out to about 0.625 rad, so distance = 6371 × 0.625 ≈ 3,983 km, which is roughly 2,151 nm or 2,475 miles, on an initial bearing near 274°.

Sources: Haversine formula — Wikipedia

Frequently asked questions

Why not just use straight-line distance?

Latitude and longitude are angles on a sphere, not flat coordinates, so subtracting them and using Pythagoras overstates or understates real distance — badly at high latitudes. The haversine formula measures along the curved surface, which is the distance an aircraft or ship actually travels.

Does it account for Earth being non-spherical?

No. It treats Earth as a sphere of mean radius 6,371 km, which is accurate to about 0.5%. For survey-grade results the Vincenty formula on the WGS-84 ellipsoid is used instead, but haversine is more than good enough for navigation planning.

Why does the bearing change along the route?

A great-circle path is the shortest route but crosses meridians at varying angles, so the heading that keeps you on it changes continuously. The single figure here is the initial bearing at the first point; navigation systems recompute it as you go.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.