Calcoid

Haversine Distance Calculator

Find the great-circle distance between two latitude/longitude points with the haversine formula, in kilometers, miles, and nautical miles.

Haversine Distance Calculator

Point A

From -90 to 90 (north positive, south negative).

From -180 to 180 (east positive, west negative).

Point B

From -90 to 90 (north positive, south negative).

From -180 to 180 (east positive, west negative).

Example routes

Great-circle distance

343.56 km

Miles

213.48 mi

Nautical miles

185.51 nmi

Meters

343,557 m

Central angle

3.0897°

Initial bearing (A to B)

148.12°

Frequently Asked Questions about the Haversine Distance Calculator

What is the haversine formula?
The haversine formula calculates the great-circle distance between two points on a sphere from their latitude and longitude. It computes a as the sine squared of half the latitude difference, plus the cosine of each latitude times the sine squared of half the longitude difference. The central angle is then c = 2 times atan2 of the square root of a and the square root of 1 minus a, and the distance is the Earth's radius times c. It stays numerically stable even for very small distances, which is why it is preferred over the plain spherical law of cosines.
How accurate is the haversine distance?
This calculator models the Earth as a perfect sphere with a mean radius of 6,371.0088 km, the IUGG arithmetic mean. Because the real Earth is a slightly flattened ellipsoid, haversine distances can differ from the true geodesic distance by up to about 0.5 percent, and usually much less. For trip planning, mapping, and most engineering work that error is negligible. If you need survey-grade precision, use an ellipsoidal method such as Vincenty's formulae.
What is a great-circle distance?
A great circle is any circle on a sphere whose center is the center of the sphere, and it is the largest circle you can draw on that surface. The shortest path between two points on a sphere always lies along the great circle that connects them. The great-circle distance is the length of the shorter arc of that circle. It is also why long flight paths look curved when drawn on a flat map.
What coordinate format do I enter?
Enter coordinates in decimal degrees. Latitude runs from -90 to 90, with north positive and south negative, and longitude runs from -180 to 180, with east positive and west negative. If you have degrees, minutes, and seconds, convert them first. Decimal degrees equal degrees plus minutes divided by 60 plus seconds divided by 3,600, with a minus sign for south or west.
Why does it also show nautical miles?
Nautical miles are the standard distance unit in marine and air navigation. One nautical mile is defined as exactly 1,852 meters, which is very close to one arcminute of latitude along a meridian. That link to angular measure makes nautical miles natural for plotting courses on charts. The calculator converts from the kilometer result using 1 nautical mile = 1.852 km and 1 mile = 1.609344 km.
What does the initial bearing tell me?
The initial bearing, or forward azimuth, is the compass direction you would head to start traveling the great-circle route from point A toward point B. It is measured clockwise from true north, so 0 degrees is north, 90 degrees is east, 180 degrees is south, and 270 degrees is west. On a great circle the bearing changes continuously as you travel, so it applies only at the starting point. It is not the same as a constant-heading rhumb line.

Related Calculators

More calculators in "Math"

See all 202 calculators in "Math"