Distance between two coordinates

Enter two points as decimal degrees or degrees, minutes and seconds. The calculator gives the great-circle distance by the haversine formula, the more exact WGS84 distance by Vincenty's method, the initial bearing and the midpoint.

Point A
Point B

Write 40.7128 or -74.006, 40.7128 N, or 40°42′46″ N. S and W mean negative.

Distance, haversine5,570.2 km
Miles
3,461.2 mi
Nautical miles
3,007.7 nmi
Distance, WGS84 ellipsoid (Vincenty)
5,585.2 km
Initial bearing from A
51.2° NE
Midpoint
52°22′06.4″ N, 41°17′25.1″ W

The haversine figure treats the Earth as a sphere with radius 6371.0088 km. Vincenty's figure uses the WGS84 ellipsoid and is closer to the true distance on the surface.

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Type the latitude and longitude of point A and of point B. Decimal degrees and degrees-minutes-seconds both work.
  2. Read the distance, the initial bearing from A and the midpoint of the route.
  3. Use the swap button to reverse the direction.

Formulas

With latitudes φ₁, φ₂ and the longitude difference Δλ, the haversine formula is:

a = sin²(Δφ/2) + cos φ₁ · cos φ₂ · sin²(Δλ/2), d = 2R · atan2(√a, √(1−a))

with R = 6371.0088 km, the mean Earth radius of the IUGG. Vincenty’s inverse method solves the same problem on the WGS84 ellipsoid with a = 6378137 m and flattening 1/298.257223563. Miles use 1 mi = 1.609344 km and nautical miles 1 nmi = 1.852 km.

Worked example

From New York (40.7128, −74.0060) to London (51.5074, −0.1278) the great-circle distance is about 5,570 km (3,461 miles), and the initial bearing from New York is about 51° north-east. Along the equator, one degree of longitude is 111.19 km by haversine and 111.32 km on the WGS84 ellipsoid.

Notes

Points that are almost exactly opposite on the globe can make Vincenty’s iteration fail; the tool then shows no ellipsoid figure and the haversine distance still applies. Coordinates are not checked against any map.

Frequently asked questions

Which coordinate formats can I type?

Decimal degrees such as 40.7128 or -74.006, decimals with a hemisphere letter such as 40.7128 N, and degrees-minutes-seconds such as 40°42′46″ N or 40 42 46 N. Letters S and W make the value negative.

Why are there two distances?

The haversine formula treats the Earth as a sphere and is simple and fast. Vincenty's method uses the WGS84 ellipsoid, so it is closer to the real length on the surface. The two differ by a fraction of a percent.

Is this the distance I would drive or fly?

No. It is the shortest distance over the Earth's surface, the great-circle line. Roads, air routes and winds make real trips longer.

What is the initial bearing?

The compass direction, in degrees clockwise from north, in which you start on the shortest route from point A. On a long route the direction changes along the way.

More in Date & time

All tools in this category: Date & time ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.