GT Geo Tools

Distance Calculator — Between Coordinates

Calculate the distance between two or more GPS coordinates with haversine or Vincenty, plus bearings, midpoints and path length in km, mi or nmi.

🔒 Runs entirely in your browser — nothing is uploaded

Advertisement

Measure distances between points on the Earth

The shortest route between two places on a globe is a great-circle (or, on an ellipsoid, a geodesic) line, not a straight line on a flat map. This calculator measures that distance for any two points, and for a whole path with many stops: add as many lines as you like and it adds up every leg. For each leg you get the initial and final bearing and the midpoint, so you can plan a route, check a flight or ferry distance, compare hiking waypoints or verify the distance in a spreadsheet.

Haversine versus Vincenty

The haversine formula assumes a perfect sphere with a mean radius of 6,371.0088 km. It is simple, fast and robust, and for most everyday purposes the error stays around 0.3% or less. The Earth is slightly flattened, though, with an equatorial radius of 6,378.137 km and a polar radius of about 6,356.752 km. Vincenty's inverse formula accounts for this flattening by working on the WGS 84 ellipsoid, the same reference used by GPS, and reaches sub-millimetre agreement with exact geodesic solutions for most points. As a check, one degree of longitude along the equator measures 111.319 km with Vincenty and 111.195 km with haversine. Vincenty's iteration can fail for nearly antipodal points, so the tool automatically uses haversine there and shows a notice.

Bearings, midpoints and units

Bearings are measured clockwise from true north, from 0° to 360°, and shown with a 16-point compass name such as SSE. The midpoint is the point halfway along the great circle, which differs from the simple average of the latitudes and longitudes, especially over long distances. Results can be shown in kilometres, statute miles (1,609.344 m), nautical miles (exactly 1,852 m), metres or feet (0.3048 m), and the summary also lists the same distance in the other units. Distances are along the surface at sea level; they do not include elevation changes or road and trail routing.

How to use

  1. Enter your pointsPut one coordinate per line, at least two. Decimal degrees, DMS, UTM and MGRS are all accepted.
  2. Pick a method and unitChoose Vincenty for ellipsoidal accuracy or haversine for a quick spherical estimate, then select kilometres, miles, nautical miles, metres or feet.
  3. Read the resultsSee the total path length, the straight-line distance, initial and final bearing and the midpoint of each leg.
  4. Copy the summaryCopy the summary text or reverse the order of points to measure the return route.

Frequently asked questions

What is the difference between haversine and Vincenty?
Haversine treats the Earth as a sphere of radius 6,371.0088 km and is typically within about 0.3% of the true distance. Vincenty's inverse formula works on the WGS 84 ellipsoid and is accurate to about half a millimetre for most point pairs.
Why does Vincenty sometimes fall back to haversine?
The iteration can fail to converge for nearly antipodal points (almost exactly opposite on the globe). In that case the tool uses haversine for that leg and tells you.
What do initial and final bearing mean?
The initial bearing is the compass direction (0° = north, 90° = east) to start along the shortest path. Because that path curves on the globe, the final bearing on arrival usually differs.
Is the path length a straight line?
Each leg follows the shortest path between its two points on the Earth's surface. The total is the sum of the legs, so it follows your route; the straight-line figure goes directly from the first to the last point.
Are my locations stored or sent anywhere?
No. All calculations run in your browser and the coordinates are never transmitted.
Advertisement