Distance & Bearing Between Coordinates (WGS 84)
Distance, bearings and midpoint between two lat/lon points on the WGS 84 ellipsoid, or the destination from a start point, bearing and distance.
The spherical figure is -0.268% off the ellipsoidal one. The sphere is the IUGG mean radius, 6,371.0088 km; its error depends on where and in which direction you travel and stays within about half a percent.
Calculated in the browser on the WGS 84 ellipsoid — the datum GPS uses — with Vincenty's formulae.
How to use
- Enter the latitude and longitude of two points, in decimal degrees or as degrees, minutes and seconds such as 51°28'12"N.
- Read the distance in kilometres, miles, nautical miles or metres, with the spherical figure and its error beside it.
- Use the initial bearing to set off and the final bearing to know which way you will be heading on arrival.
- Switch to the destination mode to go the other way: from a start, a compass bearing and a distance to the end point.
- Try the examples to see how much a great-circle route bends: the midpoint of New York to London lies far north of either city.
About this tool
ShowHide
Enter two latitude and longitude pairs and get the distance between them along the ellipsoid GPS uses, the bearing to set off on and the bearing you arrive on, and the point halfway along the route — or give a start, a bearing and a distance and get where you end up. The distance is the geodesic on the WGS 84 ellipsoid, computed with Vincenty's formulae, and it was checked against GeographicLib, the reference implementation of Karney's algorithm: across three thousand random pairs it agreed to within a tenth of a millimetre and to a hundred-millionth of a degree in bearing. Beside it the tool shows the haversine distance on a sphere of the mean Earth radius, the formula most online calculators and most code snippets use, and the percentage by which it misses. The miss depends on where you are and which way you go: JFK to Heathrow comes out 0.27% short on the sphere, a route along a meridian 0.27% long, and short hops near the poles close to half a percent out. The initial and final bearings differ because a geodesic — the shortest route over the curved surface — is not a line of constant compass heading; flying from New York to London you leave heading northeast at 51° and arrive heading east of southeast at 108°. The midpoint is the point halfway along that route, not the average of the coordinates, which lies somewhere else entirely for long distances. One case is handled honestly rather than hidden: for points almost exactly opposite each other on the globe, many routes of nearly equal length join them and Vincenty's iteration does not settle, so the tool says so and gives the spherical estimate instead. Coordinates can be typed in decimal degrees or in degrees, minutes and seconds with a hemisphere letter.
Frequently asked questions
Why is this different from the distance other calculators give?
Most use the haversine formula on a spherical Earth, which is simple but ignores the flattening at the poles: the Earth is about 21 km wider across the equator than from pole to pole. The error is up to about half a percent — some 28 km on a 5,500 km flight. This tool computes on the WGS 84 ellipsoid, the model GPS itself uses, and shows the spherical figure alongside so you can see the difference.
Why do the initial and final bearings differ?
The shortest path over a curved surface, a geodesic, keeps changing its compass heading. A route of constant heading, a rhumb line, is easier to steer but longer, often by hundreds of kilometres on transoceanic routes. The initial bearing is the direction to start in; the final bearing is the direction you are travelling as you arrive.
How accurate is it?
Vincenty's method is accurate to within half a millimetre on the ellipsoid, which is far below the uncertainty of any real coordinate. The results here were compared with GeographicLib on thousands of random pairs and agreed to within a tenth of a millimetre. The ellipsoid itself is a model: heights above it and local gravity make real survey distances differ slightly.
What happens with points on opposite sides of the globe?
For nearly antipodal points many routes of almost identical length exist and Vincenty's iteration does not converge. Rather than print a wrong number, the tool says so and gives the spherical estimate, which is within about half a percent. Karney's newer algorithm handles these cases, and the tool's other results were checked against it.
Is the midpoint the average of the two coordinates?
No. Averaging latitudes and longitudes gives a point on neither the shortest route nor any meaningful path, and for long distances it can be thousands of kilometres off. The midpoint here is found by travelling half the geodesic distance from the first point along its initial bearing.
Related tools
GPS Coordinates Converter
Convert latitude/longitude between decimal degrees, DMS (40°42'46"N), and DMM (40°42.7666'N). Generate Google Maps and geo: URIs.
Convert
UTM & MGRS Coordinate Converter
Convert latitude/longitude to UTM and MGRS and back on WGS 84, with the grid zone, band letter, meridian convergence and point scale factor.
Convert
Slope & Line Calculator
From two points, get the slope, the line equation y = mx + b, the distance, midpoint, angle of inclination, and rise/run.
Math & Statistics
Dew Point & Humidity Calculator
Calculate the dew point and absolute humidity from temperature and relative humidity using the Magnus formula, with a comfort rating in °C or °F.
Everyday
Air-Core Coil Inductance Calculator
Inductance of a single-layer air-core coil from diameter, length and turns using Nagaoka's exact coefficient, or the turns needed for a target inductance.
Science & Engineering
Molar Mass Calculator (from chemical formula)
Calculate the molar mass and percent composition of any chemical formula, with parentheses and hydrates, in your browser.
Science & Engineering