Skip to content
dz / coordinate-distance
Geo & units

Distance between coordinates

Distance and bearing between two GPS points – haversine and exact WGS84 – on a map.

/dist
A

B

Units
Distance
–

Want to see where your IP address places you? getmy-ip.com ↗

Map Click to place
· drag the markers to move them

The line is the shortest path on the Earth's surface (geodesic) – on a flat map it bends towards the pole.

▸ About this tool

About the GPS Distance Calculator

Introduction

How far is it between two places "as the crow flies", and in which direction do you have to set off? This tool measures the distance and bearing between any two GPS coordinates on the Earth's surface and draws the route on a map. It is handy for checking geolocation data, estimating flight and sailing distances, validating the output of location APIs, or simply settling an argument about which city is closer.

How to use it

  1. Enter point A and point B in almost any notation – decimal degrees (50.0875, 14.4213), degrees-minutes-seconds (50°5'15"N 14°25'17"E), degrees with decimal minutes (N 50 5.25 E 14 25.28), a geo: URI or a Google Maps / OpenStreetMap link.

  2. Or click the map: the first click places the selected point, the next one the other. Drag either marker to fine-tune it, or use My location.

  3. Read the distance in kilometres, miles or nautical miles together with the bearings, the midpoint and the alternative constant-bearing route. Every value has a copy button, and the address bar keeps both points so you can share the exact measurement.

Short links: develzone.org/dist, /distance, /haversine and /bearing. Pasting a coordinate pair into the search box on the home page opens it here as point A.

Haversine or ellipsoid?

The well-known haversine formula treats the Earth as a perfect sphere with a radius of 6,371 km. It is simple and good to within about 0.5 %. The Earth, however, is slightly flattened – about 21 km shorter from pole to pole than across the equator. This tool therefore also computes the exact distance on the WGS84 ellipsoid, the reference shape used by GPS, using Charles Karney's geodesic algorithms (2013), which are accurate to a few nanometres for any two points on Earth. Both results are shown, along with how much the haversine estimate is off.

Bearings and routes

  • Initial bearing – the compass direction you start in at A (0° = north, 90° = east).

  • Final bearing – the direction you are heading when you arrive at B. On a long great-circle route it differs from the initial bearing: a flight from New York to London leaves heading north-east and arrives heading east-south-east.

  • Great circle (geodesic) – the shortest path, drawn on the map. On a flat Mercator map it looks curved towards the pole, which is why transatlantic flights pass over Greenland and Iceland.

  • Rhumb line – a route that keeps one constant compass course. It is a straight line on a Mercator chart and easier to steer, but longer, especially on long east–west legs at high latitudes.

Good to know

  • Latitude comes first, longitude second. Values west of Greenwich and south of the equator are negative (London: 51.5074, -0.1278).

  • One nautical mile is exactly 1,852 m – roughly one minute of latitude. One statute mile is 1,609.344 m.

  • The result is the distance over the Earth's surface at sea level; it ignores roads, terrain and altitude.

  • Have coordinates in degrees, minutes and seconds? Convert them with Degrees ⇄ decimal. Coordinates hidden in a photo can be read with the Exif reader.

Privacy

All calculations run in your browser. Your location is only used if you press My location, never leaves your device and is not stored. Map tiles are loaded from OpenStreetMap.

❯ Esc
↑ ↓ select ↵ open Shift ↵ new line