GPS COORDINATES

Distance Between Coordinates Calculator

Calculate the distance between two GPS coordinates. Paste latitude and longitude in decimal degrees, degrees-minutes-seconds, UTM or a map link, and get the distance on the WGS84 ellipsoid, the haversine result for comparison, the bearing and every point in other formats.

Vincenty, WGS84 · DMS, UTM and map links · Excel and code formulas

Enter Two Sets of Coordinates

Enter two places — or click the map twice — to get the straight-line distance, bearing, midpoint and how it compares with the road.

Try:
Radius check — is it within X miles?
Bulk distance calculator — paste or upload a CSV

One pair per line: from,to. Each side can be a place, UK postcode, US ZIP or coordinates in quotes ("51.5072,-0.1276"). Four numeric columns (lat1,lon1,lat2,lon2) also work. A header row is detected automatically.

How this calculator works

Straight-line distance is the shortest path over the Earth's surface (a geodesic). We solve it on the WGS84 ellipsoid — the model GPS uses — with Vincenty's inverse formula, accurate to well under a millimetre. The haversine (perfect sphere) result is shown alongside so you can see the difference, typically up to 0.5%.

Bearing is the initial compass direction from the first point. The midpoint is halfway along the great-circle path. The rhumb line is the longer constant-bearing route that a compass course would follow. Road, walking and cycling distances come from OpenStreetMap routing, and the detour figure compares them with the straight line.

0.5 mm

accuracy of Vincenty’s method on WGS84

5

input formats, from decimal to UTM

111 km

in one degree of latitude

0.27%

haversine error, Statue of Liberty to Eiffel Tower

How to use the coordinate distance calculator

Type or paste each point in any of these formats:

  • Decimal degrees: 40.6892, -74.0445
  • Degrees, minutes, seconds: 40°41′21″N 74°02′40″W
  • Degrees and decimal minutes: N 40°41.352 W 74°02.670
  • UTM: 18T 580736 4504695
  • Map links from Google Maps or OpenStreetMap: paste the whole link.

Add more points for a multi-point route, or use the bulk calculator under the tool to process a CSV file of coordinate pairs.

One point in four formats

The Statue of Liberty:

FormatValue
Decimal degrees40.6892, −74.0445
DMS40°41′21″N, 74°02′40″W
Decimal minutesN 40°41.352′, W 74°02.670′
UTM18T 580736 4504695

Understanding GPS coordinates

Latitude, longitude and signs

Latitude runs from −90° (South Pole) to +90° (North Pole); longitude from −180° to +180°. Positive is north and east, negative is south and west. Most of the US has a negative longitude, and London’s is slightly negative because it lies just west of Greenwich.

Coordinates in Google Maps

On a computer, right-click a spot: the coordinates appear at the top of the menu and copy when you click them. On a phone, touch and hold to drop a pin; the coordinates show in the search box or the place card.

From a GPS device or app

Check whether it shows decimal degrees or degrees, minutes and seconds. The calculator accepts both, so you can paste the reading as it is.

PRECISION

How many decimal places do you need?

Each extra decimal place makes a coordinate ten times more precise. Five or six decimal places are plenty for addresses and GPS readings, and a phone’s GPS is rarely more accurate than a few metres anyway.

Coordinate precision at the equator: 1 decimal place ≈ 11.1 km, 2 ≈ 1.11 km, 3 ≈ 111 m, 4 ≈ 11.1 m, 5 ≈ 1.11 m, 6 ≈ 0.11 m
Bar chart of one degree of longitude on WGS84: 111.3 km (69.2 mi) at the equator, 107.6 km at 15°, 96.5 km at 30° (Houston), 78.8 km at 45° (Minneapolis), 55.8 km at 60° (Shetland), 28.9 km at 75°

How far is one degree?

One degree of latitude is about 69 miles (111 km) everywhere: from 110.574 km at the equator to 111.694 km at the poles.

One degree of longitude shrinks as you move away from the equator, because the meridians meet at the poles: 111.3 km at the equator, 96.5 km at Houston’s latitude, 78.8 km at Minneapolis and 55.8 km at Shetland.

Vincenty vs haversine vs law of cosines

GPS coordinates are defined on WGS84, an ellipsoid with an equatorial radius of 6,378,137 m that is slightly flattened at the poles. The calculator shows three methods side by side.

Vincenty (WGS84 ellipsoid)

Accurate to within 0.5 mm. This is the main result.

Haversine (sphere)

Simple and fast, but because the Earth is not a perfect sphere it can be off by up to about 0.5%.

Spherical law of cosines

Gives the same answer as haversine for most distances, but can lose precision for points very close together.

Example: Statue of Liberty to the Eiffel Tower

5,853.1 km with Vincenty and 5,837.4 km with haversine: a difference of about 16 km (0.27%), on an initial bearing of 53.7°.

Use the formula in Excel, JavaScript or Python

Open the formula section in your result to copy ready-made haversine code for Excel or Google Sheets, JavaScript and Python, already filled in with your two points. In Excel, with latitude and longitude of point 1 in A2:B2 and point 2 in C2:D2, the distance in kilometres is:

=2*6371*ASIN(SQRT(SIN(RADIANS(C2-A2)/2)^2+COS(RADIANS(A2))*COS(RADIANS(C2))*SIN(RADIANS(D2-B2)/2)^2))

Frequently asked questions

How do I calculate the distance between two GPS coordinates?

Enter both points in any format. The calculator uses Vincenty’s method on the WGS84 ellipsoid and shows the haversine result for comparison.

How far is one degree of latitude?

About 69 miles or 111 km, from 110.574 km at the equator to 111.694 km at the poles.

How far is one degree of longitude?

About 111.3 km at the equator, shrinking with the cosine of the latitude to zero at the poles.

How many decimal places do I need?

Five decimal places give about 1 m precision and six give about 0.1 m, which is more than enough for GPS readings.

Is a negative latitude or longitude south or west?

Negative latitude is south of the equator and negative longitude is west of Greenwich.

How accurate is the haversine formula?

It treats the Earth as a sphere, so it can be off by up to about 0.5%. Vincenty’s method on the WGS84 ellipsoid is accurate to within 0.5 mm.

What coordinate system does GPS use?

WGS84, the World Geodetic System 1984.

Can I paste a Google Maps link?

Yes. Paste the whole link and the calculator reads the coordinates from it.

Can I measure the distance between GPS coordinates from my phone?

Yes. Copy the coordinates from Google Maps or a GPS app on your phone, paste both points into the coordinate distance calculator and read the result.

What is the most accurate way to measure GPS distance?

Vincenty’s method on the WGS84 ellipsoid, which this calculator uses. It is accurate to within 0.5 mm, while the haversine formula can be off by up to about 0.5%.