Distance Between Two Coordinates Calculator

CoordinateMapper Logo

Resources • Convert Coordinates

Distance Between Two Coordinates Calculator

Calculate the distance between two coordinates in any format, with the initial and back bearing, the midpoint, a destination point from a bearing and distance, or the length of a whole route. Point A and Point B can even be in different formats. Results are measured along the WGS84 ellipsoid with a geodesic, not the spherical haversine formula.

Enter Point A and Point B in any supported format, then press Enter or tap outside the box.

Enter two points to find the point halfway along the shortest path between them.

Enter a start point, a bearing and a distance to find where you end up.

Up to 25 points without an account, 100 with a free account, unlimited with Pro.

Distances are the shortest path along the surface of the WGS84 ellipsoid at sea level, calculated with Karney's geodesic algorithm. They are not grid distances on a map projection and they ignore elevation and terrain. Bearings are true bearings, not magnetic or grid bearings. Inputs on other datums (such as OSGB36 UK Grid) are converted to WGS84 first.

How distance between two coordinates is calculated

Every coordinate format describes a position on the Earth, but they do it in different ways. Decimal degrees and DMS are angles of latitude and longitude. UTM, MGRS, UK Grid and State Plane are positions on flat, projected grids. Before a distance can be measured, both points have to be expressed the same way. The calculator first reads each point with the same parser used across CoordinateMapper, then converts it to WGS84 latitude and longitude. Grid references on other datums, such as the OSGB36 datum behind the UK National Grid, are transformed to WGS84 at this step.

With both points in WGS84, the calculator solves what geodesists call the inverse geodesic problem: given two points on an ellipsoid, find the length of the shortest path between them and the direction of that path at each end. It uses the algorithm published by Charles Karney in 2013 and implemented in the GeographicLib library. GeographicLib's author describes it as accurate to about 15 nanometres on the WGS84 ellipsoid, and unlike some older methods it returns an answer for every pair of points, including points on opposite sides of the Earth.

The WGS84 ellipsoid has an equatorial radius of 6,378,137 m and a flattening of 1/298.257223563, so its polar radius is about 21 km shorter than its equatorial radius. That flattening is why a degree of latitude is not a fixed length. One degree of latitude at the equator measures 110,574.39 m, while the degree between 89° and 90° measures 111,693.86 m. One degree of longitude along the equator is 111,319.49 m.

Great circle vs geodesic vs haversine vs rhumb line

You will see several terms used for "the distance between two points". They are not interchangeable, and the difference matters once accuracy or long distances are involved.

How big is the haversine error?

We compared haversine (sphere of radius 6,371 km) with the geodesic for 20,000 random point pairs worldwide. The spherical result ranged from about 0.45% too short to about 0.55% too long, depending on where the points were and the direction between them. For London Heathrow to New York JFK, haversine gives 5,540.01 km while the geodesic is 5,554.91 km, a difference of 14.9 km (0.27%). For a short walk the difference is a few metres, but for long legs, survey checks and anything where the answer will be compared with another tool, a geodesic is the safer choice.

When would you want a rhumb line?

Rhumb lines are traditional in marine navigation because a ship can follow one by holding a single compass heading. A geodesic, by contrast, needs its bearing to change continuously along the way, except when travelling due north, due south or along the equator. For short legs the two paths are almost the same. Over thousands of kilometres the rhumb line can be noticeably longer. The calculator reports the geodesic distance and bearings, so if you are planning a constant-heading passage, treat the initial bearing as the start of a curving path rather than a heading to hold.

MethodWhat it isWhen it matters
Great circleThe shortest path between two points on a sphere. Its plane passes through the centre of the sphere.A good mental model and fine for rough estimates. On the real Earth it is an approximation.
GeodesicThe shortest path between two points on the ellipsoid. This is the ellipsoidal equivalent of a great circle.Surveying, aviation, marine work and any time you need a number you can rely on. This is what the calculator uses.
HaversineA formula for great circle distance on a sphere of a chosen radius, often 6,371 km.Quick and simple, but it inherits the sphere approximation, so results drift by up to about half a percent.
Rhumb lineA path of constant bearing that crosses every meridian at the same angle (a loxodrome).Easy to steer with a fixed compass heading. It is longer than the geodesic except along a meridian or the equator.

Bearings explained: initial, final and back bearing

A bearing is a direction measured clockwise from north, from 0° to 360°. Because a geodesic curves relative to the meridians it crosses, its direction is different at each end, so there are three bearings worth knowing.

  • Initial bearing (A to B): the direction you set off in from Point A.
  • Final bearing: the direction you are travelling in as you arrive at Point B. The Destination tab shows it for the point you calculate.
  • Back bearing (B to A): the direction from Point B back to Point A. It equals the final bearing plus 180°, and it is usually not the initial bearing plus 180°.
  • True bearing: measured from true (geographic) north. Every bearing on this page is a true bearing.
  • Magnetic bearing: measured from magnetic north, which is where a compass needle points. The angle between true and magnetic north is the magnetic declination. It varies with location and changes over time, so check a current source before converting.
  • Grid bearing: measured from grid north on a projected map such as UTM or the UK National Grid. The angle between grid north and true north is the grid convergence. It is zero on the projection's central meridian and grows the further east or west you go.

The 16-point compass label

Alongside each bearing the calculator shows a 16-point compass label such as N, NNE, NE or WNW. Each label covers a 22.5° sector centred on its direction, so N covers 348.75° to 11.25°. The label is a quick sense check. Use the numeric bearing for anything that needs precision.

Worked example: London Heathrow to New York JFK

Point A is 51.4700, -0.4543 (close to London Heathrow) and Point B is 40.6413, -73.7781 (close to New York JFK). Enter them in the calculator above and you can reproduce every number below.

The initial bearing is 287.98°, west-north-west, even though New York is south of London. The shortest path heads north-west first, passes over the North Atlantic well north of both cities, and then turns south-west towards New York. That is also why the geodesic midpoint, 52.2375°N 41.2903°W, is further north than either airport. The back bearing of 51.38° is nowhere near 287.98° minus 180° (107.98°), which shows how much the direction of a long geodesic changes along its length.

For a second independent check, Sydney Airport (-33.9399, 151.1753) to Santiago Airport (-33.3930, -70.7858) comes out at 11,363,267.186 m with an initial bearing of 145.2529° in both CoordinateMapper and GeodSolve.

ResultCoordinateMapperGeodSolve (GeographicLib online)
Distance (m)5,554,908.795,554,908.791
Distance (km / mi / nmi)5,554.9088 km / 3,451.6603 mi / 2,999.4108 nmiConverted from 5,554,908.791 m
Initial bearing A to B287.9828° (287° 58' 58.2") WNW-72.01717094°, which is 287.98282906°
Final bearing at B231.3816°-128.61835214°, which is 231.38164786°
Back bearing B to A51.3816° (51° 22' 53.9") NEFinal bearing + 180° = 51.38164786°

Distance between UTM, MGRS or UK Grid points

You can enter UTM, MGRS, UK Grid References, easting and northing, or State Plane coordinates directly, and you can mix formats. For example, 51°28'12.0"N 0°27'15.5"W as Point A and 30U 699316 5710164 as Point B gives 23,056.70 m with an initial bearing of 79.4745°. Each point is converted to WGS84 first, so the result is the ellipsoid distance between the two positions.

That result is not the same as the grid distance you would get from Pythagoras on the eastings and northings. A projected grid stretches and squeezes the Earth's surface by a scale factor that changes across the map. In UTM the scale factor is 0.9996 on the central meridian of each zone, so grid distances there are slightly too short, and it rises above 1 towards the edges of the zone. The UK National Grid works the same way with a central scale factor of 0.9996012717.

If you are setting out on site and need grid distances that match a drawing in UTM, UK Grid or State Plane, use the coordinate differences on that grid. If you need the real distance over the Earth, use the ellipsoid figure from this calculator. A ground distance at height is longer again: at 1,000 m above sea level, a 100 m distance on the ellipsoid is about 1.6 cm longer on the ground. Not sure which system your numbers are in? Paste one into the coordinate format identifier first.

Two points 10,000 m apart on the UTM grid (zone 30U)Grid distanceEllipsoid distance
Eastings 495000 and 505000, northing 5700000 (central meridian)10,000.00 m10,004.00 m
Eastings 290000 and 300000, northing 5700000 (near the zone edge)10,000.00 m9,998.84 m

Midpoint and destination point

The Midpoint tab finds the point exactly halfway along the geodesic between Point A and Point B. It is not the simple average of the two latitudes and longitudes. On short distances the two are close, but over long distances they can be hundreds of kilometres apart, and averaging longitudes across the antimeridian (for example 179° and -179°) gives a point on the wrong side of the world. The geodesic midpoint of 0°, 179° and 0°, -179° is correctly 0°, 180°.

The Destination tab solves the direct geodesic problem: start at a point, set off on a true bearing, travel a set distance, and find where you end up. It shows the destination in every format, plots it on the map and gives the final bearing on arrival. Starting from 0°, 0° on a bearing of 90° for 111,319.49 m arrives at 0°, 1°, a quick check you can try yourself.

Measuring a route with many points

The Route tab measures a whole sequence of points. Paste one point per line, optionally with a label such as "Checkpoint 2: TQ 32055 81120", or upload a .txt, .csv or .gpx file. Files are read in your browser. You get a table of every leg with its distance, initial bearing and running total, plus the total route length. The table downloads as a CSV for free.

Route length follows the same limits as bulk conversion on CoordinateMapper: up to 25 points without an account and 100 with a free account. Pro removes the limit and lets you export the route as lines in DXF, GeoJSON or GPX for CAD, GIS or a GPS device. Plans are on the pricing page. If you only need to measure along lines you have drawn, the map workspace does that for free.

Accuracy and limits

The geodesic calculation itself is far more precise than any real-world input. In practice, the accuracy of your answer depends on the coordinates you put in.

  • Input precision: five decimal places of latitude is roughly a metre, and fewer decimal places mean larger uncertainty. A 6-figure UK Grid Reference only identifies a 100 m square. See coordinate precision explained.
  • Datums: OSGB36, NAD27 and other datums are converted to WGS84 with a standard transformation. For OSGB36 this is typically good to within a few metres, which is fine for most uses but not for survey-grade work. See WGS84 vs OSGB36.
  • Sea level, not terrain: distances are along the ellipsoid. Height differences, hills and the route you actually travel are not included.
  • Shortest path only: the result is the straight geodesic line, not a road, footpath, airway or shipping lane.
  • Nearly antipodal points: when two points are almost exactly opposite each other, many different paths have almost the same length. The distance is still correct, but the bearing can change a lot with a tiny change in the input.

Common mistakes

  • Swapped latitude and longitude: 51.47, -0.45 is near London, while -0.45, 51.47 is in the Indian Ocean. If a latitude is outside -90 to 90, the calculator offers to swap it for you.
  • Missing negative signs: west longitudes and south latitudes are negative in decimal degrees. Dropping the minus sign on -73.7781 moves a point from New York to Central Asia.
  • Mixed units: State Plane coordinates may be in US survey feet, international feet or metres. Choose the right unit when entering them, and check the unit before comparing a result in feet with a drawing.
  • Mixed datums: comparing an OSGB36 position with a WGS84 position without converting can introduce an error of around 100 m in Great Britain. Enter each point in its own format and let the calculator convert both.
  • UTM without a zone: an easting and northing pair is meaningless without its zone and hemisphere. If you leave them out, you will be asked for them.
  • Treating grid distance as ground distance: see the UTM and UK Grid section above.

Who uses a distance and bearing calculator?

Need to convert the points themselves? Use the bulk coordinate converter for long lists, or open the map to plot and measure them.

  • Surveyors and engineers checking control points, distances between monuments or a quick sanity check on a traverse.
  • Marine users planning passages in nautical miles and checking the bearing to a waypoint.
  • Aviation users estimating leg lengths and initial headings before applying wind and magnetic variation.
  • Drone pilots checking how far a site is from a launch point or an airfield.
  • Hikers and orienteers measuring between grid references and converting bearings for map and compass work.
  • Geocachers solving puzzle caches with projections, which are exactly the destination point problem.

Frequently asked questions

  • Q: How do I calculate the distance between two coordinates?
    A: Enter both points in the calculator at the top of this page, in any supported format. Each point is converted to WGS84 latitude and longitude, then the shortest path along the WGS84 ellipsoid is solved with Karney's geodesic algorithm. You get the distance in metres, kilometres, miles, nautical miles, feet and US survey feet, plus the initial and back bearings.
  • Q: Is this more accurate than the haversine formula?
    A: Yes. Haversine treats the Earth as a perfect sphere. The Earth is closer to an ellipsoid that is flattened at the poles, so spherical results drift away from the true value. In our tests on 20,000 random point pairs, a sphere of radius 6,371 km gave results from about 0.45% too short to about 0.55% too long. The geodesic method used here solves the ellipsoid directly.
  • Q: Can the two points be in different coordinate formats?
    A: Yes. Point A could be degrees, minutes and seconds and Point B could be UTM, MGRS, a UK Grid Reference, easting and northing, or State Plane. Each point is read and converted to WGS84 on its own before the distance is calculated.
  • Q: What is the difference between initial bearing and back bearing?
    A: The initial bearing is the true direction you set off in from Point A towards Point B. The back bearing is the true direction from Point B back towards Point A. On a curved Earth the back bearing is usually not exactly the initial bearing plus 180 degrees, because the direction of a geodesic changes as it crosses meridians.
  • Q: Are the bearings true, magnetic or grid bearings?
    A: They are true bearings, measured clockwise from true (geographic) north. To use them with a magnetic compass you must apply the local magnetic declination, and to use them on a projected map grid you must allow for grid convergence.
  • Q: Why does the distance between two UTM points differ from the easting and northing difference?
    A: The easting and northing difference is a grid distance on the flat UTM projection, which has a scale factor that varies across each zone. The calculator gives the distance along the ellipsoid surface. For a 10,000 m grid distance near the zone's central meridian, the ellipsoid distance is 10,004.00 m. Near the zone edge the grid distance is longer than the ellipsoid distance instead.
  • Q: Does the distance include elevation or terrain?
    A: No. The result is the shortest path along the WGS84 ellipsoid at sea level. It does not include height differences, hills, roads or obstacles, so a walking, driving or flight route will usually be longer.
  • Q: How do I find the midpoint between two coordinates?
    A: Open the Midpoint tab. It finds the point exactly halfway along the geodesic between Point A and Point B and shows it in every coordinate format. On long routes the midpoint is often further from the equator than either end point, because the shortest path curves towards the nearer pole.
  • Q: Can I measure a route with more than two points?
    A: Yes. The Route tab accepts a pasted list or a .txt, .csv or .gpx file and shows each leg, its bearing, the running total and the total route length. Up to 25 points are free without an account, 100 with a free account, and Pro is unlimited.

We use analytics cookies to understand how visitors use this website. You can accept or manage your preferences.