BYTETOOLS

Cross Track Distance Calculator

Find how far a point lies off a planned great-circle leg, the along-track distance, the closest point on course and whether you overshot.

Cross-track distance is how far off the planned great-circle leg you are; along-track distance is how far down the leg your closest point sits. Positive cross-track means you are to the right of the course. Spherical maths, WGS-84 coordinates.

Leg start

Leg end

Your position

0.308
Off course (km)
Left
Side of the track
62.332
Along the leg (km)
124.801
Leg length (km)

Sketch

Green is the leg start, red the leg end, purple your position, and the dashed amber line is the shortest way back to the course. Drawn to scale from your own coordinates — no map tiles are loaded.

Off-course report

0.308 km left of the course

Cross-track distance (signed)
-307.55 m · -0.1661 nmi
Along-track distance
62.3316 km from the start
Remaining along the leg
62.4695 km
Closest point on the course
53.258353, -0.797743
Closest point in DMS
53°15'30.07"N 0°47'51.88"W
Bearings
Leg 96.00° E, to you 95.72° E
Direct distance from the leg start
62.3323 km
Direct distance to the leg end
62.4703 km

What is the Cross Track Distance Calculator?

Cross-track distance is the standard aviation and marine off-course check: given a leg between two waypoints and your current position, how far to the side of the intended track are you, and how far along it have you got?

  • Signed cross-track distance, so you know whether you are left or right of the course
  • Along-track distance from the leg start and the distance remaining to the end
  • Coordinates of the closest point on the course, in decimal degrees and DMS
  • Warns when the closest point falls beyond either end of the leg
  • Leg bearing, bearing to your position, and direct distances from both endpoints
  • Canvas sketch of the geometry, computed entirely in your browser

How to use the Cross Track Distance Calculator

  1. 1

    Enter the coordinates of the leg start and the leg end.

  2. 2

    Enter your current position in the third pair of boxes.

  3. 3

    Choose a distance unit — kilometres, metres, nautical miles or miles.

  4. 4

    Read how far off course you are, which side you are on, and how far along the leg you have come.

  5. 5

    Copy the report, or use the closest-point coordinates to steer back onto the track.

About the Cross Track Distance Calculator

Cross-track distance is the standard aviation and marine off-course check: given a leg between two waypoints and your current position, how far to the side of the intended track are you, and how far along it have you got? This calculator returns both, using the published spherical formulas — an arcsine expression for the perpendicular offset and the matching arccosine expression for the along-track distance.

It also gives the closest point on the course itself, so you know where to aim to rejoin, and warns you when that point falls before the start or beyond the end of the leg — the case where the nearest waypoint is an endpoint rather than a point on the line. The sign of the cross-track distance tells you which side you are on: positive is right of the course, negative is left.

A canvas sketch drawn from your own three points shows the leg, your position and the perpendicular back to it. There is no map layer and nothing is fetched or uploaded; the whole calculation runs in your browser.

Frequently asked questions

What is cross-track distance?

It is the perpendicular distance from your position to the planned course line, measured along the surface of the Earth. Aviation instruments call it cross-track error or XTE, and it is the number an autopilot works to drive back to zero.

What does a negative cross-track distance mean?

The sign tells you which side of the course you are on. In this tool, positive means you are to the right of the direction of travel and negative means you are to the left, matching the usual convention in navigation software. Turn toward the opposite side to close the gap.

What is along-track distance used for?

It tells you how far down the leg your closest point sits, which is how progress and estimated time of arrival are worked out. Subtract it from the leg length and you have the distance still to run, even though you are not physically on the line.

What if the closest point is past the end of the leg?

Then you have overshot the waypoint, and the true nearest point of the segment is the endpoint itself rather than anything on the line. The tool flags this explicitly, because the raw formula happily reports an along-track distance longer than the leg.

Is this calculation spherical or ellipsoidal?

Spherical, on a mean radius of 6,371,008.8 metres. For the leg lengths where a cross-track check is meaningful, the difference from an ellipsoidal computation is far smaller than the position error of the GPS fix you fed in.

Related tools