Your phone probably knows more about your sleep than you do. It may be recording it in two places at once: your sleep app's own database, and your phone's built-in health hub. That hub has a name: HealthKit on iPhone (the system behind the Apple Health app), and Health Connect on Android.
These two frameworks decide how sleep data moves between apps on your phone. Understanding them answers the questions most people never think to ask: which apps can see my sleep history, where does that data actually live, and how do I take control of it?
This is general wellness information, not medical advice. Think of it as a map of your own data, drawn so you can navigate it with confidence.
Why your phone needs a sleep data hub
A decade ago, every fitness app was an island. Your tracker kept your sleep, your running app kept your workouts, and nothing talked to anything else. That meant fragmented records and apps constantly reinventing the same sensors.
Apple and Google solved this with a simple idea: give the operating system itself a central, on-device store for health data, and let apps read from and write to it with your permission. On iOS that store is HealthKit; on Android it is Health Connect.
For sleep specifically, this means:
- A tracker app can write last night's sleep session (bedtime, wake time, time in each stage, if the app detects stages) to the hub.
- A second app you authorize can read that same session, so you do not have to track twice.
- Your data stays on your device. The hub is a mailbox, not a broadcasting station.
This matters because sleep tracking works best when all your information lives in one place. Without a hub, you end up with three apps each holding a fragment of your sleep life.
How HealthKit handles sleep data
HealthKit is Apple's framework, and the data lives in the Health app on your iPhone. Apps never touch the Health app's UI directly; they ask the operating system for access to specific data types, and the OS shows you a permission prompt naming exactly what is being requested.
For sleep, the central data type is sleep analysis. It covers:
- In bed vs. asleep periods: when you were lying down versus actually sleeping.
- Sleep stages: awake, REM, core (light), and deep sleep, when the recording device detects them. Not every app reports stages; many only report total time in bed and time asleep.
- Nap sessions: shorter sleep periods recorded during the day.
When an app writes a sleep session, it typically records each segment as a sample with a start time, end time, and a value (for example, "asleepCore" or "asleepDeep"). When an app reads, it pulls those samples back and can show you the same night from a different angle: a coach app might read the session your tracker wrote, without ever asking you to wear anything new.
A few things worth knowing about HealthKit:
- Permission is per data type. An app can be allowed to read your sleep data but not your heart rate, or write sleep but read nothing. You see exactly what it wants before anything happens.
- Permissions are revocable at any time. Settings > Health > Data Access & Devices shows every app and every data type it can touch. Flip a switch and the access ends.
- There is no cloud involved by default. HealthKit data lives on your phone (and your encrypted iCloud backup, if you use one). Apple does not see it, and neither does any other company unless an app you authorized sends it somewhere else.
How Google Health Connect handles sleep data
Health Connect is Android's answer to the same problem, and it works on the same principles with one difference: it is a distinct app/framework that acts as a shared clearinghouse between health apps, rather than living inside a single Health app.
The core concept is the sleep session record. It contains:
- Start and end times for the overall session.
- Stages: individual segments labeled with sleep stage types (awake, sleeping, light, deep, REM, out of bed), each with its own start and end.
- A title, optional notes, and metadata about which app recorded it.
Sleep apps on Android write these session records into Health Connect. Other apps, with your permission, read them. As with HealthKit, the exchange happens on your device, and you approve each app and each data type separately.
One practical difference from Apple: Android's sleep ecosystem is more fragmented across manufacturers (Samsung Health, Pixel, Fitbit, third-party trackers), so Health Connect's role as neutral ground is especially useful. A session recorded by one brand's app can be read by an independent coach app, with Health Connect as the translator in the middle.
What gets shared, exactly?
Here is the part most people get wrong. HealthKit and Health Connect do not share your data automatically with anyone. Every connection is a permission you granted, or a permission you forgot you granted. In concrete terms:
What one app can write for others to read:
- Sleep session timing (bedtime, wake time, naps)
- Sleep stage breakdowns, if the app detects stages
- Time in bed versus time asleep
What the hub never does:
- It never uploads your data to Apple or Google on its own.
- It never grants a new app access without asking you first.
- It never merges or edits your sessions; each app's records stay attributed to that app, so you can always see who wrote what.
What an individual app can still do: read data from the hub and then send it to its own servers, if you agreed to that app's terms. This is the important nuance. The hub is private by design; the apps you connect to the hub may not be. If an app's privacy policy says it syncs your data to its cloud for processing, that happens after it reads from HealthKit or Health Connect, not because of the hub itself.
The takeaway: the hub keeps your data on-device and gives you fine-grained control, but it cannot stop an app you trusted from copying data elsewhere. Choose your apps with the same care you choose your permissions.
How to see and control your permissions
Because the hub only works through permissions you control, it is worth auditing them once in a while. Here is how.
On iPhone:
- Open Settings, then Health.
- Tap Data Access & Devices.
- You will see every app with access, and exactly which data types each one can read or write.
- Tap any app to toggle individual data types, or remove it entirely.
You can also open the Health app, tap your profile picture, and find Apps under Privacy for the same list with descriptions of what each app requested.
On Android:
- Open Settings and search for Health Connect.
- Open App permissions to see which apps can read or write sleep (and every other) data type.
- Open Data and access to see recent reads and writes, which app wrote what, and to delete data entirely.
This audit takes about two minutes, and most people are surprised at least once by an app sitting in the list that they stopped using years ago.
What this means for choosing a sleep app
Now you know how the plumbing works, you can evaluate sleep apps on the questions that actually matter:
- Does it use the hub, or its own silo? An app that reads and writes through HealthKit or Health Connect works with the rest of your health setup. One that keeps everything in its own servers-only database locks your data in.
- What does it ask for, and what does it need? A sleep tracker that wants read access to your contacts is a red flag. One that asks only for sleep write and read access is doing exactly its job.
- Where does the processing happen? The strongest privacy story is an app that tracks, stores, and analyzes entirely on your phone, using the hub only to exchange records you explicitly allow.
That is the approach we take at OpenSleep. It tracks your sleep 100% on-device using your phone's accelerometer and sound patterns, no wearable required, and it can read your existing history from HealthKit or Health Connect and write its own sessions back, so your whole sleep story stays in one place you control. A local AI sleep coach reads the same on-device data to give you personalized guidance, and nothing ever leaves your phone. No cloud, no accounts, no tracking, and open source so you can verify the claims.
Whether or not you use OpenSleep, the principle is the same: your sleep data is yours. HealthKit and Health Connect give you the switches. Use them.
OpenSleep is a private, on-device sleep tracker for Android and iOS. Sleep content on this blog is general wellness information, not medical advice. If you have concerns about a sleep disorder, talk to a qualified health professional.

