How the sleep calculator works
Sleep isn't one long block; it runs in cycles of roughly 90 minutes, each moving through light sleep, deep sleep, and REM. Wake up between cycles and you tend to feel reasonably human; wake up mid-cycle, especially from deep sleep, and you get sleep inertia, that leaden, where-am-I grogginess that can outlast your first coffee. So instead of aiming for a round number of hours, this calculator counts in whole cycles.
Give it your alarm time and it counts backward in 90-minute steps to find bedtimes that let you complete 6, 5, 4, or 3 full cycles. Give it your bedtime and it counts forward to the matching wake-up times. Either way it adds 15 minutes up front, because "in bed" and "asleep" are famously different things.
The formula
Cycles is the number of complete 90-minute sleep cycles (6 cycles = 9 hours of sleep, 5 = 7.5 hours, 4 = 6 hours, 3 = 4.5 hours). The 15 minutes is average sleep latency, the typical time a healthy adult takes to actually fall asleep. In "going to bed" mode the same formula runs forward: wake-up time = bedtime + 15 min + cycles × 90 min. Times wrap across midnight automatically.
Worked example
Alarm set for 6:30 AM. Counting back 15 minutes plus whole cycles:
6 cycles (9h of sleep): in bed by 9:15 PM · 5 cycles (7h 30m): 10:45 PM · 4 cycles (6h): 12:15 AM · 3 cycles (4h 30m): 1:45 AM.
The 9:15 PM and 10:45 PM options both land in the adult sweet spot of 7 to 9 hours; the later two are damage control.
Estimates, not lab results
Two honest caveats. First, 90 minutes is an average: real cycles run about 80 to 110 minutes, differ between people, and stretch as the night goes on, so treat these times as good starting points and nudge your bedtime in 15-minute steps until mornings feel easier. Second, no bedtime math substitutes for enough total sleep: the CDC and the American Academy of Sleep Medicine both put the adult target at 7 to 9 hours per night, which is exactly why the 5- and 6-cycle options are the ones this calculator recommends. And if you struggle to fall or stay asleep three or more nights a week for three months (the working definition of chronic insomnia), or you snore loudly with gasps or pauses, skip the calculator and talk to a doctor.