Cheese and other dairy products are known to cause digestive discomfort for people with lactose intolerance. Now, emerging research suggests they may also affect sleep quality and even contribute to nightmares in certain individuals.

A study published in Frontiers in Psychology explored the relationship between diet, sleep, and dreaming, finding that food sensitivities—especially lactose intolerance—may be linked to more frequent and intense nightmares.


How Diet May Influence Dreams and Sleep

Study findings on food and sleep quality

Researchers surveyed over 1,000 college students in Canada about their eating habits, sleep patterns, physical and mental health, and dream experiences. More than 40% of participants reported that what or when they ate affected their sleep quality.

Foods linked to poorer sleep

Dairy products and sweets were most commonly associated with disrupted sleep, while fruits, vegetables, and herbal teas were linked to better rest.

Nightmares tied to food sensitivities

Although only a small percentage of participants believed their diet affected their dreams, researchers found that people with lactose intolerance or food allergies experienced more severe nightmares after data analysis.


The Link Between Lactose Intolerance and Nightmares

Digestive discomfort during sleep

Lactose intolerance occurs when the body lacks enough lactase enzyme to digest lactose, a natural sugar in milk. This can lead to bloating, gas, abdominal pain, and diarrhea—symptoms that may interfere with sleep.

How gut symptoms may affect dreaming

Gastrointestinal discomfort during sleep can disrupt sleep stages, particularly REM sleep, which is when dreams are most vivid. Sleep disturbances during this phase may increase the likelihood of nightmares or negative dream content.

Late-night eating may worsen effects

Participants who ate late at night or ignored hunger cues were more likely to report poor sleep and distressing dreams, possibly due to increased digestive strain during sleep.


Why the Evidence Is Not Definitive

Limitations of the study

The research relied on self-reported survey data and focused on a college-aged population, which may limit how broadly the results apply. Participants also received academic incentives for completing the survey, potentially introducing bias.

Mixed findings from other research

Other studies suggest dairy may actually improve sleep for people without lactose intolerance. Milk contains tryptophan, an amino acid involved in producing serotonin and melatonin—hormones that regulate sleep.

Lack of data on lactose-intolerant adults

There is limited research specifically examining how dairy affects sleep in lactose-intolerant adults, making it difficult to draw firm conclusions.


How Diet Impacts Sleep Overall

Foods known to disrupt sleep

High intakes of sugar, caffeine, and alcohol are well known to interfere with sleep quality and duration.

Healthier diets support better sleep

Diets rich in fruits, vegetables, fiber, and whole foods are consistently linked to lower risk of sleep disorders, while highly processed diets are associated with poorer sleep outcomes.

The gut–brain connection

Physical discomfort, including digestive distress, can influence dream content. Bodily sensations during REM sleep may be incorporated into dreams, potentially triggering negative or distressing imagery.


What to Eat—and Avoid—for Better Sleep

Foods to limit before bed

If you experience lactose intolerance or food sensitivities, it may help to avoid dairy—especially cheese or milk—close to bedtime.

Foods that may support restful sleep

  • Eggs, fish, nuts, mushrooms, and tart cherry juice for melatonin

  • Poultry, seeds, and egg whites for tryptophan

  • Bananas, leafy greens, legumes, and avocados for magnesium

Focus on overall diet quality

A sleep-supportive diet is generally high in fruits, vegetables, and fiber, and lower in red and processed meats.