During sleep, our body alternates between non-REM (NREM) sleep and REM sleep. This alternation between sleep stages occurs in cycles throughout the night. Cycles last on average about 90 minutes, and there are usually 4–6 of them during the night.
Waking up from REM sleep is often easier than from the other stages of sleep. REM sleep normally occurs at the end of a sleep cycle, which is why waking up in line with your cycles can help you feel more refreshed.
The calculator works out your bedtime based on your sleep cycles, taking into account the time it takes you to fall asleep. However, the length of sleep cycles can vary a lot between individuals, so scheduling sleep strictly around 90-minute cycles doesn’t suit everyone.
The light perceived by our eyes plays a major role in the body’s circadian rhythm. As the light dims, our body senses that evening is approaching and, for example, melatonin secretion increases, which helps us fall asleep. Bright ambient light and, for example, screens on electronic devices can reduce melatonin secretion and make it harder to fall asleep.
Try to stop looking at screens (phone, TV, computer, etc.) at least 1 hour before bedtime.
Our body temperature normally drops about 2 hours before we fall asleep. This acts as a signal to the body that it’s time to sleep, and makes falling asleep easier. A warm shower, bath, or sauna lowers body temperature, which is why it can also help you fall asleep and improve your sleep quality.
If you’ve noticed that you often wake up at night to use the bathroom, stopping or reducing fluid intake 2 hours before bedtime may reduce nighttime awakenings.
It’s a good idea to dim the surrounding lighting 3 hours before bedtime.
Drinking alcohol close to bedtime impairs sleep quality by delaying the onset of REM sleep and shortening the time spent in it, as well as prolonging the time it takes to fall asleep and reach deep sleep. Using nicotine before bedtime also impairs sleep quality and increases nighttime awakenings. If you plan to consume alcohol and/or nicotine products, stop at least 4 hours before bedtime.
Avoid napping within 7 hours of bedtime.
Caffeine intake close to bedtime increases the time it takes to fall asleep, reduces sleep quality, and increases nighttime awakenings. The last small dose of caffeine (about 107 mg of caffeine) should be consumed no later than 8.8 hours before bedtime to avoid negative effects on your sleep. The last large dose of caffeine (about 217.5 mg of caffeine) should be consumed no later than 13.2 hours before bedtime to avoid negative effects on your sleep.
Sleep is essential for both physical and mental wellbeing, and every human being needs it. Current research suggests that sleep, among other things, supports the maturation of the nervous system, helps maintain cognitive function, removes toxins that build up in the brain during wakefulness, and supports learning and memory. However, the effects of sleep are not limited to the brain — they extend to almost every system and function in the body, including the respiratory, circulatory, and immune systems, as well as metabolism.
During sleep, the body alternates between the different stages of NREM sleep and REM sleep, forming sleep cycles that last about 90–110 minutes, with usually 4–6 of them during a normal night.
NREM stage 1
A sleep cycle begins with wakefulness, from which you drift into the first stage of NREM sleep — very light sleep that usually lasts about 1–5 minutes. During this stage, the muscles relax, heart rate slows, and breathing and eye movements slow down.
NREM stage 2
The next stage is NREM stage 2, which lasts about 25 minutes in the first sleep cycle and grows longer with each following cycle. About 45% of total sleep time is spent in this stage. During NREM stage 2, we drift into deeper sleep as heart rate and body temperature drop. Muscle relaxation and slower breathing increase further, and eye movements stop.
NREM stage 3
The final stage of NREM sleep is the deepest stage of sleep. During this stage, the body builds and repairs tissue, strengthens the immune system, and builds bone and muscle. Breathing rate and heart rate are at their lowest during this stage, and the muscles relax even further. Waking from NREM stage 3 is the hardest of all sleep stages. If you do wake up during this stage, it’s common to experience reduced cognitive performance for about 30–60 minutes.
REM sleep
REM sleep is the final stage of the sleep cycle. During REM sleep, brain activity on an EEG resembles that of being awake. The skeletal muscles, however, remain still, while the eyes move very rapidly during this stage — which is where the name REM, or Rapid Eye Movement, comes from.
Studies of newborn sleep have found that REM sleep makes up about eight hours a day, compared to about two hours a night in adults. REM sleep also makes up a larger share of sleep in premature infants and in young rats and cats born prematurely. REM sleep plays an important role in brain development, which explains the higher need for REM sleep in newborns and premature infants.
In adults, the first REM stage of the night typically lasts about 10 minutes, but it grows longer with each cycle, and the last REM stage of the night can last up to an hour. Because brain activity during REM sleep resembles wakefulness, waking up tends to be easier during this stage.
Getting enough sleep cycles during the night requires an adequate total sleep duration. The American Academy of Sleep Medicine and the Sleep Research Society recommend at least 7 hours of sleep per night for adults. Regularly sleeping less than seven hours a night has harmful effects on health. Among other things, the risk of heart disease, stroke, obesity, diabetes, and high blood pressure increases in people who regularly sleep less than seven hours a night, and especially in those whose sleep duration is closer to six and a half hours or less.
Our body paces its functions on a cycle of about 24 hours. This cycle is called the circadian rhythm. It affects the sleep–wake cycle by regulating the body’s biological functions, such as the release of various hormones and the regulation of body temperature. The circadian rhythm also affects cognitive and physical performance, as well as appetite and eating. Changes in the circadian rhythm can lead to poorer sleep or even chronic illness.
Although the circadian rhythm is, in a sense, the body’s “biological clock,” we can also influence it through our own choices and, in turn, improve our sleep quality and daily energy levels. The word “rhythm” means a regularly repeating pattern. Regularity is also important for the circadian rhythm, which is why, if you’re aiming for good-quality, long sleep, it’s worth sticking to daily routines — especially in the evening and morning. In other words, go to bed at the same time and wake up at the same time every morning. The circadian rhythm is also affected by factors such as age and sex, as well as work, exercise, diet, and medication.
In today’s world, many people’s lives don’t always allow their sleep to fall at the same time every night — for example, people working shifts or rotating shifts can experience very large variation. There are various ways to adjust the circadian rhythm and improve sleep quality that, in a sense, “trick” the body about the timing of the rhythm.
The strongest driver of the circadian rhythm is light. Our eyes sense light, which helps regulate the body’s functions. Morning and evening light in particular play a role in regulating the circadian rhythm. Exposure to light in the morning shifts the rhythm earlier, while exposure to light in the evening delays it. So limit or dim ambient lighting and bright screens in the evening. In the morning, on the other hand, it’s worth getting natural sunlight or turning on the brightest lights in your home early. The calculator can help you work out when it’s worth dimming evening lighting and limiting screen time.
The circadian rhythm also regulates body temperature. In healthy people, body temperature varies by about 1 °C. Body temperature is at its lowest about 2 hours before waking, after which it starts to rise, reaching its peak about 2 hours before bedtime. After reaching its peak, the temperature starts to drop again as the evening and night go on. Body temperature regulation therefore mainly happens thanks to the circadian rhythm, but we can also cause our body temperature to drop or rise ourselves to help our body fall asleep or feel more alert.
One way to lower your body temperature in the evening is a warm shower. Warm water dilates the blood vessels in the skin, which lets heat escape from the body, especially through the feet and hands. After you get out of the shower, this ultimately leads to a drop in body temperature. The calculator can help you find the best time for a warm shower.
Healthy habits, such as healthy eating and an active lifestyle, are also beneficial for sleep quality. Studies have found that overweight individuals tend to sleep for shorter periods, while poor sleep, in turn, appears to have a negative effect on eating habits and weight management. When it comes to diet, it’s worth following general dietary guidelines and a “healthy” diet.
Fat
When it comes to fat sources, it’s worth avoiding saturated fatty acids and favoring sources of unsaturated fatty acids, also for the sake of sleep. Eating fatty fish in particular has a positive effect on sleep regulation — this may be explained by the omega-3 and omega-6 fatty acids and vitamin D found in fatty fish, which are believed to increase serotonin production. Serotonin is a brain neurotransmitter that affects sleep regulation. You can read more about fats and other macronutrients here: Macronutrients: protein, fat, and carbohydrates.
Protein
Getting enough protein is also important for sleep. On the other hand, too much protein may also have negative effects on sleep quality. Too little protein (less than 16% of daily energy intake) has been found to negatively affect sleep quality and falling asleep, while too much protein (more than 19% of daily energy intake) has been found to make it harder to stay asleep. Some protein sources contain tryptophan, which the brain uses to produce serotonin.
Carbohydrates
When it comes to carbohydrates, if you’re aiming to improve your sleep quality, it’s worth focusing on getting enough fiber.
Exercise and everyday activity have also been shown to have positive effects on sleep. General exercise guidelines recommend 150 minutes of moderate exercise or 75 minutes of vigorous exercise per week, plus strength training twice a week. This can also serve as a good guideline for good sleep.
Some people may find that evening exercise makes it harder to fall asleep. High-intensity exercise (≥77% of max heart rate) done less than four hours before bedtime may impair sleep quality by shortening REM sleep, but low-intensity evening exercise (≤63% of max heart rate) has been shown in studies to shorten the time it takes to fall asleep, and moderate-intensity evening exercise (64–76% of max heart rate) has been shown to improve sleep quality by reducing nighttime awakenings and increasing the share of NREM stage 2 sleep.
Caffeine, alcohol, and nicotine consumed in the afternoon have a negative effect on the quality and length of sleep.
Caffeine is a very commonly used stimulant found in, for example, coffee, tea, and energy drinks. Consuming caffeine in the afternoon and close to bedtime negatively affects sleep quality and increases the time it takes to fall asleep, as well as shortening sleep duration by up to 30–60 minutes. Both the amount and timing of caffeine matter for sleep. According to studies, the last small dose of caffeine (about 107 mg of caffeine) should be consumed 8.8 hours before bedtime, and a large dose of caffeine (about 217.5 mg of caffeine) should be consumed 13.2 hours before bedtime, in order to avoid negative effects on sleep. The closer to bedtime caffeine is consumed after these time points, the more your night’s sleep is shortened. The larger the dose of caffeine, the stronger its negative effect.
Drinking alcohol close to bedtime negatively affects sleep quality. Even about two servings of alcohol impair sleep quality by delaying the onset of REM sleep and shortening the time spent in it. It’s recommended to stop drinking alcohol at least four hours before bedtime.
Nicotine is a stimulant that affects the central nervous and circulatory systems. Nicotine use has been found to negatively affect sleep quality, duration, and falling asleep. Nicotine use, on its own, already impairs sleep, but it’s recommended to stop using it at least four hours before bedtime.
Poorly timed naps can make it harder to fall asleep and reduce the quality of night sleep. Studies have found that people who nap less than seven hours before bedtime tend to have poorer-quality sleep at night. People who nap often and late in the day may also experience more fragmented sleep.
Published: 14.10.2025
Updated: 3.8.2026
The text is a translation from the original Finnish-language text.
Lassi Honkanen
physiotherapist
Blumberg, M. S., Lesku, J. A., Libourel, P-A., Schmidt, M. H., Rattenborg, N. C. 2020. What is REM sleep? Current Biology, Volume 30, Issue 1, R38 - R49. https://doi.org/10.1016/j.cub.2019.11.045
Boivin, D. B., Boudreau, P., & Kosmadopoulos, A. (2022). Disturbance of the Circadian System in Shift Work and Its Health Impact. Journal of biological rhythms, 37(1), 3–28. https://doi.org/10.1177/07487304211064218
Brown, T. M., Brainard, G. C., Cajochen, C., Czeisler, C. A., Hanifin, J. P., Lockley, S. W., Lucas, R. J., Münch, M., O'Hagan, J. B., Peirson, S. N., Price, L. L. A., Roenneberg, T., Schlangen, L. J. M., Skene, D. J., Spitschan, M., Vetter, C., Zee, P. C., & Wright, K. P., Jr (2022). Recommendations for daytime, evening, and nighttime indoor light exposure to best support physiology, sleep, and wakefulness in healthy adults. PLoS biology, 20(3), e3001571. https://doi.org/10.1371/journal.pbio.3001571
Carissa Gardiner, Jonathon Weakley, Louise M. Burke, Gregory D. Roach, Charli Sargent, Nirav Maniar, Andrew Townshend, Shona L. Halson, The effect of caffeine on subsequent sleep: A systematic review and meta-analysis, Sleep Medicine Reviews, Volume 69, 2023, 101764, ISSN 1087-0792, https://doi.org/10.1016/j.smrv.2023.101764
Carissa Gardiner, Jonathon Weakley, Louise M. Burke, Gregory D. Roach, Charli Sargent, Nirav Maniar, Minh Huynh, Dean J. Miller, Andrew Townshend, Shona L. Halson, The effect of alcohol on subsequent sleep in healthy adults: A systematic review and meta-analysis, Sleep Medicine Reviews, Volume 80, 2025, 102030, ISSN 1087-0792, https://doi.org/10.1016/j.smrv.2024.102030
Christine E Spadola, Na Guo, Dayna A Johnson, Tamar Sofer, Suzanne M Bertisch, Chandra L Jackson, Michael Rueschman, Murray A Mittleman, James G Wilson, Susan Redline, Evening intake of alcohol, caffeine, and nicotine: night-to-night associations with sleep duration and continuity among African Americans in the Jackson Heart Sleep Study, Sleep, Volume 42, Issue 11, November 2019, zsz136, https://doi.org/10.1093/sleep/zsz136
Cleveland clinic. 2020. If you fall asleep instantly - Is that a good thing? https://health.clevelandclinic.org/if-you-fall-asleep-instantly-is-that-a-good-thing-2
Consensus Conference Panel, Watson, N. F., Badr, M. S., Belenky, G., Bliwise, D. L., Buxton, O. M., Buysse, D., Dinges, D. F., Gangwisch, J., Grandner, M. A., Kushida, C., Malhotra, R. K., Martin, J. L., Patel, S. R., Quan, S. F., Tasali, E., Non-Participating Observers, Twery, M., Croft, J. B., Maher, E., … Heald, J. L. (2015). Recommended Amount of Sleep for a Healthy Adult: A Joint Consensus Statement of the American Academy of Sleep Medicine and Sleep Research Society. Journal of clinical sleep medicine : JCSM : official publication of the American Academy of Sleep Medicine, 11(6), 591–592. https://doi.org/10.5664/jcsm.4758
Edward C Harding, Nicholas P Franks, William Wisden, Sleep and thermoregulation, Current Opinion in Physiology, Volume 15, 2020, Pages 7-13, ISSN 2468-8673, https://doi.org/10.1016/j.cophys.2019.11.008
I. Geneva, I. (2024). Human Body Temperature Circadian Rhythm in Health and Disease. IntechOpen. https://doi.org/10.5772/intechopen.1003852
Kelley, G. A., & Kelley, K. S. (2017). Exercise and sleep: a systematic review of previous meta-analyses. Journal of evidence-based medicine, 10(1), 26–36. https://doi.org/10.1111/jebm.12236
Len De Nys, Kerry Anderson, Esther F. Ofosu, Gemma C. Ryde, Jenni Connelly, Anna C. Whittaker, The effects of physical activity on cortisol and sleep: A systematic review and meta-analysis, Psychoneuroendocrinology, Volume 143, 2022, 105843, ISSN 0306-4530, https://doi.org/10.1016/j.psyneuen.2022.105843
Mograss, M., Abi-Jaoude, J., Frimpong, E., Chalati, D., Moretto, U., Tarelli, L., Lim, A., & Dang-Vu, T. T. (2022). The effects of napping on night-time sleep in healthy young adults. Journal of sleep research, 31(5), e13578. https://doi.org/10.1111/jsr.13578
Oelke M, De Wachter S, Drake MJ, et al. A practical approach to the management of nocturia. Int J Clin Pract. 2017; 71:e13027. https://doi.org/10.1111/ijcp.13027
Patel AK, Reddy V, Shumway KR, et al. Physiology, Sleep Stages. [Updated 2024 Jan 26]. In: StatPearls [Internet]. Treasure Island (FL): StatPearls Publishing; 2025 Jan-. Available from: https://www.ncbi.nlm.nih.gov/books/NBK526132/
Shahab Haghayegh, Sepideh Khoshnevis, Michael H. Smolensky, Kenneth R. Diller, Richard J. Castriotta, Before-bedtime passive body heating by warm shower or bath to improve sleep: A systematic review and meta-analysis, Sleep Medicine Reviews, Volume 46, 2019, Pages 124-135, ISSN 1087-0792, https://doi.org/10.1016/j.smrv.2019.04.008
Summer, J. V., Singh, A. 2024. Napping benefits and tips. Sleep foundation. https://www.sleepfoundation.org/napping
The National Sleep Foundation. 2025. Good Light, Bad Light and Better Sleep. https://www.thensf.org/good-light-bad-light-and-better-sleep/
You and your Hormones. 2021. Hormones. Melatonin. https://www.yourhormones.info/hormones/melatonin/
Yue, T., Liu, X., Gao, Q., & Wang, Y. (2022). Different Intensities of Evening Exercise on Sleep in Healthy Adults: A Systematic Review and Network Meta-Analysis. Nature and science of sleep, 14, 2157–2177. https://doi.org/10.2147/NSS.S388863