For more than a century, folklore and cartoons have warned us: eat cheese before bed, and you’re in for a strange night. Winsor McCay’s 1904 comic strip Dream of the Rarebit Fiend famously turned the spicy cheese toast called Welsh rarebit into a portal for surreal, unsettling dreams. Now, a new study suggests McCay may have been on to something.
Researchers led by Dr. Tore Nielsen at the University of Montreal report a striking link between certain food sensitivities (especially lactose intolerance) and experiencing nightmares. Drawing on a large survey of over a thousand university students, the study uncovers how what we eat, when we eat it, and how our bodies respond may all conspire to shape the landscapes of our dreams.

The team surveyed 1,082 undergraduate students, asking about sleep patterns, diet, food sensitivities, and dream content. Nearly a third of participants reported frequent nightmares. Around 40% believed food affected their sleep, and about 5.5% said specific foods impacted their dreams.
Of those who saw a connection between food and their dreams, most pointed to desserts, sweets, or dairy. “The Rarebit Fiend version of this hypothesis, blaming cheesy meals in particular, was supported in the present results,” the researchers noted.
Dr. Tore Nielsen, who leads the Dream & Nightmare Laboratory at Montreal’s Sacred Heart Hospital, explained: “Nightmare severity is robustly associated with lactose intolerance and other food allergies. These new findings imply that changing eating habits for people with some food sensitivities could alleviate nightmares. They could also explain why people so often blame dairy for bad dreams!”
Cheese, Gas, and the Nightmind
Participants with lactose intolerance were significantly more likely to experience nightmares and report poor sleep. The researchers believe gastrointestinal symptoms, such as bloating, cramping, or gas, may be to blame. These discomforts, especially when they strike at night, can disrupt sleep and seep into dreams.
“Nightmares are worse for lactose-intolerant people who suffer severe gastrointestinal symptoms and whose sleep is disrupted,” Nielsen told The Times. “This makes sense, because we know that other bodily sensations can affect dreaming.”
A sophisticated mediation analysis supported this link. The data showed that lactose intolerance predicted nightmare severity, but the connection disappeared when researchers controlled for gastrointestinal symptoms. So the culprit wasn’t simply cheese, but what cheese does to a lactose-intolerant body during sleep.
Sweets, Spicy Foods, and Timing
Dairy wasn’t the only suspect. Sweets were blamed more often than cheese for disturbing or bizarre dreams, according to both the published data and participants’ open responses. Spicy foods came next.
The timing of meals also mattered. Eating late at night, particularly when not hungry, was associated with more nightmares and negative dreams. People who ate less in the evening were typically more likely to remember their dreams, while the other bunch tended to experience more dream negativity.
Interestingly, participants who reported healthier eating habits, such as listening to internal hunger cues or avoiding emotional eating, had better sleep and remembered their dreams more often. People who consumed more fruits, vegetables, and herbal teas reported improved sleep.
Meanwhile, those with high evening eating scores and poor diet patterns had the opposite experience: disrupted sleep, emotionally negative dreams, and more frequent nightmares.
Yet the researchers caution that correlation is not causation. “It remains unclear whether the dietary factors assessed cause dream changes, whether dreaming affects dietary choices, or whether some third factor affects both diet and dreaming,” they write.

A Broader Gut-Brain Connection
The findings echo emerging research on the gut-brain axis, the complex, bidirectional communication between our digestive system and central nervous system. Conditions like Irritable Bowel Syndrome (IBS), which involve disruptions to serotonin signaling, usually affect both mood and sleep. Some studies even suggest that gut health can influence nightmares, especially in conditions like PTSD.
“There is a growing body of research examining the relationship of diet to post-traumatic stress disorder,” Nielsen noted, “a major characteristic of which is the frequent occurrence of nightmares.” Diets rich in anti-inflammatory foods—such as the Mediterranean diet—have been linked to reduced PTSD symptoms and more stable dream content.
So was McCay’s Rarebit Fiend comic just a work of absurdist fiction, or a prophetic warning from the gut? The new study suggests the line between cultural belief and biological reality may be thinner than we thought.
“We are routinely asked whether food affects dreaming—especially by journalists on food-centric holidays,” Nielsen said. “Now we have some answers.”
Still, he and his colleagues are not finished. They hope to conduct controlled experiments next. “We would like to run a study in which we ask people to ingest cheese products versus some control food before sleep to see if this alters their sleep or dreams,” Nielsen said.
Until then, if you find yourself haunted by dreams after a cheesy snack or sweet dessert, you now have a clue as to why that’s happening. Your stomach, and what it sends to your sleeping brain, might be the culprit.
The findings appeared in the journal Frontiers in Psychology.