SM Datum

Distance Between Coordinates Calculator

To find the distance between two coordinates, enter the latitude and longitude of both points. The calculator measures the shortest path on the WGS84 ellipsoid with Vincenty's method, which agrees with GeographicLib to within 0.1 mm on 2,000 random point pairs, and shows the result in kilometres, miles, nautical miles, metres and feet next to the haversine (sphere) figure. It also handles lists of pairs and whole routes, in your browser.


Calculate many at once

Choose pairs (four values per line) or a route (one point per line, latitude first). Decimal degrees and DMS with N/S/E/W letters both work.

How to calculate the distance between two coordinates

  1. Enter both points. Latitude first, then longitude, in decimal degrees (40.7128, -74.006) or DMS. South and west are negative, or use S and W.
  2. Click Calculate. The distance appears in kilometres, miles, nautical miles, metres and feet, with the initial and final bearing and the haversine figure for comparison.
  3. For a route, switch the list type. Paste one point per line and choose Route. You get each leg and the running total, which is the length of a track or a flight path.
  4. Download the table. Copy the results or download them as a CSV.

Ellipsoidal distance versus haversine

The Earth is not a sphere; it is flattened by about 1 part in 298. Two methods are common:

  • Haversine treats the Earth as a sphere (here with the mean radius of 6,371,008.8 m). It is simple, but it can be off by up to about 0.5% because the real radius varies from 6,357 km at the poles to 6,378 km at the equator.
  • Vincenty's inverse formula works on the WGS84 ellipsoid, the datum GPS uses. It gives the length of the shortest path on the surface (the geodesic) to well below a millimetre for most point pairs.

This page reports the Vincenty result as the distance and shows the haversine value with the percentage difference, so you can see how much the sphere assumption costs for your own points.

Worked example

New York (40.7128° N, 74.0060° W) to London (51.5074° N, 0.1278° W):

ellipsoid (Vincenty)  5,585.234 km   (3,470.5 mi, 3,015.8 nmi)
haversine (sphere)    5,570.230 km   (0.27% shorter)
initial bearing       51.241°      final bearing 108.369°

A second example for Indian readers: Jaipur (26.9124° N, 75.7873° E) to Delhi (28.6139° N, 77.2090° E) is 234.926 km on the ellipsoid, with an initial bearing of 36.29° (north-east). The haversine figure is 0.16% longer.

Straight-line distance is not driving distance

The result is the shortest path over the Earth's surface at sea level, often called the distance as the crow flies. Roads, rail lines and flight corridors are longer. The page also ignores height: it measures on the ellipsoid, not along a mountain slope.

Common mistakes

  • Latitude and longitude swapped. Latitude is first and cannot exceed 90. A latitude above 90 is rejected.
  • Missing minus sign. A point in the Americas with a positive longitude lands in Asia and gives a distance of thousands of kilometres too much or too little. Use negative values or W and S.
  • Using the sphere result for survey work. A 0.3% error on a 5,000 km flight is 15 km, and on a 5 km property boundary about 15 m. Use the ellipsoidal value, or work in a local projection with UTM coordinates.
  • Datum. Coordinates are taken as WGS84. For NAD27 or another local datum the error can reach tens to hundreds of metres; convert the datum first with the CRS Converter.

What this calculator does and does not do

  • WGS84 geodesic. The distance follows the shortest path on the ellipsoid. For points almost opposite each other on the globe (nearly antipodal) the method does not converge. The page then returns the haversine estimate and says so; that estimate can be off by roughly 0.5%.
  • No elevation. Heights are not used.
  • Accuracy. We compared 2,000 random point pairs with GeographicLib (through pyproj). The largest difference was 0.07 mm, and bearings agreed to better than 0.000001°.
  • Runs in your browser. No coordinates are sent to a server.

Related calculators

For the direction of travel use bearing between two points, which also finds a destination from a start, bearing and distance. To measure a boundary, see the polygon area calculator, and for traverses see the bearing and distance guide.

Frequently asked questions

How do I calculate the distance between two coordinates?

Enter the latitude and longitude of both points and click Calculate. The page uses Vincenty's formula on the WGS84 ellipsoid and returns the shortest-path distance in kilometres, miles, nautical miles, metres and feet.

What is the difference between Vincenty and haversine?

Haversine assumes a perfectly spherical Earth and can be off by up to about 0.5%. Vincenty uses the WGS84 ellipsoid and is accurate to well under a millimetre for most pairs. The page shows both.

Which Earth radius does the haversine figure use?

The mean Earth radius of 6,371,008.8 m. The ellipsoidal result does not use a single radius.

How accurate is the result?

Compared with GeographicLib on 2,000 random point pairs, the largest difference was 0.07 mm. The accuracy of your answer is limited by the accuracy of your input coordinates.

Is this the distance I would drive or fly?

No. It is the shortest path over the surface, as the crow flies. Roads and flight corridors are longer, and the calculation ignores elevation.

Why is the distance between nearly opposite points flagged?

For nearly antipodal points Vincenty's method does not converge. The page then uses the haversine estimate, which can be off by roughly 0.5%, and says so.

Can I get the distance of a whole route?

Yes. Choose Route in the list box and paste one point per line. The table shows each leg and the cumulative distance, and the summary gives the total length.

What coordinate formats are accepted?

Decimal degrees and degrees-minutes-seconds, with N, S, E, W letters or minus signs. In pairs mode separate the four values with commas, semicolons or tabs.

How many nautical miles is a kilometre?

One nautical mile is exactly 1,852 m, so 1 km is about 0.54 nmi. One statute mile is exactly 1,609.344 m.

Does it also give the bearing?

Yes. The initial bearing at point 1 and the final bearing at point 2 are shown. For more detail, including the back bearing and compass direction, use the bearing calculator.

Can I convert a list at once?

Yes. Paste one entry per line into the batch box, click Convert list, then copy the results or download them as a CSV. Lines that cannot be read are flagged with the reason instead of being skipped silently.

Does it send my coordinates to a server?

No. The conversion runs in your browser, and once the page has loaded it needs no connection.

Related tools and guides

Need survey data cleaned, projected or mapped at scale? Sagarmekhla GIS Consultancy offers GIS and remote sensing services.

Request a consultation

Last updated 2026-10-15. Published by Sagarmekhla GIS Consultancy.