Waking up in the middle of a deep sleep stage is what leaves you feeling groggy, so the trick is to wake at the end of a full cycle. A typical sleep cycle lasts about ninety minutes, and a good night is usually five or six complete cycles. This calculator works two ways: tell it when you need to wake up and it suggests the best bedtimes, or tell it when you are going to bed and it suggests the ideal wake-up times. It also allows roughly fifteen minutes to fall asleep. Aligning your alarm with the end of a cycle can help you feel more rested even on the same amount of sleep. It is a simple planning aid, not medical advice, and it runs entirely in your browser.