Premium apps Part of RavingDesk
RavingDesk Geodesic Distance & Bearing Calculator
Exact distance, bearings and midpoint between coordinates or along a route on WGS84.
Try an example: Brandenburg Gate (Berlin) to the Eiffel Tower (Paris) · A walk past seven Berlin landmarks · Vincenty’s nearly antipodal test line (d) on the International ellipsoid · Mixed notations: MGRS, UTM and a plus code
How it works
Measures the shortest path between two or more points on the WGS84 ellipsoid with Karney’s geodesic algorithm (nanometre accuracy, also for nearly antipodal points where Vincenty’s method fails): leg distances, initial and final bearings, midpoints, the total route length and how far the spherical Haversine formula is off. Coordinates can be written in decimal degrees, DMS, UTM, MGRS, plus codes or Maidenhead. It is the distance engine of RavingDesk’s Data & charts geo layer.
- Each leg solves the inverse geodesic problem on the chosen ellipsoid with Karney’s algorithm (6th-order series in the third flattening, Newton iteration on the azimuth, astroid start for nearly antipodal points). Accuracy is about 15 nanometres on WGS84.
- The initial bearing is the azimuth at the start of the leg; the final bearing is the forward azimuth on arrival. Both are measured clockwise from true north (not magnetic north). The midpoint lies half the leg distance along the geodesic.
- For comparison every leg is also computed with the Haversine formula on a sphere of radius 6,371,008.8 m (IUGG mean radius). The difference is typically up to about 0.5 % and depends on direction and latitude.
- Coordinates may be decimal degrees, DMS or DDM with N/S/E/W, UTM/UPS, MGRS, plus codes or Maidenhead locators. MGRS, plus codes and locators stand for a square; the centre of the square is used.
- Heights are ignored: distances are measured on the ellipsoid surface, not along the terrain.
Sources
- Algorithms for geodesics (J. Geodesy 87, 43–55) (C. F. F. Karney, 2013)
- GeographicLib (MIT licence) — geodesic routines transcribed by the engine (C. F. F. Karney)
- Direct and inverse solutions of geodesics on the ellipsoid with application of nested equations (Survey Review 23, 88–93) (T. Vincenty, 1975)
- Test set for geodesics (C. F. F. Karney (Zenodo))
Part of RavingDesk
-
RavingDesk Paper trading & data workspace
Practise trading on paper and chart your data: orders, risk, datasets, analyses, reports.
Related tools
- RavingDesk Coordinate Converter (DMS, UTM, MGRS, plus codes) – Convert coordinates between DD, DMS, UTM/UPS, MGRS, geohash, Maidenhead and plus codes.
- RavingDesk GPS File Converter (GPX ↔ KML ↔ GeoJSON) – Convert GPX, KML and GeoJSON, simplify tracks and get length, climb, descent and duration.
- RavingDesk GeoJSON Validator & Inspector – Validate and repair GeoJSON (RFC 7946) and measure areas and lengths on WGS84.
- Geo Data Visualizer – Map CSV coordinates or GeoJSON as points, proportional circles, hex-bin heatmaps or choropleths.
How to use the RavingDesk Geodesic Distance & Bearing Calculator
Measure the exact distance, bearings and midpoint between coordinates, or the length of a route, on the WGS84 ellipsoid instead of a sphere.
What it is for
Most "distance between coordinates" calculators treat the Earth as a perfect sphere. The Earth is slightly flattened, so a spherical formula such as Haversine can be off by up to about half a percent, and by different amounts in different directions. That is fine for a rough estimate. It is not fine when you check a survey, plan a flight leg, compare GPS logs or need a number that agrees with professional GIS software.
This calculator measures on the WGS84 ellipsoid (the one GPS uses) with Karney's geodesic algorithm. It works for any pair of points, including nearly opposite points where the older Vincenty method fails to converge. Enter two points for a single distance, or a list of points for a route, optionally closed back to the start. You can type coordinates in decimal degrees, degrees-minutes-seconds, UTM, MGRS, plus codes or Maidenhead locators, and mix them.
It does not follow roads or terrain. The distance is along the ellipsoid surface, and heights are ignored.
Worked example
From New York JFK to London Heathrow, entered as 40°38′23″N 73°46′44″W and 51.4700, -0.4543:
| Result | Value |
|---|---|
| Geodesic distance | 5,555.070 km |
| Haversine (sphere) | 5,540.181 km |
| Difference of the sphere | −14,889.8 m (−0.268 %) |
| Initial bearing | 51.3804° |
| Final bearing | 107.9817° |
| Midpoint | 52.236882, −41.291288 |
The sphere comes out almost 15 km short on this transatlantic leg. The bearings show how a long geodesic curves on a map: you leave JFK heading north-east (about 51°) and arrive in London heading east-south-east (about 108°). The midpoint lies far north, over the Atlantic south of Greenland. The "Points as read" table confirms that the DMS text was read as 40.6397222, −73.7788889.
For a route, the built-in example walks past seven Berlin landmarks: 4.156 km in six legs, against 4.148 km on the sphere. The direct distance from the Reichstag to the TV Tower is 2.276 km.
How to read the result
- Geodesic distance / Route length is the shortest path on the ellipsoid, summed over all legs. This is the number to use.
- Haversine (sphere) is the same route on a sphere with the mean Earth radius. The difference shows how much the simple formula would be off.
- Initial and final bearing are measured clockwise from true (geographic) north. On long legs they differ, because the shortest path is not a line of constant compass heading.
- The Legs table lists each leg with its cumulative distance. Points as read shows how each coordinate was understood and in which notation.
Tips and common mistakes
- Separate latitude and longitude with a comma. Hemisphere letters (N, S, E, W) may come before or after the numbers.
- Latitude comes first unless you use hemisphere letters.
13.405, 52.52is read as a point in the Indian Ocean, not Berlin. - MGRS, plus codes and locators stand for squares. The centre of the square is used, and a warning appears for squares larger than 100 m.
- Add the local magnetic declination before you use a bearing with a compass.
- The ellipsoid setting matters only for old maps. GPS and web maps use WGS84, which matches GRS80 to well under a millimetre.
FAQ
How accurate is it?
Karney's algorithm is accurate to about 15 nanometres on WGS84. The tool reproduces Vincenty's published 1975 test lines and the GeographicLib test set, including nearly antipodal lines.
Why not just use Haversine?
Haversine is simple and usually within 0.5 %, but the error depends on direction and latitude. Over 5,000 km that can be 15 km, as in the example above.
Can I measure a closed area's perimeter?
Yes. List the corners and tick "Return to the first point". For the area itself, use the RavingDesk GeoJSON inspector.
Where can I see the route on a map?
In RavingDesk's Data & charts, add a Geo layer step to a table of points. It shows the same distances on an offline map.
Guide last updated:
For scripts and AI agents
- JSON API:
POST https://ravingdeskgeodesicdistance.usefulweb.site/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://ravingdeskgeodesicdistance.usefulweb.site/mcp· tool nameravingdesk_geodesic_distance
Example request
curl -s -X POST https://ravingdeskgeodesicdistance.usefulweb.site/api/v1/calculate \
-H 'content-type: application/json' \
-d '{"points":[{"label":"Brandenburg Gate","coordinate":"52.516275, 13.377704"},{"label":"Eiffel Tower","coordinate":"48.858222, 2.2945"}]}'