A new study has found that sleep deprivation results in the munchies.

A new study has found that poor sleep has some striking similarities to marijuana use — which could help scientists better understand how bad sleep affects our bodies.

The study found that those who are sleep deprived get the “munchies,” or an intense craving to chow down on snacks similar to those who have been consuming marijuana, according to a statement from the University of Chicago Medical Center.

Researchers examined endocannabinoids, receptors in the brain named after cannabis, and found that they were a main driver in the food cravings from sleep deprivation. In patients who didn’t get enough sleep, these endocannabinoids were amped up in the blood, resulting in people being hungrier.

The study was a small one, involving 14 non-obese people between 18 and 30 years old. They had four nights of either good or bad sleep, and then they were given two regular meals and access to an unlimited amount of unhealthy snacks like junk food and ice cream, as well as healthy snacks like fruit.

Those who hadn’t gotten enough sleep tended to binge on snacks more, and ate twice as much fat and protein as those who had gotten adequate sleep.

“We found that sleep restriction boosts a signal that may increase the hedonic aspect of food intake, the pleasure and satisfaction gained from eating,” Erin Hanlon, PhD, a research associate in endocrinology, diabetes and metabolism at the University of Chicago, said in the statement. “Sleep restriction seems to augment the endocannabinoid system, the same system targeted by the active ingredient of marijuana, to enhance the desire for food intake.”

She added: “The energy costs of staying awake a few extra hours seem to be modest. One study has reported that each added hour of wakefulness uses about 17 extra calories. That adds up to about 70 calories for the four hours of lost sleep. But, given the opportunity, the subjects in this study more than made up for it by bingeing on snacks, taking in more than 300 extra calories. Over time, that can cause significant weight gain.”