Skip to content
Export to CSV

How to export Apple Health data to CSV

The Health app does not export CSV: it creates an export.zip with your data in XML (Summary, your picture, Export All Health Data). To get CSV, convert that XML with a script or use an App Store app that reads Apple Health and writes CSV. Below are both paths, with a script we tested on a 1 million record file.

By the telo team · Reviewed

Export from the Health app (official, free)

This is the only export Apple documents. It bundles everything the Health app stores, with no choice of metric or date range.

  1. Open the Health app on your iPhone.
  2. Tap Summary, then tap your picture or initials in the top right corner.
  3. Scroll to the bottom of your profile and tap Export All Health Data.
    Health app profile scrolled to the bottom, with the blue Export All Health Data button below the Privacy section
    Health app profile. iPhone simulator, iOS 27, 2026-11-14.
  4. Tap Export on the Export Health Data alert. With years of data, preparing the file can take a few minutes.
    Export Health Data alert asking if you are sure you want to export your data, with Cancel and Export buttons
    The confirmation alert. iPhone simulator, iOS 27, 2026-11-14.
  5. The share sheet shows the file as export, a ZIP Archive. Tap Save to Files, the easiest way to open it on a computer later.
    Share sheet with the export ZIP Archive at the top and the Copy, Add Tags and Save to Files actions
    The share sheet. The 2 KB size is from an empty simulator; a real export is much larger. iOS 27, 2026-11-14.
  6. On the computer, unzip export.zip. The records are in apple_health_export/export.xml.

Convert export.xml to CSV with Python

export.xml stores each measurement as a Record line with type, unit, dates and value. The script below streams the file, picks one data type and writes a CSV with start, end, value, unit and source. It needs only Python 3, nothing to install.

  1. Save the code below as to_csv.py next to the apple_health_export folder.
  2. In Terminal, in that folder, run: python3 to_csv.py apple_health_export/export.xml HKQuantityTypeIdentifierStepCount
  3. The CSV lands in the same folder, named after the data type, and the last printed line says how many records were written. Replace HKQuantityTypeIdentifierStepCount with the type you want, for example HKQuantityTypeIdentifierHeartRate for heart rate.
python
import csv, sys
import xml.etree.ElementTree as ET

src, want = sys.argv[1], sys.argv[2]  # export.xml HKQuantityTypeIdentifierStepCount
rows = 0
with open(want + ".csv", "w", newline="", encoding="utf-8-sig") as out:
    w = csv.writer(out)
    w.writerow(["startDate", "endDate", "value", "unit", "sourceName"])
    events = ET.iterparse(src, events=("start", "end"))
    _, root = next(events)
    for event, el in events:
        if event == "end" and el.tag == "Record":
            if el.get("type") == want:
                w.writerow([el.get("startDate"), el.get("endDate"), el.get("value"), el.get("unit"), el.get("sourceName")])
                rows += 1
            root.clear()
print(rows, "rows in", want + ".csv")

What our test showed

We built a sample export.xml in Apple's format with 1 million step and heart rate records (220 MB, illustrative values, not anyone's data). On an Apple Silicon Mac with Python 3.15, on 2026-11-13:

Time is about the same; memory is not. An estimate, not tested: at the same ratio, a real 1 GB export would need close to 4 GB of memory to load whole, enough to freeze an ordinary laptop. The streaming script stayed near 16 MB in the test.

Converting a 220 MB export.xml with 1 million records
How the XML is readMemory usedTime
Streaming (the script above)16 MB2.2 s
Loading the whole file (ElementTree.parse)964 MB1.9 s

The paths side by side

Ways to get CSV out of Apple Health
PathPriceWhat it needsLimitSource, date
Health app export + scriptFreeA computer with Python 3The iPhone only gives you XML; converting is up to youApple Support
Health Export CSV (app)US$2.99; Remote US$4.99 a month or US$29.99 a yeariPhoneCSV and GPX straight from the iPhone; Remote syncs in the backgroundApp Store
Health Auto Export (app)Basic US$2.99 (one time); Premium US$1.99 a month, US$6.99 a year or US$24.99 lifetimeiPhoneThe Free tier does not export; Basic exports by hand (CSV and JSON); automatic export only on PremiumApp Store
teloPro US$49 a year; on Free the assistant sees only the last 7 daysiPhone with the telo appCSV of daily values, sleep and workouts from your account on the web, once a day, Free included; totals per day, not every sample. Also gives the history to Claude, ChatGPT and other assistants (all of it only on Pro) and, on Pro, a JSON APIApp Store

When you do not need CSV

If the goal is to ask something about your data ("did my resting heart rate drop this year?"), exporting and converting every time is a chore. telo reads Apple Health through the iPhone app and lets Claude, ChatGPT and other assistants query the history directly, with no file. Developers can read the same data through the personal REST API, in JSON, up to 500 rows per call. If you only want spreadsheets, telo also hands its copy back as CSV: one row per day and metric, per night and per workout, in your time zone (Account > Your data on the web).

bash
curl 'https://telo.health/api/v1/query_daily?metrics=steps&from=2026-11-01&to=2026-11-08&granularity=day' \
  -H "Authorization: Bearer $TELO_API_KEY"
FAQ

Practical questions

Can Apple Health export CSV directly?

No. The Health app export creates an export.zip with the data in XML. For CSV, convert export.xml with a script or use an App Store app that writes CSV.

Can I export just one metric or one date range?

Not with the official export, which takes everything at once. The script in this guide picks one data type; the apps in the table let you choose metric and range on the iPhone.

Why is export.xml so large?

Every measurement is one line, and the watch measures heart rate many times a day. A few years of use easily reach hundreds of megabytes.

Where does the exported file go?

Wherever you chose on the share sheet. With Save to Files, export.zip is in the folder you picked in the Files app (On My iPhone or iCloud Drive). If you sent it by AirDrop to a Mac, it goes to Downloads.

Can I export only workouts or only sleep?

Not with the official export. After exporting, change the type in the script: HKCategoryTypeIdentifierSleepAnalysis for sleep. Workouts are Workout lines, not Record, and need another script; the apps in the table export workouts and sleep separately on the iPhone.

How do I open export.xml in Excel?

Do not open the XML directly. Convert it to CSV, one file per data type, and check that the CSV has fewer than 1,048,576 rows, the maximum for an Excel worksheet.

Does telo export CSV?

Yes, since November 2026. In your telo account on the web, Your data > Download everything (CSV) gives a zip with daily values, sleep, workouts and which AI read what, with times in your time zone. It holds what the iPhone sent to telo, totaled per day, not every Apple Health sample; for raw samples, use the Health app export. Once a day, on Free too.

Sources and availability

Plans, regions and interfaces can change. Check the official sources before setting up.

How this guide was prepared

On 2026-11-14 we checked the export steps on Apple's support page and prices and plans on the App Store pages; the row limit comes from Microsoft's documentation, checked on 2026-11-13. The screenshots are from the Health app in the iPhone simulator (iOS 27, no data and no iCloud account) on 2026-11-14, which is why the profile shows a backup warning. The script was measured in our own session on 2026-11-13 on a sample export.xml in Apple's format with 1 million illustrative records, on an Apple Silicon Mac with Python 3.15; the 1 GB figure is an estimate at the same ratio. No one's health data was used.