FitMigrate

What Is Inside the Apple Health Export.zip

By Josep Mampel Marques, updated

An Apple Health export is a zip file called export.zip that unpacks to a folder named apple_health_export. Inside are two XML files, export.xml and export_cda.xml, and, when you have them, a workout-routes folder with one GPX file per outdoor workout and an electrocardiograms folder with one CSV file per ECG recording. Almost everything you will want, from steps to workouts, is in export.xml. FitMigrate reads the zip as it is, so you do not need to unpack it.

The files at a glance

Apple's iPhone User Guide only says the data is exported "in XML format, which is a common format for sharing data between apps". The folder layout above comes from published examples of real exports, so the exact set of files may vary with your iOS version and the data you have.

export.xml in detail

The file is one long list of XML elements. The ones you will meet most often are:

A published example of a heart rate record looks like this, shortened:

<Record type="HKQuantityTypeIdentifierHeartRate" sourceName="Apple Watch" unit="count/min" startDate="2017-04-29 12:21:15 -0500" endDate="2017-04-29 12:21:15 -0500" value="102"/>

Dates include the time zone offset, and the same type can come from several sources. If you wear an Apple Watch and also carry your iPhone, you can have step records from both.

Why the XML does not open nicely in Excel

The data sits in attributes of millions of Record lines, not in rows and columns, and the file is often hundreds of megabytes. In a 2023 Apple Community thread a user could not get export.xml into Excel, and the replies explain that XML is a way of structuring data, not a spreadsheet, so it needs converting first. Splitting it into one CSV per metric is the practical answer: see Apple Health export to CSV.

workout-routes: GPS tracks as GPX

GPX is a light-weight XML format for GPS data: waypoints, routes and tracks. Each Apple route file is a track of points with latitude, longitude, elevation and time. It does not contain heart rate, which is stored separately in export.xml. That split matters if you want to move workouts to Garmin Connect or Strava, because a GPX route on its own gives a map without pulse. The differences are covered in GPX or FIT for Apple Watch workouts.

Route files are not always complete. In an Apple Community thread from 2020, users reported GPX files in the export that were valid but had no coordinates after updating to iOS 14, and one user had no workout-routes folder at all.

electrocardiograms: one CSV per ECG

Each file starts with a few lines of details about the recording, followed by the voltage samples. FitMigrate does not read, chart or interpret ECG files; they stay in the zip as Apple wrote them.

How FitMigrate uses these files

  1. Open FitMigrate and choose your export.zip.
  2. It reads export.xml in a stream, counts the records per type and lists your workouts.
  3. For CSV, it writes the Record lines of each metric you tick with five columns: start date, end date, value, unit and source.
  4. For FIT, it combines the workout from export.xml, the GPS points from its GPX file in workout-routes and the heart rate records recorded during the workout.

Everything happens in your browser tab. Nothing in the zip is sent to a server.

FAQ

Why is my export missing the workout-routes folder?

The folder only appears when the Health app has routes to export, which means outdoor workouts recorded with location on. Users have also reported exports where routes were missing or empty, for example after the iOS 14 update.

Which file has my steps and heart rate?

export.xml. Each measurement is a Record line with its type, value, unit, source and dates.

Can I edit the export and import it back into Health?

The Health app has no option to import an export.zip. The export is a copy for use outside the app.

Sources