Even though we know it’s not good for us, let’s face it: junk food can be pretty darn tasty, and you’re only human if you struggle to say no to an oozy slice of pizza or fudgy slice of decadent chocolate cake. But if you’re not getting enough sleep, that little devil on your shoulder might be even harder to ignore, leading to poor food choices and some extra inches around the waistline. Now we have an even greater insight as to why that might be, thanks to a new study. Turns out, a lack of Z’s effectively gives you the marijuana munchies.

“We found that sleep restriction boosts a signal that may increase the hedonic aspect of food intake, the pleasure and satisfaction gained from eating,” study author Erin Hanlon from the University of Chicago said in a statement. That signal is something called an endocannabinoid, a molecule which, like marijuana, targets a system in our body that regulates an array of physiological processes, such as appetite and pain.

Although the levels of this endocannabinoid, called 2-AG, naturally fluctuate daily, rising during our waking hours and falling past lunchtime, the team found that sleep deprivation can result in an abnormally high amount circulating in the body that lingers even throughout the evening. This, the researchers say, may well contribute to the excessive food intake often seen in people who repeatedly don’t get enough sleep, even though staying awake doesn’t actually demand that much more energy.

Described in the journal Sleep, the researchers began their investigation with 14 young, healthy adults that they exposed to two different conditions: “normal” sleep of 7.5 hours a night, or restricted sleep of just 4 hours, both for four days straight.

Getting a good night's sleep might help you resist those junk food cravings. Gravicapa/Shutterstock

Throughout their stay at the institution the volunteers were fed three times a day and their hunger levels were regularly assessed, in addition to being given blood tests to look at endocannabinoid levels. This revealed that sleep restriction came with an increase in 2-AG, which crept up to levels more than 30 percent greater than those recorded after a full night’s sleep. In addition, peak levels shifted forward by an hour and a half, reaching their highest at 2 p.m. as opposed to the typical 12:30 p.m, and remained heightened until 9 p.m. As anticipated, this corresponded with an increase in reported hunger levels.

After the fourth night of each scenario, volunteers were presented with a buffet of all their favorite snack foods which they were allowed to stuff themselves with for an hour. Despite having consumed 90 percent of their daily caloric need only one hour before, after being deprived of sleep the participants had much more difficulty limiting the amount they ate. They also tended to go for the higher calorie, fat-laden foods, eating almost 400 more calories and twice as much fat than when they had a good night’s kip.

These differences in food intake, the researchers say, may be at least in part down to the observed dysregulation in the endocannabinoid system. Sleep restriction is known to increase levels of a hunger-boosting hormone called ghrelin, while also suppressing our body’s satiety signal leptin, so it may well be that all three work together to create an increased drive for food. Precisely how a lack of sleep disrupts the endocannabinoid system, however, remains unknown.

"We don't know where these endocannabinoids are coming from," Hanlon told IFLScience. "We know how they're produced in the brain, but don't know how they're produced in the body. Finding that out is a priority of my research."

While the team admits it was a small study, there is an increasing amount of evidence to suggest that insufficient sleep may increase the risk for obesity, so data such as this could be useful in public health campaigns and preventive strategies. In addition, Hanlon points out to IFLScience that it might be possible to manipulate the endocannabinoid system in order to treat obesity.