GNSS Simulator
Talk to an engineer
GNSS Simulator

GNSS ENGINEERING TOOLS

WGS 84 Geodesic Distance & Bearing Calculator

Calculate the shortest ellipsoidal surface distance between two latitude/longitude points. Read the initial, final forward and return bearings, then copy or export the results.

Enter two WGS 84 positions

Point A · start

Point B · destination

Enter geodetic decimal degrees. North and east are positive; south and west are negative. Latitude: −90° to +90°. Longitude: −180° to +180°. Scientific notation is accepted; DMS strings and hemisphere letters are not.

City coordinates are approximate examples, not surveyed reference positions. This tool uses no height, terrain, road routing or magnetic declination.

Distance & true bearings

Ellipsoidal surface distance · m —
Distance · km —
Initial bearing at A —
Distance · statute miles —
Final forward bearing at B —
Distance · nautical miles —
Back bearing at B toward A —

What distance is calculated?

The result is the length of a shortest geodesic on the WGS 84 reference ellipsoid. The inverse calculation uses Karney’s algorithm through GeographicLib, including its treatment of nearly antipodal endpoints.

WGS 84 semi-major axis a = 6,378,137 m
Flattening f = 1 / 298.257223563
km = distance(m) / 1000
statute miles = distance(m) / 1609.344
nautical miles = distance(m) / 1852

Coordinates must already use an appropriate common reference frame and epoch. This page performs no datum transformation, plate-motion correction or survey adjustment. Displayed digits do not establish the accuracy of the input coordinates.

Read the three bearings correctly

Initial bearing at A: the departure direction of the A→B geodesic.

Final forward bearing at B: the direction of travel as that geodesic arrives at B, continuing forward from A.

Back bearing at B: the departure direction from B when retracing that same geodesic toward A. It is the final forward bearing plus 180°, reduced to a full circle.

Angles are degrees clockwise from geodetic north: 0° north, 90° east, 180° south and 270° west. They are normalized to [0°, 360°) and are not magnetic compass bearings. Over long routes, the back bearing at B is generally not the initial bearing at A plus 180°.

Coincident points, poles and antipodes

At coincident physical points, distance is zero and bearings are undefined. Longitudes +180° and −180° describe the same meridian; all longitudes at a given pole describe the same physical point.

If an endpoint is exactly at a pole, this interface omits bearings at that endpoint because local north has no unique physical direction there. A bearing at a nonpolar endpoint is retained when the shortest route is unique.

Some configurations have several equally short geodesics. On the oblate WGS 84 ellipsoid this includes opposite-latitude endpoints within part of the near-antipodal region, as well as exact nonpolar antipodes. Opposite poles have infinitely many shortest meridians. The distance remains defined; this tool marks the bearings as not unique instead of selecting one as a unique answer.

Very small coordinate separations can fall below floating-point resolution. If the engine returns zero for differing coordinates, the distance is marked approximately zero and the bearings are omitted.

Choose the distance model for your task

These quantities answer different geometric questions.
Quantity Meaning Calculated here?
Ellipsoidal geodesic Shortest path on the WGS 84 reference ellipsoid Yes
Spherical great-circle distance Shortest path on a chosen sphere No
ECEF chord / 3D separation Straight line through space between 3D positions No
Local ENU horizontal norm Separation projected into one local tangent plane No
Terrain, slope or road distance Path following elevation, terrain or a transport network No

Geodesic bearings change along a route. A constant-bearing rhumb line is another path model and is not calculated here.

Calculation engine and references

Calculations run in your browser using the pinned GeographicLib geodesic 2.2.0 engine. A static engine file is downloaded from jsDelivr; this calculator does not send your coordinate inputs in that request. If the download fails, calculation stays unavailable until a retry succeeds. There is no silent spherical fallback.

Method: GeographicLib JavaScript documentation, azimuth and output conventions, and geodesic geometry and multiple shortest paths. GeographicLib is by Charles Karney and is distributed under the MIT/X11 license.

Frequently asked questions

Which distance model does this calculator use?

It solves the inverse geodesic problem on the WGS 84 ellipsoid using GeographicLib geodesic 2.2.0 and Karney's algorithm. The result is an ellipsoidal surface distance. It does not substitute a spherical haversine result.

What is the difference between final and back bearing?

The final forward bearing is the direction of travel when the A-to-B geodesic arrives at B. The back bearing is the direction from B when retracing that route toward A. It equals the final forward bearing plus 180 degrees, normalized to a full circle.

Are these bearings magnetic or true?

They are clockwise from geodetic north, normalized to 0 degrees inclusive and 360 degrees exclusive. No magnetic declination is applied. Bearings at a polar endpoint are omitted by this interface; bearings for coincident points are undefined.

Does it work across the date line and near antipodes?

Yes. The ellipsoidal engine handles longitude wrap and nearly antipodal inverse calculations. Some endpoint configurations have multiple equally short geodesics. In those cases this tool retains the distance and omits non-unique bearings. Opposite poles also have non-unique shortest routes.

Can I use this as a 3D, terrain or road distance?

No. This version takes latitude and longitude only and measures a path on the reference ellipsoid. It does not use height or elevation data, calculate an ECEF chord, follow terrain, or query a road network. A local ENU horizontal norm is also a different quantity.

Are coordinates uploaded, and what happens if the engine cannot load?

The calculator uses coordinate inputs locally in the browser. It downloads a pinned static GeographicLib engine file from jsDelivr without sending coordinates in the request. If loading fails, the result is cleared; check the connection or download restrictions and select Calculate to retry. No approximate fallback result is substituted.

Validating GNSS positions or trajectories?

Share your coordinate frame, reference data, receiver and test objective to discuss an appropriate GNSS simulation or validation setup.

Discuss your test setup
Scroll to Top