Distance Between Coordinates

Calculate the straight-line distance between two geographic points using the Haversine formula.

How to use

  1. Type the latitude and longitude of two points in decimal degrees.
  2. Click Calculate to see the straight-line (great-circle) distance in kilometres, miles and nautical miles.
  3. The calculation uses the Haversine formula with Earth's mean radius of 6,371 km.

About this tool

The Haversine formula calculates the shortest distance between two points on a sphere, measured along the surface — the great-circle distance. For two points on Earth, it gives the straight-line distance as the crow flies, ignoring terrain, roads and altitude. It is the standard formula used in navigation, aviation and logistics for quick distance estimates.

The formula uses the mean radius of the Earth (6,371 km) and assumes a perfect sphere. For most purposes this is accurate to about 0.3% — the Earth is an oblate spheroid, slightly wider at the equator, and the Vincenty formula accounts for that at the cost of complexity. For distances under a few thousand kilometres, the difference is negligible.

The result is shown in three units: kilometres, statute miles (1 mi = 1.609 km) and nautical miles (1 nmi = 1.852 km). Nautical miles are standard in aviation and marine navigation because one nautical mile equals one minute of latitude.

The formula

a = sin²(Δlat/2) + cos(lat₁) × cos(lat₂) × sin²(Δlon/2). d = 2R × atan2(√a, √(1−a)), with R = 6,371 km.

Frequently asked questions

Is this the driving distance?

No — it is the straight-line distance across the surface of the Earth. The driving distance is always longer because roads curve, climb and detour.

How accurate is the Haversine formula?

Within about 0.3% for any two points on Earth. The error comes from treating the Earth as a perfect sphere; the Vincenty formula corrects for the equatorial bulge but is rarely needed for everyday use.

What are nautical miles?

A unit used in aviation and marine navigation. One nautical mile equals one minute of latitude, which makes chart reading easier. 1 nmi = 1.852 km.

Does this account for altitude?

No. The distance is measured along the surface at sea level. For two points at very different altitudes, the true distance is slightly longer.

Related tools

Long links? Shorten them for free

Vai.la turns any URL into a short link with click statistics, QR Code and your own biolink.

Vai.la is not responsible for how the tools are used or for decisions made based on their results.