Enter the coordinates of two points (latitude and longitude in decimal degrees) and the sphere radius. The great-circle distance is calculated instantly using the Haversine formula.

Point A
°
°
Point B
°
°
km
Default: Earth = 6371 km
Great-circle distance
km

Coordinates on a sphere

A point on a sphere is located by two angles:

  • Latitude (φ) — the angle from the equatorial plane, ranging from −90° (South Pole) to +90° (North Pole).
  • Longitude (λ) — the angle measured eastward from the prime meridian, ranging from −180° to +180°.

Coordinates are given in decimal degrees (e.g. Paris: 48.8566°N, 2.3522°E). Negative latitude means South; negative longitude means West.

The sphere radius R can be any positive value. For Earth, the commonly used mean radius is 6371 km.


Haversine formula

Let φ1, λ1 and φ2, λ2 be the latitudes and longitudes of the two points (in radians), and R the sphere radius:

a=(sinφ2φ12)2+cos(φ1)cos(φ2)(sinλ2λ12)2c=2arctan2(a,1a)d=Rc

where d is the great-circle distance. The arctan2 form is preferred over arcsin for better numerical stability.


Frequently Asked Questions

The Haversine formula calculates the great-circle distance between two points on a sphere, given their latitudes and longitudes. It is named after the haversine function: hav(θ) = sin²(θ/2). The formula is particularly suited for navigation because it is numerically stable even for very short or nearly antipodal distances. It assumes the Earth is a perfect sphere; for high-precision geodesy, ellipsoidal models like Vincenty's formula are used.
The great-circle distance is the shortest path between two points measured along the surface of a sphere. A great circle is any circle on the sphere whose plane passes through the center. The equator and all meridians are great circles. Aircraft and ships follow great-circle routes to minimize travel distance — that is why transatlantic flights curve northward over Greenland.
The default radius is 6371 km — the mean radius of Earth as defined by the IUGG. Earth is not a perfect sphere: the equatorial radius is 6378.1 km and the polar radius is 6356.8 km. For everyday navigation, 6371 km gives results accurate to within about 0.5%.
Yes — simply change the sphere radius. Common values: Moon 1737.4 km, Mars 3389.5 km, Venus 6051.8 km, Jupiter 69911 km. The Haversine formula works for any sphere and is unit-independent.


Send your feedback