What Foods Prevent Diarrhea and Strengthen Your Gut

Several types of foods can help prevent diarrhea or reduce its severity, primarily by firming up stool, feeding beneficial gut bacteria, and keeping your digestive system resilient. The most effective options fall into a few categories: foods rich in soluble fiber, fermented foods containing probiotics, prebiotic-rich vegetables, and foods high in resistant starch like green bananas.

How Soluble Fiber Firms Up Stool

Soluble fiber is the single most useful nutrient for preventing loose stools. When it reaches your large intestine, it forms a gel that absorbs excess water, which is exactly what’s missing when stool is too liquid. Unlike many other fibers, certain gel-forming types resist being broken down by gut bacteria, so they hold onto that water all the way through your digestive tract. The result is bulkier, firmer stool.

The best food sources of soluble fiber include oats and oat bran, pearled barley, lentils, split peas, navy beans, kidney beans, and quinoa. Fruits like pears, raspberries, blackberries, and plums are also rich in it. Nuts such as almonds, pistachios, and pecans contribute smaller but meaningful amounts. If you’re prone to recurring loose stools, building meals around these foods consistently (not just during an episode) gives your gut a reliable supply of that gel-forming fiber.

Psyllium husk, sold as a supplement, is one of the most studied gel-forming fibers and works both directions: it softens hard stool in constipation and firms up loose stool in diarrhea. Adding a tablespoon to water or a smoothie daily is a simple way to keep things steady if you’re between episodes.

Probiotics With the Strongest Evidence

Not all probiotics are equally useful for preventing diarrhea. Two strains stand out with the most clinical support: Lactobacillus rhamnosus GG (often labeled LGG) and Saccharomyces boulardii. Both have been shown to reduce the duration of diarrheal illness by about a day, and they’re the most effective strains for preventing diarrhea caused by antibiotics.

You can find LGG in certain yogurts and fermented milk drinks (check the label for the specific strain name). Saccharomyces boulardii is a beneficial yeast available mainly as a supplement rather than in food. If you’re about to start a course of antibiotics and want to reduce your risk of the diarrhea that commonly follows, starting one of these before or alongside your medication is a reasonable step.

As for yogurt on its own, the evidence is mixed. One study in hospital patients found a 50% reduction in antibiotic-related diarrhea from eating yogurt daily, but a later trial in a general practice setting found no significant benefit from consuming 150 ml of live-culture yogurt over 12 days. The strain and dose in the yogurt likely matter more than just eating “any yogurt,” which is why products specifically containing LGG tend to perform better in studies.

Prebiotic Foods That Strengthen Your Gut

Prebiotics are types of fiber that you can’t digest but your gut bacteria thrive on. When those bacteria are well-fed, they produce compounds that strengthen the intestinal lining and help your gut resist infection and inflammation, both of which can trigger diarrhea.

Some of the best prebiotic foods include garlic, onions, bananas, asparagus, soybeans, Jerusalem artichokes, and whole-grain products like whole wheat bread and cereals. These don’t act as a quick fix during an active bout of diarrhea, but eating them regularly builds a more resilient gut microbiome over time. Think of them as long-term prevention rather than a treatment.

Green Bananas and Resistant Starch

Green (unripe) bananas contain high levels of resistant starch, a type of carbohydrate that behaves more like fiber than a typical starch. It passes through your small intestine undigested, then gets fermented by gut bacteria in the colon, producing short-chain fatty acids that help the intestinal wall absorb water and electrolytes more efficiently. This directly counteracts the fluid loss that defines diarrhea.

Clinical trials have tested green banana in the management of persistent diarrhea, typically using around 200 grams of cooked green banana mixed into meals. You don’t need to measure that precisely at home. Cooking green bananas into soups, mashing them as a side, or slicing them into rice dishes are all practical ways to get the benefit. As bananas ripen and turn yellow, most of the resistant starch converts to regular sugar, so the effect diminishes significantly. For this purpose, the greener the better.

Beyond the BRAT Diet

The classic BRAT diet (bananas, rice, applesauce, toast) has been the go-to advice for decades, and it’s fine for a day or two when your stomach is at its worst. But there’s no need to restrict yourself to just those four foods. Harvard Health notes that brothy soups, oatmeal, boiled potatoes, crackers, and unsweetened dry cereals are equally easy to digest and give you more to work with nutritionally.

Once your stomach settles, adding protein and a wider range of nutrients actually supports faster recovery. Cooked squash (butternut or pumpkin), cooked carrots, sweet potatoes without the skin, avocado, skinless chicken or turkey, fish, and eggs are all bland enough to be gentle on your gut while providing the protein and micronutrients your body needs to bounce back. Staying on a purely restrictive diet for more than a couple of days can leave you short on calories and slow down healing.

Zinc-Rich Foods for Recurring Episodes

Zinc plays a direct role in gut defense. The WHO recommends zinc supplementation during diarrheal episodes in children because it reduces both the severity and the likelihood of future episodes. For adults, getting enough zinc through food is a practical preventive strategy, especially if you deal with recurrent bouts.

Good dietary sources of zinc include oysters (by far the richest source), beef, crab, pumpkin seeds, chickpeas, cashews, and fortified cereals. If your diet is mostly plant-based, you may absorb less zinc because compounds in grains and legumes can block its uptake. Soaking or sprouting beans and grains before cooking reduces this effect.

Staying Hydrated When Prevention Fails

Even with a gut-protective diet, diarrhea happens. When it does, replacing lost fluids and electrolytes matters more than any food choice. The WHO recommends a simple oral rehydration solution you can make at home: 8 level teaspoons of sugar and 1 level teaspoon of salt dissolved in 1 liter of clean water. This ratio optimizes water absorption in the intestine far better than plain water, sports drinks, or juice.

Sipping this steadily throughout the day prevents the dehydration that turns a manageable episode into something more serious, particularly in young children and older adults.

Preventing Diarrhea While Traveling

Traveler’s diarrhea is one of the most common and preventable forms, and it comes down to what you eat and drink more than anything else. The CDC’s core guidance is straightforward: eat raw fruits and vegetables only if you’ve washed them in clean water or peeled them yourself. Avoid food that’s been sitting on a buffet. Drink only beverages from factory-sealed containers, and skip the ice since it may have been made from unclean water.

Hand hygiene matters just as much. Washing with soap and water before eating and after using the bathroom, or using an alcohol-based hand sanitizer when that’s not possible, significantly cuts your risk. These simple habits prevent more cases of traveler’s diarrhea than any food or supplement can.