How to export Apple Health workout routes as GPX
In Health Exporter & Shortcuts, a paid iPhone app (US$2.99 once on the App Store), open the Workouts tab, pick the period and activity types, switch on Include GPS Route, choose JSON + GPX (zip) and tap Export ZIP. You get a zip archive with one GPX 1.1 file for every workout that has a route, with the heart rate measured along the way written onto the track points, next to a JSON file describing every workout in the export.
Step by step #
- Open Health Exporter and allow access to workouts and workout routes when iOS asks. Routes are a permission of their own, so you can allow workouts and still refuse routes.
- Open the Workouts tab and choose the period under Range, exactly as for health data: Yesterday, 7 Days, 30 Days, or your own dates. Activity Types lists the kinds of workout recorded in that period, with how many of each, all ticked to begin with; untick the ones you do not want.
- Under Route, switch on Include GPS Route. Under Format, choose JSON + GPX (zip). The button below changes to Export ZIP. From version 1.8.0, Route appears only while File Format, just above it, is on JSON, its default: a Markdown export carries no route.
- Tap Export ZIP and save the archive from the share sheet.
In the Shortcuts app the same choice is the GPS Route parameter of the Export Workouts action, with three options: No route, JSON only and JSON + GPX (zip). The Shortcuts guide shows how to save the result to a folder in Files.
Routes are dense, with a point every few seconds, so a wide period with many outdoor workouts produces a large archive. Export the period you need rather than everything at once.
What is in the archive #
workouts_export_<timestamp>_<suffix>.zip
└── workouts_export_<timestamp>_<suffix>/
├── workouts_export_<timestamp>_<suffix>.json
└── routes/
└── <activity>-<YYYY-MM-DD>-<workout id>.gpx one per workout with a route
- Each GPX file is named after the workout’s activity type, its start date in your local calendar, and the first eight characters of the workout’s identifier, so two apps recording the same run never overwrite each other’s file.
- The JSON is the workout export you would get without routes, plus a
routeFilekey on each workout that has one, holding the path of its GPX file. That key is how you join a workout to its route. - Indoor workouts have no route and no file. A workout whose route exists but could not be read carries
"routeUnavailable": trueinstead, so a missing route never disappears silently. - When no workout in the export has a usable route, the archive holds the JSON alone.
The workout export format reference specifies every key of the JSON.
What a GPX file contains #
Each file is a GPX 1.1 document holding one track, named after the activity and its start time:
- Segments. The track is split into one
<trkseg>at each pause the workout recorded, including an automatic one at a traffic light, so a map draws no straight line across a paused stretch. Only pauses split the track: a stretch where GPS lost its fix while the workout kept running stays inside the same segment. - Track points. Every
<trkpt>has its latitude and longitude to six decimal places and its time in UTC. Elevation is in metres, and is left out on the points where the device marked the altitude as invalid, rather than written as a fake zero. Points the device marked as invalid fixes are dropped. - Extensions. Speed in metres per second and heading in degrees, each left out when unknown, and horizontal and vertical accuracy in metres, so you can judge each point yourself.
- Heart rate. Written with Garmin’s TrackPointExtension (
gpxtpx:hr), in whole beats per minute. Each point takes the reading nearest to it in time, and only when one was taken within 30 seconds of it. A point with no reading that close carries no heart rate at all, rather than a stale value.
This is a complete file. It is the one the app’s format test compares the generated GPX against, byte for byte, built from five invented points:
<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.1" creator="APP_VERSION" xmlns="http://www.topografix.com/GPX/1/1" xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1">
<metadata>
<time>2026-02-10T08:10:00Z</time>
</metadata>
<trk>
<name>hiking 2026-02-10T07:30:00Z</name>
<type>hiking</type>
<trkseg>
<trkpt lat="45.000000" lon="9.000000"><ele>145.87</ele><time>2026-02-10T07:30:00Z</time><extensions><speed>1.09</speed><course>28.73</course><hAcc>3.91</hAcc><vAcc>1.22</vAcc><gpxtpx:TrackPointExtension><gpxtpx:hr>142</gpxtpx:hr></gpxtpx:TrackPointExtension></extensions></trkpt>
<trkpt lat="45.000012" lon="9.000007"><time>2026-02-10T07:30:01Z</time><extensions><speed>1.11</speed><course>29.40</course><hAcc>3.88</hAcc><gpxtpx:TrackPointExtension><gpxtpx:hr>142</gpxtpx:hr></gpxtpx:TrackPointExtension></extensions></trkpt>
<trkpt lat="45.000025" lon="9.000015"><ele>146.20</ele><time>2026-02-10T07:30:02Z</time><extensions><speed>1.14</speed><hAcc>3.85</hAcc><vAcc>1.18</vAcc><gpxtpx:TrackPointExtension><gpxtpx:hr>142</gpxtpx:hr></gpxtpx:TrackPointExtension></extensions></trkpt>
</trkseg>
<trkseg>
<trkpt lat="45.000200" lon="9.000100"><ele>151.40</ele><time>2026-02-10T07:34:00Z</time><extensions><speed>0.98</speed><course>31.20</course><hAcc>4.10</hAcc><vAcc>1.30</vAcc></extensions></trkpt>
<trkpt lat="45.000210" lon="9.000108"><ele>151.50</ele><time>2026-02-10T07:35:01Z</time><extensions><speed>1.02</speed><course>31.90</course><hAcc>4.05</hAcc><vAcc>1.28</vAcc><gpxtpx:TrackPointExtension><gpxtpx:hr>146</gpxtpx:hr></gpxtpx:TrackPointExtension></extensions></trkpt>
</trkseg>
</trk>
</gpx>
In a real file the creator attribute holds the app’s name, version and build. That value changes with every build, so the test replaces all of it with a placeholder, which is why it reads APP_VERSION here. Every gap in the file is deliberate: the second point has no elevation because its altitude was invalid, the third has no heading because it was unknown, a pause splits the track into two segments, and the fourth point carries no heart rate because no reading was within 30 seconds of it.
Before you import it somewhere #
GPX is the standard route format that fitness and mapping apps import, but each app decides for itself what it reads from a file. Whether a given service imports these files cleanly, and whether it shows the heart rate from the TrackPointExtension, is up to that service, so try one file before you import a batch. Some differences are expected whatever you use:
- Distance will not match the Health app exactly. Apple combines GPS with motion data to measure a workout, while anything reading a GPX can only measure the line between the points.
- Elevation gain may be computed from part of the track. Points with an invalid altitude carry no elevation. How many depends on what recorded the workout, and it can be a large share of the points.
- Heart rate can be sparse. How often heart rate was sampled varies a lot between workouts, and a point only carries a reading taken within 30 seconds of it. If you want every reading with its own timestamp, export with JSON only instead: the coordinates and the complete heart rate series then go into the JSON, unaligned and unrounded.
The Health app’s own Export All Health Data includes route files as well, but only for your entire history at once, inside one large archive, and with each workout drawn as a single segment however often it was paused.
Where your routes go #
Routes are off by default, and the app reads them only when you switch them on for an export. Health Exporter never asks for location permission and cannot see where you are: it reads only routes your device already recorded, and only while producing an export you asked for, from the app or from a shortcut you built or scheduled. The coordinates go into your file and nowhere else. The app’s anonymous usage statistics record only which of the three route options you picked, never a coordinate, as the privacy policy describes.
A route shows where you have been, often including where you live. Once you save or share the file, its contents are wherever you put them, so look at what a service will make public before you upload to it.