For most of my twenties the answer to "what time should I go to bed" was "whenever the shift ends." I worked nights, then evenings, then a rotating mess of both, and I slept through alarms for years. Two alarms. The phone across the room. I slept through all of it.
What got me out of that was not a louder alarm. It was a spreadsheet. I stopped asking when I should go to bed and started asking when I had to be up, then counted backwards. That is the whole method, and it still works for me at a normal day job.
Start from the alarm, not the clock
Bedtime on its own is a meaningless number. The alarm is the fixed point of most nights, because a boss, a bus or a first class sets it and you do not. Bedtime is the part you can move, so it is the part worth calculating.
Be honest about which alarm you count from. The one you set on Sunday night out of optimism is a wish. Look at the time you actually got up on most of the last seven mornings, and use that.
Sleep does not run as one smooth block. The National Heart, Lung, and Blood Institute describes a night as cycles that start over every 80 to 100 minutes, four to six of them in a typical night. Each cycle goes from light sleep down into deep sleep and back up into REM, the dreaming stage. Deep sleep takes up more of the early cycles, and REM takes up more of the later ones.
So the math is: wake time, minus the time it takes you to fall asleep, minus some whole number of cycles. That gives you a short list of bedtimes that each end a cycle close to the alarm, when you are nearer the surface of your sleep than the bottom.
How long a cycle is, and how sure anyone is
The number you will see everywhere is 90 minutes. It is a decent average and a bad absolute.
Carskadon and Dement's overview of normal human sleep, in Principles and Practice of Sleep Medicine, puts the first cycle of the night at roughly 70 to 100 minutes and the later cycles at roughly 90 to 120. The biggest set of measurements I have found is newer. Cajochen and colleagues, in Sleep Health in 2024, looked at 6,064 cycles recorded from 369 people sleeping in a laboratory, and the median cycle came out at 96 minutes. They also found the first cycle of the night was consistently shorter than the rest.
Six minutes sounds like nothing, but it adds up over a night. Five cycles at 90 minutes is seven and a half hours. Five cycles at 96 is eight. For a 6:30 a.m. alarm, that moves the time you want to be asleep from 11:00 p.m. to 10:30 p.m., a half hour from one small change in the input. Plenty of people run shorter or longer than either number.
That is why I treat the result as a window, not a target. If the arithmetic says 10:45 p.m., anywhere from about 10:30 to 11:00 is the same answer. I went into the spread at more length in the 90 minute sleep cycle is an average.
The arithmetic for a 6:30 alarm
Say your alarm is set for 06:30 and it takes you about 15 minutes to fall asleep once the light is off. That 15 is a rule of thumb, not a number from a study. If you are out in two minutes, or still awake after forty, your number is different and you should use it.
You can measure yours without any equipment. Note the clock when you turn the light off, then in the morning think back to the last time you remember seeing. Do that for a week and take a middle night, not your best one and not your worst.
Counting back from 6:30 a.m.:
- Six cycles (nine hours of sleep): lights out at 9:15 p.m.
- Five cycles (seven and a half hours): 10:45 p.m.
- Four cycles (six hours): 12:15 a.m.
- Three cycles (four and a half hours): 1:45 a.m., which is a bad night with a plan, not a plan.
For a 7:00 a.m. alarm, move each of those half an hour later.
The sleep calculator does this for any wake time and gives you the same four bedtimes, with the fall-asleep minutes already taken off. It lets you set your own cycle length, anywhere from 80 to 100 minutes, and your own fall-asleep time instead of my defaults. If you want to see what that 96 minute median would do to your night, set the cycle to 96 and compare.
How many hours you are aiming for
The cycle list gives you options. The research tells you which of them are actually enough.
The National Sleep Foundation convened a panel in 2015 (Hirshkowitz et al., Sleep Health) and the recommendation for adults aged 26 to 64 was 7 to 9 hours a night. They also listed 6 hours and 10 hours as "may be appropriate" for some people, which is a careful way of saying the edges are fuzzy. For adults over 65 the recommended band narrows to 7 to 8. The CDC's public table says much the same in fewer words, 7 or more hours for adults 18 to 60.
So on the list above, five cycles and six cycles are inside the recommendation. Four is the edge. Three is a night you recover from later.
I aim for five. Six would be lovely, but on a work night five cycles at 10:45 is the one I can actually keep. A bedtime you keep beats a bedtime you admire.
If you have been living on the four cycle bedtime for a while, one early night will not settle it. The sleep debt calculator shows what the week actually cost, and I wrote about why one long Saturday never paid mine back in what sleep debt is.
Why this is a good bet and not a promise
Waking at the end of a cycle is a reasonable target. The evidence behind it is thinner than most sleep sites let on, and I would rather you heard that from me.
The fog after an alarm has a name, sleep inertia, which just means the slow, heavy stretch before your brain is fully on. Hilditch and McHill reviewed the research on it in Nature and Science of Sleep in 2019. Most of it fades within 30 minutes of waking, but full recovery does not appear to be complete until at least an hour after. It is worse after sleep loss, and worst when you wake during your biological night, the hours your body clock treats as night whatever the wall clock says.
On the exact question the cycle trick relies on, whether waking out of deep sleep makes the fog worse, the same review says it is hard to reach a clear conclusion. One study it cites found a 41% drop in performance after waking from deep sleep. Others found no link between the stage you woke from and how well you did afterwards.
Smart alarms that promise to catch you in light sleep run into the same wall. Campanella and colleagues, in Clocks & Sleep in 2024, compared a bedroom smart alarm with an ordinary one in 29 adults over four nights and found no significant difference on any of their attention test measures. They also noted that such devices are commercially available but not validated.
So I would not pay for a gadget to find the perfect minute. Counting backwards is free, and my honest read is that the hours it protects do most of the work. Landing right on the end of a cycle is a bonus. If you count well and still wake up foggy, why you feel groggy after waking up goes through what else it can be.
What the math cannot fix
Knowing the right bedtime and being asleep at it are different problems. I have read 10:45 p.m. off my spreadsheet and still been wide awake at midnight.
Light is the one lever I know of. Blume, Garbazza and Spitschan, in Somnologie in 2019, sum it up as evening and night light delaying the body clock and morning light moving it earlier. They cite field data where each extra hour spent outdoors went with sleep about 30 minutes earlier. That finding is correlational, and they say it is unclear whether shorter exposures do the same. What I take from it is modest. Dim the room in the last hour, get outside in the morning when you can, and move a far-off bedtime in small steps, which I describe in how to reset your sleep schedule.
Counting cycles does not help if you lie awake for an hour most nights, if you wake at 3 a.m. and cannot get back to sleep for weeks on end, if you snore hard enough to wake yourself, or if nine hours in bed still leaves you exhausted.
Those are not arithmetic problems. They may be insomnia, sleep apnea, or something else a calculator cannot see, and the person to talk to is a doctor. I am not one, and I would rather say so twice than have you rearrange your evenings around the wrong number.
What I do now
My alarm is set for 6:30. I count back five cycles and start winding down around 10:15 so the light is off by 10:45. Some nights it slips to 11:00 and I do not panic about it.

Waffles, my orange and brown tabby, does not hold with any of this. She wakes me at 5:40 every morning regardless of what the alarm says, sits on my chest, and stares. I have tried moving her breakfast and moving the alarm. She wins. So in practice my last cycle ends around 5:40 whether I planned it or not, and I have quietly built the spreadsheet around the cat.
If your bedtime is the fixed part and the alarm is the thing you can move, what time should I wake up runs the same sums forward from the minute you fall asleep.
If you want the short version, pick your wake time, run it through the sleep calculator, choose the bedtime you can keep most nights, and give it two weeks before you judge it. If you want the long version of how I got here, there is more about me.
