Format Code Now
/
Calculators & unitsDistance Between Coordinates Next: World Clock ›

Distance Between Coordinates

CU-98

Enter the latitude and longitude of two points to get the great-circle distance in kilometres, miles and nautical miles, the initial bearing and the midpoint. Decimal degrees and degrees minutes seconds both work.

Runs in your browser. Nothing is uploaded.

Two points

Distance, bearing and midpoint

Distance5,570.23 km
Miles3,461.18 mi
Nautical miles3,007.68 nmi
Initial bearing51.21° (NE), measured clockwise from north at point A
Midpoint52.368440, -41.290307
Midpoint in degrees, minutes, seconds52°22′06″N 41°17′25″W
Point A40.712800, -74.006000
Point B51.507400, -0.127800
ModelA sphere of radius 6371.0088 km. Earth is slightly flattened, so the true surface distance can differ by up to about 0.5 percent.

How to use it

  1. Enter latitude and longitude for point A and for point B, in decimal degrees or as degrees, minutes and seconds.
  2. South and west are negative, or end the value with S or W.
  3. Read the distance, the initial bearing from A and the midpoint of the path.

How the distance is worked out

The tool uses the haversine formula on a sphere of radius 6371.0088 km, the mean radius of the Earth. The result is the great-circle distance, the shortest path over the surface. The Earth is slightly flattened, so a distance measured on its true shape can differ from this figure by up to about 0.5 percent. It is not a road, flight or sailing distance. A mile is 1.609344 km and a nautical mile is 1.852 km.

Entering coordinates

Latitude runs from -90 to 90 and longitude from -180 to 180. Type decimal degrees such as 40.7128 and -74.0060, or 74.006 W, or degrees, minutes and seconds such as 40°26'46"N, 40 26 46 N or 40°26.767'N. The only letters accepted are N, S, E and W. A minus sign together with a letter is refused, and only the last number, such as the seconds, may have decimals. Minutes and seconds must be below 60.

Bearing, midpoint and a worked example

The initial bearing is the compass direction to start in at point A, measured clockwise from north, and it changes along the path. The midpoint is the point halfway along the great circle. New York (40.7128, -74.0060) to London (51.5074, -0.1278) gives 5,570.23 km, an initial bearing of 51.21 degrees (north-east) and a midpoint at 52.368440, -41.290307. For exactly opposite points there is no single bearing or midpoint, and the tool says so.

Error messages and what to do

MessageWhat it meansFix
Point A latitude "91" is not valid: latitude must be between -90 and 90 degrees.A latitude outside -90 to 90 was entered.Use a latitude from -90 to 90.
Point B longitude "40 N" is not valid: a longitude uses E or W.A latitude letter was used on a longitude.Use E or W for longitude, or a minus sign for west.
Enter a value for Point A longitude.The longitude box is empty.Type a longitude such as -74.0060.

Questions people ask

How do I calculate the distance between two coordinates?

Enter the latitude and longitude of both points. The tool applies the haversine formula on a sphere of radius 6371.0088 km and shows the distance in kilometres, miles and nautical miles, plus the bearing and midpoint.

How accurate is it?

The Earth is not a perfect sphere, so the figure can be off by up to about 0.5 percent compared with a calculation on the ellipsoid. It is good for a quick estimate and not for surveying. It measures along the surface, not along roads.

Can I enter degrees, minutes and seconds?

Yes. Type 40°26'46"N, or 40 26 46 N, or 40°26.767'N for degrees and decimal minutes. Letters other than N, S, E and W are refused, and the tool names the value it could not read.

Which signs are used for south and west?

South latitudes and west longitudes are negative. You can type a minus sign, or end the value with S or W. Using both a minus sign and a letter on the same value is refused to avoid a double flip.

What is the initial bearing?

It is the direction to head from point A to follow the shortest path to point B, in degrees clockwise from north, with a compass name such as NE. On a long path the direction keeps changing, so the bearing at B is different.

Is this the driving distance?

No. It is the straight shortest path over the surface of a sphere. Roads, flight routes and shipping lanes are longer, so use this for comparing places or for planning, not for fuel or route times.

About this tool

Gives the shortest path over the surface between two points, called the great-circle distance, in kilometres, miles and nautical miles, plus the initial bearing from point A and the midpoint of the path. It uses the haversine formula on a sphere of radius 6371.0088 km, the mean radius of the Earth. Earth is slightly flattened, so a real surface distance measured on the ellipsoid can differ from this figure by up to about 0.5 percent, and it is not a road, flight or sailing distance. Latitude runs from -90 to 90 and longitude from -180 to 180, south and west being negative. Type decimal degrees (40.7128, -74.006, or 74.006 W), or degrees minutes seconds such as 40°26'46"N, 40 26 46 N or 40°26.767'N. The only letters accepted are N, S, E and W, a minus sign and a letter together are refused, and only the last number may have decimals. A mile is 1.609344 km and a nautical mile is 1.852 km. If the two points are opposite each other there is no single bearing or midpoint and the tool says so. Nothing is looked up: no place names, no map.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.