“There is no question that good quality and a sufficient duration of sleep are beneficial to reaching or maintaining a healthy weight,” says Peter Polos, MD, PhD, sleep medicine specialist and Sleep Number sleep expert based in Edison, New Jersey. That’s because a lack of sleep can throw your diet and exercise routines off course. If you’ve ever gotten a poor night’s rest and found yourself reaching for chips and sweets the next day, you’ve seen this in action. Read on to learn why the body responds that way and what you can do to optimize your sleep to stay on track with your weight goals.

What Happens During Sleep

It comes as no surprise that we all need sleep. “Getting good sleep, like breathing and eating, is one of life’s basic necessities,” says Shanon Makekau, MD, chief of pulmonology and sleep medicine director at Kaiser Permanente in Honolulu. Sleep is essential to give the brain and the body time to slow down and recover from the day, which ultimately promotes better physical and mental performance, according to the Sleep Foundation. Dr. Makekau adds that sleep improves mood stability, bolsters daytime energy and productivity, reduces accidents, and supports the immune system.

How Lack of Sleep May Affect Weight

Sleep can benefit your weight, too. “Getting too little sleep contributes to weight gain by upsetting the balance between how much we eat and how much fuel we burn,” Makekau says. There are two primary reasons for this. For one, not sleeping well at night can make you hungrier the next day. According to the Sleep Foundation, that is because sleep deprivation leads to increased levels of the neurotransmitter ghrelin, which makes you feel hungry, and lower levels of leptin, which makes you feel full. “This can result in increased appetite, and hence weight gain,” Dr. Polos says. It can come on quickly, too. A study found ghrelin and feelings of hunger are increased after only one night of sleep deprivation. There’s also the simple fact that if you’re not sleeping as much, you’re awake more hours of the day and have more opportunities to eat, Makekau says. Oftentimes, the foods you reach for when you’re sleep deprived, such as donuts and fried food, aren’t the best choices. “Sleep-deprived individuals tend to eat foods with greater amounts of carbohydrates and calories,” Polos says. Spending more time asleep, then, can lead to fewer calories consumed during the day. A recent randomized clinical trial involving young overweight adults found that extending sleep duration from 6.5 hours to about 7.7 hours a night resulted in a reduced calorie intake of about 270 calories per day. The second reason decreased sleep can lead to weight gain is that you’ll likely move less if you’re tired. “People who don’t get enough sleep are more sedentary and are less likely to engage in moderate to vigorous activities such as sports or exercise,” Makekau says. Think of the last time you got only five or six hours of sleep. You likely struggled to get through the day and were not raring to go to the gym to work out.

Research Linking Sufficient Quality Sleep and Healthy Habits

Many studies support the connection between sleep and weight. Previous research including data from 68,000 participants compared women who slept seven hours a night and women who slept five hours or less. Those who logged less sleep were 15 percent more likely to become obese. As mentioned, poor sleep can lead to unhealthy diet choices. More sleep may also encourage healthier food choices during the day. “While research is ongoing to better define the relationship between sleep and dietary habits, there is a large body of data that supports the role of good sleep in the overall maintenance of health and well-being,” Makekau says. One small study, for instance, found staying in bed an extra hour or so led to a decreased intake of fat, carbs, and sugar during the day, compared with the control group. “Getting enough good-quality sleep supports daytime energy, mood, concentration, and motivation,” Makekau says. “All of these factors play an important role in making good choices during the daytime.” Research also supports the idea that poor sleep can lead to lower activity levels, according to one article. The researchers noted that low energy and higher levels of fatigue and sleepiness tend to make people less likely to exercise. Another previous study set out to discover just how much poor sleep can impact activity levels, and it was observed that reducing nighttime sleep to five and a half hours led to a 24 percent reduction in moderate-to-vigorous activity among a small group of study participants at risk of type 2 diabetes. Be careful not to sleep too much though, as that can also lead to weight gain. Previous research followed a group of adults for six years and found those who slept between five and six hours each night were 35 percent more likely to experience an 11-pound weight gain — but also that long sleepers (those who slept between 9 and 10 hours) were 25 percent more likely to experience the same amount of weight gain, when compared with people who slept seven to eight hours per night. Long sleep time is associated with more time spent in bed and less time burning calories.

6 Healthy Habits for Better Sleep

Ultimately, sleep should be a priority if you’re looking to reach or maintain a healthy weight. “It’s one of the fundamental elements of maintaining a healthy lifestyle in general, particularly if weight management is a goal,” Makekau says. Ready to commit to logging more sleep at night? Here are a few tips from the Sleep Foundation that will ultimately benefit your weight and body.