1.0.0Local calculation

Route elevation profile: read a GPX file locally

Read GPX or GeoJSON, calculate distance, gain, loss, elevation range and maximum grade, and show a downsampled profile. Missing elevation stays unknown rather than becoming zero.

Read the elevation profile

Choose a GPX or GeoJSON file. It is read in this browser only and is never uploaded.

GPX and GeoJSON supported; missing elevation is not treated as zero.

Choose a file, then analyse it.

Formula and conditions

What this tool does

Choose a local GPX or GeoJSON file. The tool reads the track in this browser, calculates total distance, cumulative gain and loss, minimum and maximum elevation, the largest absolute point-to-point grade, and draws an elevation profile. The file is not uploaded and no account is required.

It is useful for understanding the shape of a route before heading out or reviewing the elevation structure of a recorded activity. It is not race certification, a safety assessment or a navigation tool.

How distance, gain and grade are defined

Distance is the sum of WGS84 great-circle distances between consecutive points within each segment. Segments are measured independently and their endpoints are not joined. Gain is the sum of all positive elevation differences; loss is the sum of the absolute negative differences.

Grade is Δelevation / horizontal distance × 100%. To avoid amplifying noise from points that are very close together, grade is calculated only for pairs at least 5 metres apart. The maximum grade is therefore a point-pair estimate, not a road-design grade or a whole-climb average.

Missing elevation and GPS noise

If the file has no elevation, or only some points have it, the tool shows gain, loss and profile as unknown instead of treating missing values as zero; otherwise it would undercount climbing. GPS elevation also drifts, and different devices, barometers and correction algorithms can produce different totals.

When comparing two routes, prefer the same source and the same elevation method. Do not mix corrected and uncorrected numbers without saying so.

Using the result

Start with the distance and climb magnitude, then look for steep climbs, descents and long gradients in the profile. Read them alongside aid stations, surface and weather. For a race, the organiser's route, mandatory kit and technical notes remain authoritative; a GPX file alone cannot establish safety.

Parsing happens locally. Results are not saved after the page closes. Oversized or malformed files return an error rather than a partial result.

Tool limits

This tool does not verify that a track is the official course, that access is permitted or that the route is suitable for a race. It does not assess rockfall, traffic, weather or technical difficulty. Technical trails, glaciers or roped routes require specific training and local information.

Sources and scope

GPX and GeoJSON format boundaries follow the public specifications; uphill and downhill mechanics follow a sports-biomechanics review. Elevation values come from the file; the tool does not guarantee device accuracy or route safety.

Implementation specification (English)

These fields support implementation and review. The article text explains them in the page language.

Formula and conditions
Parse GPX or GeoJSON locally, compute horizontal distance between consecutive points in each segment with the WGS84 haversine formula, sum positive and negative elevation differences, and compute grade = (Δelevation / horizontal distance) × 100 for pairs at least 5 metres apart. If any point lacks elevation, gain, loss and profile are returned as unknown rather than undercounted. Profile is downsampled to at most 160 points for display.
Assumptions
  • Elevation values in the file are treated as supplied; GPS elevation is noisy.
  • Separate segments are measured independently and are not joined.
  • Grade is a point-to-point estimate, not a smoothed road design grade.
  • The file is read in the browser only and is not uploaded.
  • The tool does not certify a route or assess surface, technicality or safety.
Rounding
Distance, gain and loss to the nearest metre; elevations to one decimal place; grade to one decimal place; profile points keep whole-metre distance and two-decimal elevation.

Independent examples

Expected values come from independent arithmetic or verified algorithms, not from the page script.

case-route-elevation-hillIndependent examples

Independent elevation arithmetic from the supplied points: +100 m then -100 m; the near-111 m horizontal step gives a grade near 90%, so the expected maximum absolute grade is at least 80%.

Input
{
  "track": {
    "format": "gpx",
    "segments": [
      [
        {
          "lon": 0,
          "lat": 0,
          "elevation": 0
        },
        {
          "lon": 0,
          "lat": 0.001,
          "elevation": 100
        },
        {
          "lon": 0,
          "lat": 0.002,
          "elevation": 0
        }
      ]
    ]
  }
}
Expected
{
  "gainMeters": 100,
  "lossMeters": 100,
  "minElevationMeters": 0,
  "maxElevationMeters": 100,
  "maxGradePercentAtLeast": 80,
  "profilePoints": 3
}
case-route-elevation-missingIndependent examples

No elevation values are present, so gain, loss and profile must remain unknown rather than becoming zero.

Input
{
  "track": {
    "format": "gpx",
    "segments": [
      [
        {
          "lon": 0,
          "lat": 0,
          "elevation": null
        },
        {
          "lon": 0,
          "lat": 0.001,
          "elevation": null
        }
      ]
    ]
  }
}
Expected
{
  "gainMeters": null,
  "lossMeters": null,
  "profilePoints": 0,
  "warning": "elevation-missing"
}

Sources and evidence

GPS Exchange Format (GPX) 1.1

GPX is an XML schema for exchanging GPS data. GPX 1.1 defines track, route and waypoint structures with latitude, longitude and optional elevation.

TopoGrafix · Accessed 26 Oct 2026

RFC 7946: The GeoJSON Format

GeoJSON defines JSON-based geospatial objects including LineString coordinates. GeoJSON coordinates use longitude, latitude order and positions may include elevation.

Internet Engineering Task Force · Accessed 26 Oct 2026

Biomechanics and Physiology of Uphill and Downhill Running

Uphill running has a higher step frequency, shorter swing and aerial phase, and greater duty factor than level running. Downhill running has longer aerial time, lower step frequency and more rear-foot striking than level running. Downhill running emphasises eccentric work and energy dissipation; uphill running requires greater muscular work, particularly at the hip.

Sports Medicine · Accessed 27 Oct 2026

Version and checks

Written by: RunMap Editorial

Updated: 28 Oct 2026

Checked: 28 Oct 2026

Back to all tools