Calculators

GPX elevation analyzer (total ascent, descent, profile)

Last reviewed: Hilly & Kriss

Your file never leaves your device: it is parsed locally in the browser. Elevation gain uses a hysteresis filter: a climb only counts once the elevation has moved by more than the threshold.

Key takeaways

  • The analyzer reads a GPX file in your browser, nothing is uploaded, and reports distance, filtered and raw elevation gain and loss, min and max elevation, the steepest 100 m and a profile.
  • Raw gain adds every small rise, so GPS noise inflates it. The default 3 m hysteresis filter only counts a change once elevation has moved more than 3 m from the last reference point.
  • On a sample climb of 10 m with 1 to 2 m of noise, raw gain is +14 m while the 3 m filter gives +10 m.
  • Distance is the horizontal great-circle distance (haversine, Earth radius 6,371,008.8 m); elevation does not lengthen it.
Handheld Garmin eTrex Legend GPS receiver used on a mountain walk in the Maramureș Mountains, Romania
Image: Martin Kozák, Public domain, via Wikimedia Commons

The GPX elevation analyzer reads a GPX track in your browser and reports its distance, elevation gain and loss (raw and filtered), minimum and maximum elevation, the steepest 100 m and an elevation profile. The file is never uploaded. The default 3 m noise threshold removes most of the false climbing that GPS jitter adds to raw totals.

How to use it

  1. Export a GPX file from your watch, bike computer, phone app or route planner.
  2. Choose it with the file button. The results and profile appear immediately.
  3. Change the noise threshold (0, 2, 3, 5 or 10 m) to see how sensitive the total ascent is to filtering. Results update without reloading the file.

The analyzer uses trkpt track points; if the file has none, it uses rtept route points, and failing that wpt waypoints. Points without latitude, longitude or a numeric ele value are skipped. GPX 1.1 stores elevation in metres.

The formulas used

Distance between consecutive points uses the haversine formula on a sphere with the mean Earth radius:

a = sin²(Δφ/2) + cos φ1 x cos φ2 x sin²(Δλ/2)
d = 2 x R x asin(√a)          R = 6,371,008.8 m

Elevation gain uses a hysteresis filter with threshold T:

ref = first elevation
for each elevation e:
  if e - ref > T:  gain += e - ref;  ref = e
  if ref - e > T:  loss += ref - e;  ref = e

Raw gain and loss are the same loop with T = 0. The steepest 100 m is, for each point, the elevation change to the first point at least 100 m further along, divided by that distance; the largest absolute value is reported, so it can be a climb or a descent.

Worked example

A short climb recorded as ten points with noise of 1 to 2 m: 100, 102, 101, 103, 102, 105, 104, 108, 107, 110 m. The true net climb is 10 m.

Threshold Gain Loss Comment
0 m (raw) +14 m -4 m Every wobble counts
2 m +8 m 0 m Last 2 m rise not yet confirmed
3 m (default) +10 m 0 m Matches the real climb
5 m +8 m 0 m Small steps merged; final 2 m pending
10 m 0 m 0 m Threshold equals the whole climb

The filter does not change smoothly with the threshold: a rise smaller than the threshold at the end of the track is never confirmed, so it is not counted. On a real route of thousands of points the effect averages out, but raw gain is almost always higher than filtered gain.

A quick distance check: two points 0.001° of latitude apart are 111.19 m apart with R = 6,371,008.8 m.

Interpreting the result

  • Filtered gain is the figure to use for planning, for example in the Naismith hiking time calculator.
  • Raw gain shows how noisy the recording is. A large gap between raw and filtered means the elevation data is jittery.
  • Steepest 100 m is computed on unfiltered elevations, so a single bad point can create a false spike. Treat it as an upper bound and compare with the gradient calculator on two map heights.

Limits and assumptions

  • Horizontal distance only. Elevation is not added to distance. On a 20 % slope the distance along the ground is about 2 % longer.
  • Segments are kept separate for distance. Multiple tracks or segments (trkseg) are read in order, but the straight-line gap between two segments is not counted as distance. GPX 1.1 starts a new segment when reception is lost, so this avoids phantom distance; the elevation change across the gap is still counted in gain and loss.
  • Timestamps are ignored. The tool does not compute speed, moving time or VAM; use the VAM calculator for that.
  • Elevation quality. No filter can fix a biased altimeter or a GPS height that is 20 m off. Replacing heights with a DEM is often more accurate; see GPS elevation accuracy and elevation data sources.

For deeper analysis, open-source tools such as GPXSee, GpsPrune and the Python library gpxpy read the same files; the open-source elevation tools page compares them.

Frequently asked questions

Why does my elevation gain differ between apps?

Each app smooths or filters elevation differently, and some replace GPS heights with a terrain model. Without filtering, small noisy ups and downs add up to tens or hundreds of metres of false climbing over a long route.

Which noise threshold should I use?

Start with 3 m. Barometric altimeter tracks are smooth and suit 2 to 3 m; GPS-only elevation is noisier and often needs 5 m or more. A threshold larger than the real climbs will hide them.

Is my GPX file uploaded?

No. The file is parsed by JavaScript in your browser with the built-in XML parser; it never leaves your device.

Does the analyzer read routes and waypoints?

Yes. It uses track points and route points; if the file has neither, it falls back to waypoints. Points without an elevation are skipped.

Sources and open data

  1. GPX 1.1 Schema Documentation, TopoGrafix
  2. Haversine formula, Wikipedia
  3. GPXSee, open-source GPS log file viewer and analyzer, GPXSee project
  4. GpsPrune, open-source application for viewing and editing GPS data, activityworkshop.net
  5. gpxpy, GPX parser for Python, GitHub