GPX explained simply

What is a GPX file?

A straightforward guide to the file format used to record and share walking, running, cycling and other GPS routes.

The short answer

A portable map of your route

GPX stands for GPS Exchange Format. It is a common file format for storing route, track and waypoint data collected by GPS devices and apps.

A GPX file is written in XML, which means it is a structured text file rather than an image of a map. Each waypoint can contain a position, elevation, timestamp and other useful information.

Inside the file

What information can GPX contain?

GPS coordinates

Latitude and longitude identify the precise position of each point along the route.

<trkpt lon="-1.820133" lat="54.135110">

Elevation

Elevation records the height of a point, normally measured in metres above sea level.

<ele>143.4</ele>

Timestamp

A timestamp records when a point was captured and can be used to calculate speed and duration.

<time>2019-01-09T12:00:27.000Z</time>

The raw data

What does a GPX file look like?

Open one in a text editor and it can initially look complicated. However, every tag has a purpose: the example shows a named route with a start point and a finish point.

example-route.gpx
<?xml version="1.0" encoding="UTF-8"?>
<gpx
  xmlns="http://www.topografix.com/GPX/1/1"
  version="1.1"
  creator="View GPX"
>
  <rte>
    <name>High Paradise to Lord Stones loop</name>
    <rtept lat="54.292556" lon="-1.227839">
      <name>Start</name>
    </rtept>
    <rtept lat="54.292701" lon="-1.227990">
      <name>Finish</name>
    </rtept>
  </rte>
</gpx>

Why are GPX files useful?

Their main advantage is compatibility. A GPX route can be exchanged between people, websites, navigation devices and apps such as Garmin Connect and Strava.

  • Move routes between apps and GPS devices
  • Share walking, running and cycling routes
  • Analyse distance, elevation, speed and gradient
  • Keep a portable copy of a recorded journey

Making your own

How are GPX files created?

Although you could write a GPX file by hand, it would be slow and impractical. Most GPX files are recorded automatically by a phone app, sports watch, bike computer or dedicated GPS device.

Route-planning services can also create GPX files before a journey. You can then transfer the file to another device or open it in a viewer to inspect the route.

Have a GPX file ready?

View its map and elevation, save it for later or share it with friends.

Open a GPX file