Skip to content

Distance Between Coordinates Calculator

Distance between two latitude/longitude points with the Vincenty (WGS-84) and haversine formulas, in km, miles and nautical miles, plus bearing and midpoint.

Calculator Details

Distance (Vincenty, WGS-84):3,549.200 kmSee results ↓

Decimal degrees or DMS, e.g. 45.4215, -75.6972 or 45°25′17″N 75°41′50″W

South latitudes and west longitudes are negative (or use S and W)

Kilometres, statute miles or nautical miles

Your Results

Distance (Vincenty, WGS-84): 3,549.200 km

Distance (Vincenty, WGS-84)

3,549.200 km

3,549.200 km · 2,205.371 mi · 1,916.415 nmi

Haversine (sphere)

3,538.979 km

-0.29% vs Vincenty

Initial bearing

294.35°

WNW, from true north

Final bearing

258.52°

Direction of travel on arrival

Midpoint

49.854318, -98.488092

Halfway along the great circle

Straight-line (great-circle) distance, not a driving or flight route. See the midpoint on OpenStreetMap.

The distance is 3,549.2 km (2,205.4 mi, 1,916.4 nautical miles) on the WGS-84 ellipsoid (Vincenty), starting on a bearing of 294.4° (WNW).

Compare scenarios

Save these inputs as a scenario, change them, and compare the results side by side.

Loading, available in a moment

Detailed Breakdown

Distance by method

Distance by method
Methodkmminmi
Vincenty (WGS-84 ellipsoid)3,549.2002,205.3711,916.415
Haversine (sphere, R = 6,371.0088 km)3,538.9792,199.0191,910.896

Your points in decimal degrees

Your points in decimal degrees
PointLatitudeLongitude
From45.421500-75.697200
To49.282700-123.120700
Midpoint49.854318-98.488092

How This Calculator Works

How the distance is calculated

The haversine formula treats the Earth as a sphere of radius 6,371.0088 km (the IUGG mean radius):

a = sin²(Δφ/2) + cos φ₁ · cos φ₂ · sin²(Δλ/2)

d = 2R · asin(√a) = 3,538.979 km

Vincenty's method works on the WGS-84 ellipsoid (a = 6,378,137 m, 1/f = 298.257223563), the shape GPS uses. It iterates on an auxiliary sphere until the longitude changes by less than 10⁻¹² radians (5 iterations here), giving 3,549,200.080 m. The flattened Earth makes the true distance up to about 0.5% different from the sphere.

Frequently Asked Questions

What is the difference between the haversine and Vincenty formulas?

Haversine treats the Earth as a perfect sphere (here with the mean radius of 6,371.0088 km). Vincenty's formulas work on the WGS-84 ellipsoid, which is flattened at the poles (equatorial radius 6,378.137 km, polar 6,356.7523 km). Vincenty is accurate to under a millimetre; haversine can be off by up to about 0.5%, which is fine for most everyday uses.

How do I enter coordinates?

Type latitude then longitude, separated by a comma, in decimal degrees (45.4215, -75.6972) or degrees, minutes and seconds (45°25′17″N, 75°41′50″W). Spaces work instead of symbols (45 25 17 N, 75 41 50 W). South latitudes and west longitudes are negative, or use S and W.

Where do I find the coordinates of a place?

In most map apps, press and hold (or right-click) a spot to see its latitude and longitude, then copy them. GPS devices and photo metadata also record coordinates. This calculator doesn’t look up place names.

Is this the driving or flying distance?

Neither exactly. It is the shortest path over the surface of the Earth (a geodesic or great circle). Roads are always longer. Flights follow great circles approximately, but winds, air routes and airport approaches add distance.

What is the initial bearing?

The compass direction, measured clockwise from true north, in which you would set off along the shortest path. On a long route the direction changes as you travel, which is why the final bearing on arrival is different. Bearings are true, not magnetic: add or subtract the local magnetic declination for a compass.

What is a nautical mile?

Exactly 1,852 metres by international definition, originally one minute of latitude. Pilots and sailors use nautical miles because they fit with degrees and minutes on charts. A statute mile is exactly 1,609.344 metres.

Why does Vincenty sometimes fail?

For points almost exactly opposite each other on the globe, Vincenty’s iteration may not settle on an answer. The calculator then shows the haversine distance and tells you so. Other methods (Karney’s) handle these rare cases.

Distances use Vincenty's inverse formula on the WGS-84 ellipsoid (NGA TR8350.2) and the haversine formula on the IUGG mean-radius sphere; the midpoint is the spherical great-circle midpoint and bearings are true, not magnetic. The calculator leaves out elevation, place-name lookup, other datums (NAD27, local grids), rhumb-line (constant-bearing) distances and routes by road, sea or air.

Distance Between Coordinates: Haversine and Vincenty Explained

By FindMySum · Last reviewed

Given two points as latitude and longitude, how far apart are they? A distance between coordinates calculator answers that with spherical trigonometry or, more precisely, with geodesy on an ellipsoid. This one uses both: the Vincenty formula on the WGS-84 ellipsoid that GPS uses, and the simpler haversine formula on a sphere, and it gives the starting bearing and the midpoint too.

Entering coordinates

Latitude is the angle north or south of the equator, from −90° to 90°; longitude is the angle east or west of the Greenwich meridian, from −180° to 180°. In decimal degrees, south and west are negative: Ottawa is about 45.4215, −75.6972. In degrees, minutes and seconds, the same point is 45°25′17″N, 75°41′50″W. One degree has 60 minutes and one minute 60 seconds, so 45°25′17″ = 45 + 25/60 + 17/3600 = 45.4214°.

The haversine formula

Treating the Earth as a sphere of radius R, the distance d between two points is:

a = sin²(Δφ/2) + cos φ₁ × cos φ₂ × sin²(Δλ/2)

d = 2R × asin(√a)

where φ is latitude and λ longitude, in radians. The haversine form stays accurate for short distances, where the older law-of-cosines formula suffers from rounding. Using the international mean radius of 6,371.0088 km, the error from the sphere assumption is at most about 0.5%, largest on north–south routes at high latitudes.

Vincenty's formula on the ellipsoid

The Earth bulges at the equator: the WGS-84 ellipsoid has an equatorial radius of 6,378.137 km and a polar radius of about 6,356.752 km. Thaddeus Vincenty published an iterative method in 1975 that computes the shortest path on such an ellipsoid. It maps the points to an auxiliary sphere, iterates until the longitude difference settles (here to 10⁻¹² radians), then corrects for the ellipsoid's shape. It is accurate to well under a millimetre and is used by survey agencies including the US National Geodetic Survey.

For two points that are almost exactly opposite each other on the globe, the iteration can fail to settle. The calculator then falls back to haversine and says so.

A worked example

The calculator starts with Ottawa (45.4215, −75.6972) and Vancouver (49.2827, −123.1207).

  • Vincenty on WGS-84: 3,549.200 km, or 2,205.4 statute miles and 1,916.4 nautical miles.
  • Haversine on the sphere: 3,538.979 km, about 0.29% shorter.
  • Initial bearing: 294.35°, west-northwest from true north. On arrival the bearing is 258.52°, because a great circle across Canada curves north of the straight line you would draw on a flat map.
  • Midpoint: 49.854°N, 98.488°W, in southern Manitoba.

Bearings and midpoints

The initial bearing is the direction you would start out in along the shortest path, measured clockwise from true north. Along a great circle the bearing changes continuously, except when travelling along a meridian or the equator. To use it with a magnetic compass, adjust for the local magnetic declination, which in parts of Canada exceeds 15°.

The midpoint is the point halfway along the great circle on the sphere. It is useful for finding a fair meeting place or the centre of a route, and it is within metres of the ellipsoidal midpoint for most purposes.

Units

The calculator shows kilometres, statute miles (exactly 1,609.344 m) and nautical miles (exactly 1,852 m). Nautical miles are used in aviation and at sea because one nautical mile was originally one minute of latitude, which makes chart work easy.

Which result to use

For hiking, cycling routes, real-estate searches and most planning, the haversine figure is more than accurate enough: an error of a few hundred metres over thousands of kilometres rarely matters. Use the Vincenty figure when precision counts, such as checking survey data, comparing with GPS logs, setting property or drone boundaries, or calculating aviation and marine distances where small errors add up over long legs. Both are shown so you can see how much the Earth's shape matters for your two points.

What it doesn't do

The result is the distance over the Earth's surface at sea level. It doesn't account for elevation, terrain, roads, flight paths or shipping lanes, and it doesn't look up place names: enter coordinates copied from a map or GPS. For travel time, pair it with the speed, distance and time calculator.

More questions

How many kilometres is one degree of latitude?

About 111 km, varying slightly from roughly 110.6 km at the equator to 111.7 km near the poles because the Earth is flattened. One degree of longitude is 111.3 km at the equator and shrinks with the cosine of the latitude, reaching zero at the poles.

How precise should my coordinates be?

Each decimal place of a degree is about ten times finer. Four decimals locate a point to roughly 11 metres, five to about 1 metre and six to about 10 centimetres. Consumer GPS is typically accurate to a few metres, so more than six decimals adds nothing.

What is the difference between a great circle and a rhumb line?

A great circle is the shortest path between two points on a sphere, but its compass bearing changes along the way. A rhumb line keeps a constant bearing, which is easier to steer, but is longer except along the equator or a meridian. On a flat Mercator map the rhumb line looks straight and the great circle looks curved.

Does the datum matter?

For most purposes no: GPS, web maps and modern Canadian (NAD83) and US datums agree to within a metre or two. Old maps on NAD27 can differ by tens to hundreds of metres. If your coordinates come from an old survey, convert them to WGS-84 or NAD83 first.

Why do online maps show a curved line for flights?

Flat maps distort the globe. The shortest path between two cities is a great circle, which on most map projections looks like an arc bending toward the nearer pole. That is why a flight from Toronto to Tokyo passes over the Arctic.

Sources

This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.

Spotted a wrong result or a bug? Report a problem

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy