TrailCam

Guides

How to convert a GPX file to CSV

The request sounds simple — you have a GPX track and you want it in a spreadsheet — but "convert" is doing more work than it looks like. A GPX file and a CSV file are not two containers for the same information; they hold different things, and turning one into the other only ever produces what was already there to begin with. Here is what a GPX-to-CSV conversion actually gives you, and where it falls short of what most people are really after.

The short answer

There is no format that converts itself. You need a tool that can read the XML inside a GPX file and write it back out as rows and columns — a GIS tool such as QGIS, a browser-based GPX editor, or a short script are the usual routes. Any of them will read the points inside the file and hand you a table. What that table contains depends entirely on what was inside the GPX file to start with, which is the part worth understanding before you bother converting anything.

"Convert" can mean two different things

A GPX file is a list of recorded points — coordinates, elevation, a timestamp — nothing more. Convert it mechanically and you get a per-point CSV: one row for every point in the file, columns for latitude, longitude, elevation and time, often thousands of rows for a single hike. That is a faithful conversion, but it is rarely what someone means when they say they want their hike in CSV.

What most people actually want is a summary — one row per hike, with distance, duration, pace and elevation gain as columns. A GPX file never contains any of those numbers. Distance, duration and pace are calculations, worked out by whatever app recorded or replayed the route; a raw GPX file has no field for them at all. Converting a GPX file cannot produce a summary CSV, because the summary was never in the file to extract in the first place.

Getting a per-point CSV

A GIS tool that can open GPX as a layer will usually let you export its attribute table as CSV directly, one row per track point. This is the right output if you actually want to work with the raw geometry — checking gaps in the recording, plotting elevation against distance yourself, or feeding the coordinates into some other analysis. It is a large, plain file with exactly four useful columns and nothing computed for you.

Getting a summary instead

If what you actually want is distance, duration, pace and elevation gain in a spreadsheet, the shorter path is an app that already computed those numbers while or after recording, and can export the summary as CSV directly. That skips the conversion step entirely, because there is nothing to convert — the numbers exist already, and exporting just writes them to a file rather than deriving them from raw points after the fact.

Things that trip people up

  • Expecting a converted CSV to include distance or pace — it will not, unless the tool doing the converting also computed those figures itself rather than just reformatting the raw points.
  • A single hike producing thousands of rows and looking like something went wrong — that is normal for a per-point conversion; one row per recorded point is exactly what a GPX file contains.
  • Column headers differing between two conversion tools — CSV has no defined schema the way GPX does, so every tool is free to name and order its columns however it likes.
  • An elevation column that comes out empty — if the source GPX itself has no elevation values, no converter can invent them.

Where TrailCam fits in

TrailCam records distance, duration, pace and elevation gain as you walk, and exports a CSV summary directly — for a single route or the whole history at once — alongside the same route as GPX 1.1. Getting the numbers into a spreadsheet never actually requires converting a GPX file after the fact; the CSV export already has them. Export is part of the optional TrailCam Pro upgrade; the app itself is free to download.

Questions

Does converting a GPX file to CSV give me distance and pace?
Not on its own. A GPX file only ever holds coordinates, elevation and time. Distance and pace are calculations an app makes from those points; a converter that just reformats the file has nothing to compute them from.
Why does a converted CSV have thousands of rows instead of one row per hike?
Because that reflects what is actually inside a GPX file — a list of individual points, not a summary. A one-row-per-hike table requires an app that already worked out the totals, not a straight conversion.
Is there a standard CSV format for trail data?
No. GPX has one defined structure every reader agrees on. CSV is just a table, so column names and order vary depending on whatever tool produced it.

Recording your own routes

TrailCam is an iPhone app that records your route with GPS, keeps video clips, photos and voice notes pinned to the spot where you took them, and exports the result as GPX 1.1 or CSV. It is free to download.

Download on the App Store