Advertisement

Free Online Distance Between Coordinates

Calculate the distance between two latitude and longitude points.

Decimal degrees only. Southern latitudes and western longitudes are negative. The haversine calculation assumes a spherical Earth with a mean radius of 6,371.0088 km.

Distance
—
kilometres
Initial bearing
—
—
Distance in miles
—
Distance in nautical miles
—

Midpoint

—

Bearing is measured clockwise from true north. The midpoint is the great-circle halfway point, not the arithmetic average of the coordinates.

Advertisement

About the Coordinate Distance Calculator

Latitude and longitude describe positions on a curved surface, so the distance between two points is not a simple straight-line subtraction. The shortest path across a sphere is a great-circle arc, and this calculator measures that arc with the haversine formula. It also reports the initial compass bearing, the final bearing, the great-circle midpoint, and the central angle between the two positions. The results are useful for travel planning, aviation and marine navigation, radio line-of-sight estimates, and geospatial analysis.

The haversine formula

For two points with latitudes φ₁ and φ₂ and longitude difference Δλ, the haversine form is a = sin²(Δφ/2) + cos φ₁ · cos φ₂ · sin²(Δλ/2), followed by c = 2 · atan2(√a, √(1 − a)) and d = R · c. The haversine function avoids some of the numerical instability of the older spherical law of cosines, especially for short distances. The radius used here is the mean Earth radius of 6,371.0088 kilometres. Real terrain, roads, and air routes are longer than the great-circle distance, so treat the result as a lower bound rather than a travel distance.

Bearing and compass direction

The initial bearing is the direction you would face at the starting point to follow the great-circle path. It is measured clockwise from true north, so 0° is north, 90° is east, 180° is south, and 270° is west. On a sphere the bearing changes continuously along the route, which is why long flights appear curved on a flat map. The final bearing is the direction of travel as you arrive, and the two values differ except on a meridian or the equator. Magnetic declination is not included; the compass needle points to magnetic north, which can differ from true north by tens of degrees depending on location.

The great-circle midpoint

The midpoint shown here is the point halfway along the great-circle arc. Its latitude is not the average of the two latitudes, and its longitude is not the average of the two longitudes, except in special cases. The calculation uses spherical trigonometry to find the point that divides the arc into two equal segments. For routes that cross the international date line, the longitude is normalised back into the −180° to 180° range so the result remains readable.

Accuracy and assumptions

  • The model is a perfect sphere, so the result differs slightly from an ellipsoidal calculation such as Vincenty's formula.
  • Elevation is ignored; two points at the same coordinates but different altitudes are treated as one place.
  • Distances are in kilometres, statute miles, and nautical miles. One nautical mile is exactly 1.852 kilometres.
  • Coordinates must be entered in decimal degrees, not degrees-minutes-seconds.
  • Very long routes and polar crossings remain valid, but the bearing interpretation should be checked carefully near the poles.

Frequently asked questions

Why is the road distance longer than this result?

The calculator returns the great-circle distance over an ideal sphere. Roads, rail lines, and flight paths follow practical routes and terrain, so they are almost always longer than the direct arc.

Is the bearing the same as a compass heading?

No. The bearing is relative to true north. A magnetic compass is affected by local magnetic declination, and an aircraft or vessel must also correct for wind and currents.

How accurate is the spherical model?

For most everyday purposes the error is a few tenths of a percent. Surveying and long-range geodesy require an ellipsoidal model that accounts for Earth's flattening.

Sponsored
Find a bug? Report now