GPX

What is a GPX file?

The universal track and route format. What every GPS watch and hiking app exports.

What GPX is

GPX is a plain-text format you can open in any editor. It is used for mapping and fitness tracking.

The extension is .gpx, and the full name is GPS Exchange Format. Both matter less than what the file can hold, which is what the rest of this page is about.

Where GPX came from

Topografix published it in 2002. The specification is GPX 1.1.

Age is worth knowing here for one practical reason: the older a format is, the more programs have had time to learn it.

The specification is public

It is published in full, so anyone can implement it from the document rather than by inspection, which is why it turns up in so many programs and why files written twenty years ago still open. A published specification is not the same thing as a royalty-free one: where a format wraps a codec, the patent licensing is a separate question the standard does not settle.

Nothing is thrown away

GPX stores its content exactly. Saving it again changes nothing, so it can be opened, edited and re-saved as often as you like without accumulating damage — which is what makes it a working format rather than a delivery one.

What opens GPX

Garmin BaseCamp, Strava and QGIS read it, and so do most programs of the same kind.

If a file will not open, the format is rarely the problem — it is more often that the program predates it. Converting to something older is the reliable way past that, and it is what the rest of this site is for.

Opening it in a browser

No browser reads it.

That is the single most common reason to convert it: not that the format is bad, but that the place you want to show the file cannot read it.

It is a working format

GPX is meant to be opened and changed. Keep the file in this format for as long as the work is going on, and export from it whenever a finished copy is needed.

Three different things live in a GPX file

Waypoints are single marked places: a car park, a summit, a water source. A route is an ordered list of points describing where you intend to go, with nothing said about time. A track is a recording of where you actually went — a dense series of points, each with a timestamp, usually one per second.

The distinction between a route and a track is the one that causes trouble. Load a track into a navigation device expecting a route and it may refuse, or try to give turn-by-turn directions along ten thousand points. Convert a track to a route and it has to be simplified to a few dozen. Knowing which you have is the first question, and any text editor answers it.

The format that every device agreed on

GPX is XML, it has been stable since 2004, and it is the one format every GPS watch, bike computer, hiking application and mapping site both reads and writes. That universality is why it exists at all: manufacturers each had a proprietary format and users wanted their data somewhere else.

It is deliberately minimal. A point is a latitude, a longitude, and optionally an elevation and a time. Everything beyond that — heart rate, cadence, power, temperature — lives in extensions, which are a defined escape hatch that different vendors have filled differently. That works, and it is why heart rate sometimes survives a transfer and sometimes does not.

Moving activities between platforms

This is the format’s daily job. Exporting from Strava, Garmin Connect, Komoot, Wahoo or Polar and importing somewhere else is a GPX file passing between them, and the reason people do it is nearly always that they are leaving a platform or want a backup that outlives their subscription.

The track, the timestamps and the elevation travel reliably. What frequently does not is everything the platform added on top: the activity type, the title and description, laps, the heart-rate stream if it was stored in a vendor extension. Checking one imported activity before uploading four hundred is worth the two minutes.

Elevation is the least trustworthy number in the file

A consumer GPS derives altitude from satellite geometry and is poor at it — errors of ten to twenty metres are ordinary. Devices with a barometric altimeter do much better, and drift with the weather. Neither produces a total ascent figure you can compare against somebody else’s.

Which is why platforms recalculate. Most of them discard the recorded elevation and look the route up against a terrain model instead, and different models disagree, which is the entire explanation for the same ride showing 640 metres of climbing on one site and 710 on another. Neither is lying; they are consulting different maps.

Planning a route and putting it on a device

Plan on a computer, where you can see the map properly, export GPX, and load it onto the watch or bike computer — either over the manufacturer’s application or by copying the file onto the device when it is plugged in as a drive.

Two things to check before setting off. Point count: some devices cap a route at a few hundred points and will silently truncate or reject a file with thousands, so simplify before exporting. And direction: a GPX has an order, and a loop planned clockwise will be navigated clockwise. Both are trivial to fix at a desk and irritating to discover at a junction.

Fixing a broken recording

Because the file is plain XML, quite a lot can be repaired by hand. A recording where the watch was started early and left running in the car has a spurious tail that can be deleted. A wrong date is one line. A track that was paused and resumed can be joined.

The one thing to be careful about is that the timestamps are in UTC. Editing them to match local time produces an activity that is internally consistent and shows the wrong hour on every platform that converts back. Change the points, not the clock.

GPX against KML, and when each is right

GPX is for activity and navigation data: a track with times, a route to follow, waypoints to find. It is the format devices speak. KML is for presentation — placemarks, styled lines, coloured areas, images pinned to the map — and it is the format Google Earth speaks.

Converting a track to KML to show it on a map is reasonable, and the styling has to be added because GPX has no concept of it. Converting the other way is worth checking, because a KML holding polygons and overlays has plenty that GPX cannot express, and what arrives is whichever lines survived the translation.

The facts, in one place

Identifiers and provenance for the GPX format.
Extension.gpx
Media typeapplication/gpx+xml
Published byTopografix
First published2002
SpecificationGPX 1.1

GPX files: common questions

How do I open a GPX file?

Upload it to a mapping site such as Strava, Komoot or Garmin Connect, or open it in a desktop program like QGIS or GPXSee. It is also plain XML, so a text editor shows the raw points — which is the quickest way to tell a route from a recorded track.

What is the difference between a route and a track?

A route is where you intend to go: an ordered list of points, no times. A track is where you actually went: a dense recording with a timestamp on every point. Devices treat them differently, and loading one where the other is expected is a common reason an import fails.

Why does the elevation gain differ between apps?

Most platforms discard the recorded altitude and recalculate it against their own terrain model, and the models disagree. Consumer GPS altitude is poor to begin with, so the same ride can honestly show 640 metres on one site and 710 on another.

Does a GPX file contain heart rate?

Sometimes. The core format has only position, elevation and time; heart rate, cadence and power live in vendor extensions that different platforms write and read inconsistently. TCX or FIT is the safer container when the training data matters.

How do I get a route onto my Garmin or Wahoo?

Plan it on a computer, export GPX, and transfer it through the manufacturer’s application or by copying the file to the device while it is plugged in. Check the point count first — some devices cap routes at a few hundred points and truncate longer files.

Can I edit a GPX file to fix a recording?

Yes, it is plain XML and deleting a spurious section or joining two tracks is straightforward. Leave the timestamps alone, though — they are in UTC, and editing them to look like local time produces an activity that shows the wrong hour everywhere.