What is the Great-Circle Distance & Bearing Calculator?
This universal geodesy tool computes the shortest distance between two points on Earth (the great-circle distance) and the initial azimuth, or compass bearing, from point A toward point B. It models the Earth as a sphere, so it is not specific to any country or region. Enter coordinates as decimal degrees: east longitude and north latitude are positive, while west longitude and south latitude must be entered as negative values.
How to use it
Type the longitude and latitude of point A and point B in decimal degrees. Set the Earth radius \(r\) in kilometers. The default 6378.137 km is the WGS-84 equatorial radius; many references instead use the mean radius 6371.0 km, which you can enter for the conventional value. Press calculate to see the distance in kilometers, the azimuth in degrees clockwise from true north, and the matching 16-point compass label.
The formula explained
Convert all coordinates to radians. Let \(\Delta\lambda\) be the longitude difference. The central angle is $$\Delta\sigma = \arccos\left(\sin\varphi_1 \sin\varphi_2 + \cos\varphi_1 \cos\varphi_2 \cos\Delta\lambda\right),$$ and the distance is \(r\cdot\Delta\sigma\). The initial bearing uses $$\theta = \operatorname{atan2}\!\big(\sin\Delta\lambda \cos\varphi_2,\ \cos\varphi_1 \sin\varphi_2 - \sin\varphi_1 \cos\varphi_2 \cos\Delta\lambda\big),$$ converted to degrees and normalized into the range 0 to 360.
Worked example
From Tokyo (lon 139.74477, lat 35.6544) to Mecca (lon 39.8261, lat 21.4225) with \(r = 6378.137\) km: the central angle is about 1.4876 rad, giving a distance of roughly 9491 km. The bearing works out to about 293 degrees, i.e. WNW — the direction from Tokyo toward Mecca.
FAQ
Why does my result differ slightly from Google Maps? This uses a spherical Earth (one radius). Ellipsoidal methods like Vincenty differ by up to about 0.3%.
Which radius should I use? Use 6371 km for the common mean-radius convention, or 6378.137 km for the WGS-84 equatorial radius.
Why is the bearing blank for identical points? When A and B coincide the distance is zero and the bearing is mathematically undefined.