Why you sleep badly, and which causes you can fix
In healthy adults, most bad nights come from a handful of everyday causes: caffeine later in the day than it feels safe, alcohol in the evening, bright light and screens late at night, irregular sleep times and a bedroom that is too warm. Each of them is a habit or a setting, so each can be changed, and the test above shows which ones apply to you. When poor sleep lasts for months despite good habits, the more likely cause is insomnia, and insomnia has an effective treatment that works without pills.
Key takeaways
- Caffeine from a mid-afternoon coffee is often still active at bedtime.
- A drink before bed helps you fall asleep and then makes the second half of the night more restless.
- Evening exercise does not harm sleep for most people, except a hard workout in the last hour before bed.
- A warm, humid bedroom costs deep sleep, while a cool room with warm bedding disturbs it much less.
- Long-lasting insomnia is best treated with a specific form of talking therapy, which doctors recommend before sleeping pills.
Why can a coffee at 3 PM still matter at midnight?
Because caffeine stays in the body for hours, and it shortens sleep even when you fall asleep without trouble. A review of 24 studies found that caffeine cut total sleep by 45 minutes on average and reduced the share of deep sleep (Gardiner et al., 2023). To avoid losing sleep, the authors calculated that a normal cup of coffee should come at least 8.8 hours before bed and a pre-workout drink at least 13.2 hours before. In an earlier home study, a large dose taken six hours before bed still disturbed sleep in a measurable way (Drake et al., 2013). The article on when to stop drinking coffee works out a cutoff for your own bedtime.
Does a nightcap help you sleep?
It helps you fall asleep and then takes something back. A review of all known studies on alcohol and sleep in healthy people found the same pattern at every dose: people fell asleep faster and slept more soundly in the first half of the night, and their sleep was more disrupted in the second half (Ebrahim et al., 2013). Dream sleep started later, and at moderate and higher amounts there was less of it overall. That second-half restlessness fits the familiar experience of waking at 3 or 4 AM after a few glasses. The article on wine and sleep has the details, including what a sleep tracker shows.
Are screens in bed really a problem?
They can be, mainly through their light. In a lab study, people read either a printed book or an e-book on a light-emitting tablet in the hours before bed (Chang et al., 2015). With the tablet, they took longer to fall asleep, felt less sleepy in the evening, released less of the sleep hormone melatonin, their body clock shifted later, and they were less alert the next morning. The same research team points to a survey in which 90 % of Americans used some kind of electronic device within the hour before bed at least a few nights a week.
The study measured reading under controlled conditions over several hours, so it says little about a short look at your messages. What it does show is the direction: bright light late in the evening moves your body clock later, which is the opposite of what most people want. Night mode, low brightness and a phone that charges outside the bedroom all reduce that light. If you are a late type anyway, the chronotype test explains why evening light matters even more for you.
Does sleeping at different times matter?
More than most people think. In a UK study, 60,977 people wore a movement sensor on the wrist, which gave the researchers more than ten million hours of data on when people actually slept (Windred et al., 2024). Over the next six years or so, the people with the most regular rhythm had a 20 to 48 % lower risk of dying than those with the least regular one, depending on the group, and regularity predicted the risk better than the number of hours slept. It is an observational study, so it shows a link, and the article on a regular bedtime explains what it means for your week. Duration still counts: US sleep experts recommend at least seven hours a night for adults (Watson et al., 2015).
How warm should a bedroom be?
Cool, with warm bedding. A review of the research on temperature and sleep found that, in real life with blankets and pajamas, heat is the bigger problem: a warm bedroom means more time awake and less deep sleep and dream sleep, and humid heat makes it worse (Okamoto-Mizuno & Mizuno, 2012). Cold air affected sleep stages much less as long as the bedding kept the body warm. The same review describes the climate people sleep best in as the space between the body and the covers at around 32 to 34 °C. The authors add that the effects of cold on the heart during sleep still need more research.
Is it bad to exercise in the evening?
Usually not, which surprises people who were told the opposite. A review of 23 studies compared nights after an evening workout with nights without one, in healthy adults (Stutz et al., 2019). Overall, evening exercise did not make sleep worse and even added a little deep sleep. The exception was vigorous exercise that ended an hour or less before bed, after which falling asleep could take longer and sleep could be shorter. A run after work is fine. An intense interval session right before bed is the one to move.
What if the habits are fine and you still can’t sleep?
Then it may be insomnia, and the first treatment for it is a talking therapy. The American College of Physicians recommends cognitive behavioral therapy for insomnia, usually called CBT-I, as the initial treatment for all adults with chronic insomnia (Qaseem et al., 2016). The recommendation is strong and based on randomized trials. Sleeping pills come later in the guideline, for short-term use and only after a discussion of benefits, harms and costs when CBT-I alone has not worked. CBT-I works on the habits and thoughts that keep sleeplessness going, such as lying awake in bed for hours or worrying about the next day, and it is also offered as an online program.
What I’d do
- Set your caffeine cutoff about nine hours before your usual bedtime, and earlier for strong drinks.
- Keep alcohol for earlier in the evening, or skip it on nights when good sleep matters.
- Charge your phone outside the bedroom and read on paper in the last hour.
- Wake up at the same time every day, including weekends, within about an hour.
- Keep the bedroom cool and quiet, and use the duvet for warmth.
- Ask your doctor about CBT-I if you have slept badly on most nights for months, and get checked if someone notices that you snore loudly or stop breathing in your sleep.
Sources
- Chang, A.-M., Aeschbach, D., Duffy, J. F., & Czeisler, C. A. (2015). Evening use of light-emitting eReaders negatively affects sleep, circadian timing, and next-morning alertness. Proceedings of the National Academy of Sciences, 112(4), 1232–1237. https://doi.org/10.1073/pnas.1418490112
- Drake, C., Roehrs, T., Shambroom, J., & Roth, T. (2013). Caffeine effects on sleep taken 0, 3, or 6 hours before going to bed. Journal of Clinical Sleep Medicine, 9(11), 1195–1200. https://doi.org/10.5664/jcsm.3170
- Ebrahim, I. O., Shapiro, C. M., Williams, A. J., & Fenwick, P. B. (2013). Alcohol and sleep I: Effects on normal sleep. Alcoholism: Clinical and Experimental Research, 37(4), 539–549. https://doi.org/10.1111/acer.12006
- Gardiner, C., Weakley, J., Burke, L. M., Roach, G. D., Sargent, C., Maniar, N., Townshend, A., & Halson, S. L. (2023). The effect of caffeine on subsequent sleep: A systematic review and meta-analysis. Sleep Medicine Reviews, 69, 101764. https://doi.org/10.1016/j.smrv.2023.101764
- Okamoto-Mizuno, K., & Mizuno, K. (2012). Effects of thermal environment on sleep and circadian rhythm. Journal of Physiological Anthropology, 31, 14. https://doi.org/10.1186/1880-6805-31-14
- Qaseem, A., Kansagara, D., Forciea, M. A., Cooke, M., & Denberg, T. D. (2016). Management of chronic insomnia disorder in adults: A clinical practice guideline from the American College of Physicians. Annals of Internal Medicine, 165(2), 125–133. https://doi.org/10.7326/M15-2175
- Stutz, J., Eiholzer, R., & Spengler, C. M. (2019). Effects of evening exercise on sleep in healthy participants: A systematic review and meta-analysis. Sports Medicine, 49(2), 269–287. https://doi.org/10.1007/s40279-018-1015-0
- 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. (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, 11(6), 591–592. https://doi.org/10.5664/jcsm.4758
- Windred, D. P., Burns, A. C., Lane, J. M., Saxena, R., Rutter, M. K., Cain, S. W., & Phillips, A. J. K. (2024). Sleep regularity is a stronger predictor of mortality risk than sleep duration: A prospective cohort study. Sleep, 47(1), zsad253. https://doi.org/10.1093/sleep/zsad253