Introduction
GPX is the common format for GPS data: places to visit, planned routes and recorded tracks. It is an XML schema published by TopoGrafix; version 1.1, from 2004, is the one in use today. GPS devices, sports watches, fitness apps and mapping software import and export it, which makes it the usual way to move a hike or a ride from one service to another.
Structure
The root element is <gpx>, with a version and a
creator attribute. Inside it, after optional <metadata>,
come three kinds of element:
<wpt>: a waypoint, a single named place<rte>: a route, an ordered list of<rtept>points to travel through<trk>: a track, a recorded path made of one or more<trkseg>segments of<trkpt>points
Every point carries lat and lon attributes in decimal
degrees, and may hold an elevation (<ele>), a time
(<time>) and a name. Devices add their own data, such as heart rate,
inside <extensions> elements. The
elements page lists every element and
attribute of GPX 1.1 and how 1.0 differs.
Coverage and the explorer
Re-checked on 2026-11-13 against gpx10.xsd and gpx11.xsd: every element, attribute and
simple type of both schemas is on the elements page. The public
vendor extension schemas (Garmin TrackPointExtension v1 and v2, GpxExtensions v2 and v3, WaypointExtension v1
and PowerExtension v1, Cluetrust GPXData 1.0, and every published TopoGrafix version: gpx_modified 0.1,
gpx_style 0.1 and 0.2, gpx_overlay 0.1 to 0.5, and Private TopoGrafix 0.1 to 0.5) were fetched from their
publishers on 2026-11-13 and are on the elements page under
public extension schemas.
Not part of the format: elements from other namespaces that no publisher has released a schema for. The
schema defines extensions as xsd:any namespace="##other" processContents="lax", so these
are opaque extension points by design: their meaning belongs to the application that wrote them, not to GPX.
The viewer lists them as unknown elements.
The viewer reads the file as XML (the XML viewer’s tree and
checks), then as GPX 1.1 or 1.0: every element and attribute of both schemas is checked
for type, range, required parts, number and order, with line and column, and shown as
waypoints, routes, tracks (distance, duration, ascent, elevation range, speed), every
point with the heart rate, cadence, temperature, speed and power that the Garmin and
Cluetrust extensions give it, the extensions, and a flat plot of the tracks. The
extension schemas it checks element by element are Garmin TrackPointExtension v1 and
v2, GpxExtensions v2 and v3, WaypointExtension v1, PowerExtension v1, Cluetrust GPXData
1.0, gpx_modified 0.1, gpx_style 0.2, gpx_overlay 0.2 to 0.5 and Private TopoGrafix 0.1
to 0.5. gpx_style 0.1 and gpx_overlay 0.1 declare types only (their published schemas have no
global elements), so their elements are labelled but not checked, and an element from
any other namespace is labelled “extension from <namespace>, no published
schema”, with every element, attribute and text value listed in the Extensions
tab. GPX 1.0 is checked as TopoGrafix’s own 1.0 schema gives it (read from
topografix.com), including its order of children, the position of
other-namespace elements before rtept and trkseg, and its
email pattern. The XML tree’s element nodes carry GPX labels (waypoint, route,
track, track segment, the field of each, the schema of each extension), and so do
its attribute nodes (version, creator, lat, lon, href, minlat and the rest). An
attribute from another namespace, and xml:lang, are flagged on a GPX
element because the schemas have no anyAttribute (only the
xsi: attributes are allowed); -0 is accepted as the
nonNegativeInteger it is. Every problem is listed in pages in the
Problems tab. The Waypoints, Routes, Tracks and Points tables are paged: every
route, track and point is a row, whatever the file’s size (there is no limit
on the size of the file). The map is a raster picture, not an SVG. A file larger
than 24 MB is read in windows by the GPX viewer’s own reader, because the XML
viewer’s reader needs the whole text in memory and a record for every node:
one pass checks that elements nest and are closed, that attribute values are quoted
and names not repeated, that only white space lies outside the root, the characters of the
file, character and entity references (a bare ampersand, an illegal character, an entity the
document type does not declare), -- inside a comment, the XML declaration (its
fields and its position), the document type and the encoding declaration against the bytes,
and indexes the big elements; the
GPX schema checks then read the elements one at a time, so a track of millions of
points is validated, added up and listed without being held (tested on 300 MB with
the last track point reached in the Points tab and the tree). A file cut off inside an
element is read as far as it goes and the cut is a problem. In such a file the
XML viewer’s own checks of names against the Name production, namespace rules,
validity against a DTD and entity expansion are not made, the tree shows
elements, start tags with their attributes, and end tags, and the map draws at most
40,000 points of each line and of the waypoints (every n-th), so that it stays a
picture. A node with more than 25 problems shows the first 25 and the number of the
rest; all are in the Problems tab, in both readers. Entity expansion in a file below
24 MB stops, with a labelled problem, past 16,777,216 characters of replacement text or
24 entities inside one another (a “billion laughs” document), as XML parsers do.
A xsd:dateTime offset is at most 14:00 and 24:00:00 has a zero
fraction; an attribute on <extensions>, and text directly inside it, are errors.
The windowed Overview has the author, copyright and link rows, and its xmlns
attribute nodes are labelled. Bytes that are not valid UTF-8 are flagged in both readers
and counted in the Overview.
Links
Software
- Garmin BaseCamp – Garmin’s route planner, which transfers GPX to and from its devices (Windows, macOS)
- GPXSee – free viewer for GPS tracks on a map (Windows, macOS, Linux)
- Google Earth Pro – Google’s globe, which imports GPX tracks (Windows, macOS, Linux)
- QGIS – free GIS that loads GPX waypoints, routes and tracks as layers (Windows, macOS, Linux)
- GPSBabel – converts between GPX and many other GPS formats (Windows, macOS, Linux)
- Strava – fitness service that imports and exports activities as GPX (web, mobile)
Developers
Reference
- GPX: the GPS Exchange Format – TopoGrafix’s page, with the 1.1 schema