GPX to CSV Converter
A GPX to CSV converter turns a GPS file into spreadsheet rows. This one reads all three kinds of point a GPX can hold, waypoints, track points and route points, with a type column saying which is which, keeps the track and segment each point came from, and flattens Garmin's heart rate and cadence extensions into ordinary columns. Nothing is uploaded.
Want to compute pace, split by segment or chart it? Open the app
The empty-file problem
A GPX file can hold three completely different things, and most converters read one of them.
<wpt> elements are standalone waypoints: saved places, photo stops, a list of huts. <trkpt> elements are recorded track points, nested inside a <trkseg> inside a <trk>. <rtept> elements are planned route points inside a <rte>.
A converter that only walks the track structure hands back an empty table for a file of saved places. One that only reads top-level waypoints hands back an empty table for a recorded ride. Both failures look identical from the outside, and both are the reason people try four tools before finding one that works.
All three are read here, into one table, with a type column holding waypoint, track or route. If you want only one kind, the filter is a dropdown rather than a different tool. And if a filter removes every row, the error says how many points were in the file before it, which is more useful than an empty table.
A worked example
A ride file with one waypoint, two track points carrying Garmin extensions, and a route point:
<wpt lat="51.5079" lon="-0.0877">
<ele>8.0</ele><name>Start</name><sym>Flag</sym>
</wpt>
<trk><name>Thames path</name><trkseg>
<trkpt lat="51.5071" lon="-0.0962">
<ele>7.4</ele><time>2024-11-03T07:04:38Z</time>
<extensions><gpxtpx:TrackPointExtension>
<gpxtpx:hr>118</gpxtpx:hr><gpxtpx:cad>74</gpxtpx:cad>
</gpxtpx:TrackPointExtension></extensions>
</trkpt>
</trkseg></trk>
<rte><name>Return</name>
<rtept lat="51.4989" lon="-0.1298"><name>Vauxhall</name></rtept>
</rte>
becomes:
type,latitude,longitude,elevation,time,name,symbol,track,segment,cad,hr
waypoint,51.5079,-0.0877,8.0,,Start,Flag,,,,
track,51.5071,-0.0962,7.4,2024-11-03T07:04:38Z,,,Thames path,1,74,118
route,51.4989,-0.1298,,,Vauxhall,,Return,,,
The hr and cad columns come from the extensions block. Garmin nests those two levels deep behind a namespace prefix, and keeping the full path would give you a column heading of gpxtpx:TrackPointExtension.gpxtpx:hr, which nothing downstream expects. The leaf name is what every analysis script and every other tool already uses.
The track column carries the track's name and segment its position within it, so a multi-day file with four tracks in it stays separable. A route point borrows the same column for the route name, since the two never appear on the same row.
What is kept, dropped and left alone
Kept: coordinates from the lat and lon attributes, elevation, time exactly as the file wrote it, name, description (falling back to the comment element when there is no description), symbol, and every extension leaf.
Dropped: columns that are blank in every row. A file of waypoints has no track or segment column; a file with no heart rate has no hr. Emitting the full set every time would mean six dead columns on most exports.
Left alone: row order and timestamps. Track points come out in the order the device recorded them, because that order is the data and re-sorting it would be a change made behind your back. Times are passed through as written rather than reformatted, so an ISO timestamp from your watch arrives in your spreadsheet as an ISO timestamp.
A point with no lat or lon attribute cannot be placed, so it is skipped, counted and named in the warnings. That is rare in files from real devices and common in files assembled by hand.
Namespace prefixes are ignored throughout. Files in the wild mix the topografix namespace, Garmin's extension namespaces and sometimes no namespace at all, and matching on local names means the reader does not care which your device chose.
Hand a KML file to this page and you get a message pointing you at the KML to CSV converter rather than a complaint about a missing gpx element. The two file types look similar enough from the outside that the mix-up is worth catching by name.
Questions
Why does my file come back empty in other converters?
Because most of them read only one of the three point kinds a GPX file can hold. A converter that reads only trkpt returns nothing for a file of saved waypoints; one that reads only wpt returns nothing for a recorded ride. Both look like the tool is broken and both are common. This one reads waypoints, track points and route points, with a type column saying which each row came from.
Are heart rate and cadence included?
Yes, when the file has them. Garmin devices write them into an extensions block nested two levels deep, and only the leaf name is kept, so you get columns called hr, cad and atemp rather than an unreadable prefixed path. Those are the names every analysis script already expects. The warning lists which extension fields were found so you know what turned up.
Can I tell which track a point belongs to?
Yes. A track column carries the track's name, and a segment column carries the segment number within it. A multi-day GPX with four tracks in it is unusable as one undifferentiated list of forty thousand rows, and the track name is often the only label distinguishing them.
Can I read just the waypoints?
Yes, there is a filter for exactly one of the three kinds, or all of them together. Filtering to waypoints on a recorded activity is the usual case: the saved photo stops and the trailhead are what you want, not the fourteen thousand samples between them. If your filter removes everything, you are told how many points existed before the filter rather than being shown an empty result.
Are empty columns removed?
Yes. A column that is blank in every row is dropped before the CSV is written, so a waypoint-only file has no track or segment column and a file with no elevation data has no elevation column. Six dead columns on every export is the kind of clutter that makes people stop trusting a tool.
What order are the rows in?
Document order, which for track points is the order they were recorded. Waypoints come first, then track points grouped by track and segment, then route points. Nothing is re-sorted, because the file order is meaningful for a track and re-ordering it would be a change made silently. If you want them sorted by time, do it in the app or in your spreadsheet.
Is my GPS file uploaded?
No. Parsing happens in your browser tab with the browser's own XML parser. Nothing is sent anywhere, nothing is stored between visits, and there is no row cap. A GPS trace says where you live, when you leave the house and what route you take, so a tool that never receives it is the right default rather than a feature.
Related
Convert your GPX to CSV
No sign-up, no upload, no row cap. All three point kinds, track names kept, extensions flattened.
Back to the converter