HKQuantityTypeIdentifierHeartRate — reading heart rate from an Apple Health export

HKQuantityTypeIdentifierHeartRate is the largest thing in most Apple Health exports, and its sampling rate is not constant — which changes what an average of it means.

Open your file

Drop your file here

export.zip straight from the Health app — do not unzip it

No account. No upload. The file is read on this device and never leaves it.

Nothing has been sent anywhere. 0 requests to this site, for the page's own code.

Variable sampling, not a fixed rate

The Watch samples heart rate densely during a workout — every few seconds — and sparsely at rest, sometimes minutes apart. Over years this is the bulk of your export.xml. It also means a plain average over all samples is weighted toward whenever you exercised, not toward your day: the arithmetic mean of the records is not your average heart rate.

Why it makes the file large

A multi-year export can hold millions of heart-rate records, which is why export.xml is often hundreds of megabytes and why a browser tab that reads it naively runs out of memory. This page streams the file rather than loading it whole, so it reads on your device without uploading and without exhausting the tab.

This identifier is one of dozens. The Apple Health data dictionary lists every identifier this parser reads, with its canonical type and unit.