GPX to CSV converter

Paste a GPX file to analyse a walk or trip in Excel or import its points into another system.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter xml text and delimiter.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

Points wpt (waypoints), trkpt (track) and rtept (route) are read with their lat and lon attributes and ele, time and name elements. Track length is the sum of haversine distances between consecutive points within each trkseg: d = 2R x asin(sqrt(sin²(Δφ/2) + cos φ1 x cos φ2 x sin²(Δλ/2))) with the mean Earth radius R = 6371.0088 km.

Example

Inputs: Delimiter = Comma ,. Result: CSV: type,lat,lon,ele,time,name wpt,21.4225,39.8262,,,المسجد الحرام trkpt,24.7136,46.6753,612,2026-09-01T05:00:00Z, trkpt,24.7146,46.6753,613,2026-09-01T05:01:00Z,; Points: 3; Track length: 0.111 km.

<gpx version="1.1" creator="ToolSahla">
  <wpt lat="21.4225" lon="39.8262"><name>المسجد الحرام</name></wpt>
  <trk>
    <name>مشي</name>
    <trkseg>
      <trkpt lat="24.7136" lon="46.6753"><ele>612</ele><time>2026-09-01T05:00:00Z</time></trkpt>
      <trkpt lat="24.7146" lon="46.6753"><ele>613</ele><time>2026-09-01T05:01:00Z</time></trkpt>
    </trkseg>
  </trk>
</gpx>
type,lat,lon,ele,time,name
wpt,21.4225,39.8262,,,المسجد الحرام
trkpt,24.7136,46.6753,612,2026-09-01T05:00:00Z,
trkpt,24.7146,46.6753,613,2026-09-01T05:01:00Z,

Limits and caveats

  • Length uses a sphere of radius 6371.0088 km, so it can differ from ellipsoid results by up to about 0.5%.
  • Elevation change is not included, the distance is horizontal only.
  • Vendor extensions such as heart rate are not read.

Questions about this tool

Where do I get a GPX file?

Most sports and navigation apps, such as Strava and Garmin Connect, can export an activity as GPX. Open it in a text editor and copy the contents.

Why does the length differ from my app?

Apps may smooth the track, add elevation or drop pauses, while this tool sums straight distances between the recorded points as they are.

Are waypoints counted in the distance?

No, waypoints are single points listed in the table only. Length comes from trkpt points within each segment.