You’ve tried the sound machine, swapped your sheets, maybe even upgraded your mattress—but you’re still tossing and turning. The culprit? It might not be your bedtime routine—it might be your diet.

According to the Sleep Foundation, the foods and drinks you consume throughout the day can significantly affect the quality and duration of your sleep. And at the center of it all? Your gut.

Recent research shows that our gut microbiome—the trillions of bacteria, fungi, and other microorganisms living in our digestive tract—plays a major role in regulating sleep, mood, immune function, and so much more. It turns out that rest and digestion are more connected than we once thought.

Here’s what the science says—and how to support better sleep from the inside out.

Avo Eco Organic Mattress

Photo courtesy of Avocado.

Read more: Unwind With These Bedtime Yoga Stretches For Better Sleep

The Gut-Brain-Sleep Connection

Your gut and your brain are in constant communication. This superhighway of information, known as the gut-brain axis, links the emotional and cognitive centers of your brain with your digestive system.

A key player in this system is the vagus nerve, which carries signals between the gut and the brain and influences everything from mood to inflammation—and yes, sleep. Disruptions in the microbiome can impact how well these signals flow, potentially leading to sleep disturbances or chronic fatigue.

In a 2020 study published in Frontiers in Psychiatry, researchers found that gut microbiome diversity was positively associated with increased sleep efficiency and total sleep time. In other words, the more balanced and diverse your gut bacteria, the better your chances of getting quality rest.

How Gut Health Impacts Sleep

Here are a few of the main ways your gut health and sleep are linked:

1. Melatonin Production

Melatonin is the hormone that regulates your sleep-wake cycle. While it’s primarily produced in the brain, about 90% of the body’s serotonin (a precursor to melatonin) is actually made in the gut. Poor gut health can interfere with serotonin production, which in turn affects your ability to produce melatonin and maintain a healthy circadian rhythm.

2. Inflammation and Stress

Imbalanced gut bacteria can lead to chronic inflammation, which has been associated with poor sleep quality. A disrupted gut can also trigger stress responses in the body, increasing cortisol levels and making it harder to fall or stay asleep. A 2022 review in Sleep Medicine Reviews highlights how systemic inflammation may be a key driver of insomnia and sleep fragmentation.

3. Digestive Discomfort

Bloating, gas, or indigestion caused by gut imbalances can keep you awake at night or make sleep less restful. If your system is working overtime to process food or combat inflammation, it can interfere with the deep sleep stages your body needs to recover, and the discomfort alone is enough to keep anyone tossing and turning. 

What to Eat for Better Gut (and Sleep) Health

So, let’s get into the nitty gritty. What you eat can support both your digestive health and your ability to rest deeply. Here’s what to focus on:

1. PREbiotic-Rich Foods

Prebiotics are non-digestible fibers that act as food for your good gut bacteria. You’ll find them in:

  • Garlic
  • Onions
  • Leeks
  • Asparagus
  • Bananas
  • Oats

These humble ingredients do a lot behind the scenes—feeding the good bacteria in your gut, supporting digestion, and helping you wind down when it’s time to hit the pillow. Think of them as your microbiome’s favorite snacks.

Read More: Probiotics vs. Prebiotics — Are They Good For Gut Health?

2. PRObiotic Foods

Probiotics are live bacteria that help to break down foods and other things your body digests. Here are a few probiotic-rich foods you can incorporate: 

  • Yogurt
  • Kefir
  • Kimchi
  • Sauerkraut
  • Miso
  • Tempeh

Probiotic foods help keep your gut community balanced and thriving, which can make a big difference in how well you sleep, how calm you feel, and how smoothly your system runs. Bonus: they add a flavorful kick to any recipe.

shopping for food

Photo courtesy of Pexels.

Read More: Cozy Up with Our Creamy Carrot Miso Ginger Soup

3. Complex Carbohydrates

Whole grains and fiber-rich carbs help promote serotonin production and reduce late-night cortisol spikes. Reach for these at dinner for a better chance at deep sleep:

  • Brown rice
  • Quinoa
  • Sweet potatoes
  • Steel-cut oats

These slow-burning carbs help regulate blood sugar, promote serotonin production, and give your body the steady energy it needs to power down peacefully. Plus, these warm foods are cozy and comforting, which is great for nervous system regulation. 

4. Magnesium and Tryptophan Sources

Magnesium and tryptophan-rich foods support muscle relaxation and melatonin production. Good options include:

  • Almonds
  • Pumpkin seeds
  • Turkey
  • Chickpeas
  • Leafy greens

Magnesium helps your muscles relax, tryptophan helps your brain chill—and together, they’re like a lullaby in food form. Keep these staples in rotation for a calmer mind and a sleepier body come bedtime.

What to Avoid

Of course, some foods and habits can work against your gut—and your sleep. A few things to cut back on:

  • Highly processed foods: These often lack fiber and beneficial nutrients, and they may disrupt your microbiome balance.
  • Sugar and refined carbs: These can spike blood sugar and cause digestive stress, especially at night.
  • Caffeine after 2 p.m.: Not only does it interfere with sleep directly, but it can also irritate the gut lining for sensitive individuals.
  • Heavy or spicy meals too close to bed: These may lead to reflux or indigestion, keeping you awake or uncomfortable long after dinner.

Habits That Support Both Sleep and Digestion

Your lifestyle matters just as much as what’s on your plate. A few simple shifts can go a long way:

  • Eat dinner at least 2–3 hours before bed to allow for time to digest.
  • Get morning sunlight to support circadian rhythms and gut-brain signaling.
  • Move your body regularly—exercise supports both digestion and sleep.
  • Manage stress through yoga, journaling, or breathwork—chronic stress affects the gut and increases cortisol levels, which can disturb sleep.
  • Prioritize consistent bed and wake times to reinforce your sleep cycle.

What the Experts Say

According to Dr. Michael Breus, board-certified sleep specialist and author of The Power of When, “Your gut is like your second brain. If it’s not working properly, your sleep will suffer—period.” He recommends building a consistent sleep-and-eat rhythm to help align your microbiome and circadian system.

A 2022 article from Harvard Health confirms that “the gut microbiome has a direct line to your brain, and imbalances can lead to sleep issues ranging from insomnia to fragmented sleep.” Supporting gut health may be one of the most underappreciated ways to improve rest.

Read More: How (and why) to Improve Your Gut Health

Rest Starts From Within

Supporting your gut isn’t just about digestion. It’s about helping your whole system move toward balance—physically, mentally, and emotionally. And when your body is in balance, sleep follows. Small, everyday changes like what you eat, how you wind down, and how you listen to your body can make all the difference. 

So the next time you find yourself wide awake at midnight, consider looking inward—at your plate, your habits, and your gut. The secret to better sleep might just be a meal away. 

woman lying down covered in avocado organic cotton gauze bedding - ayurveda and sleep

Photo courtesy of Avocado.

Read More: How (and why) to Improve Your Gut Health

Have feedback on our story? Email [email protected] to let us know what you think! 

Shop Pillows

The Essential Organic Pillow Collection

Gentle, breathable, non-toxic support.

Buy Now