What Causes Bloating and Diarrhea — and When to Worry

Bloating and diarrhea occurring together usually points to something irritating your gut or interfering with how it digests and absorbs food. The cause can be as simple as a stomach bug that clears up in days or as persistent as a food intolerance you haven’t identified yet. Roughly 1 in 10 adults deals with these symptoms on a recurring basis, so you’re far from alone in trying to figure out what’s going on.

Stomach Bugs and Food Poisoning

The most common short-term cause is viral gastroenteritis, often called the stomach flu. Norovirus is the leading culprit. Symptoms typically begin 12 to 48 hours after exposure and last one to three days: watery diarrhea, bloating, nausea, and sometimes vomiting. Bacterial infections from contaminated food (Salmonella, E. coli, Campylobacter) cause similar symptoms but can last longer and sometimes produce bloody stool or fever.

If your symptoms started suddenly and other people around you are sick too, an infection is the most likely explanation. Most cases resolve on their own with fluids and rest. Symptoms lasting more than a week, or diarrhea with blood or high fever, warrant medical evaluation.

Food Intolerances

When bloating and diarrhea keep coming back, a food intolerance is one of the first things worth investigating. Lactose intolerance is extremely common. About 68% of the world’s population has some degree of lactase deficiency, and the figure reaches 95% in parts of Asia. When your body can’t fully break down lactose (the sugar in milk and dairy), bacteria in your colon ferment it instead, producing gas that causes bloating and drawing water into the intestine, which triggers diarrhea.

Sugar alcohols are another overlooked trigger. Sorbitol, xylitol, maltitol, and similar sweeteners are found in sugar-free gum, protein bars, diet drinks, and many “low sugar” packaged foods. They have a well-documented laxative effect. Sorbitol can cause gas, bloating, and cramps at doses as low as 5 grams per day, and doses above 20 grams typically cause outright diarrhea. A few sticks of sugar-free gum plus a protein bar can easily push you past that threshold without you realizing it.

Fructose malabsorption and gluten sensitivity (distinct from celiac disease) can produce the same pattern. An elimination diet, where you remove one suspect food group at a time for two to three weeks, is often the most practical way to identify the trigger.

Irritable Bowel Syndrome (IBS)

IBS is one of the most frequently diagnosed conditions behind chronic bloating and diarrhea. A large meta-analysis covering nearly 189,000 participants across 43 studies estimated global prevalence at roughly 11 to 13% of the population. The diarrhea-predominant form (IBS-D) specifically causes frequent loose stools alongside bloating, cramping, and urgency.

IBS is a disorder of gut-brain interaction, not structural damage. Your intestines look normal on scans and biopsies, but the signals between your gut and brain are disordered, leading to heightened sensitivity and abnormal motility. Stress, certain foods (particularly high-FODMAP foods like onions, garlic, wheat, and some fruits), and hormonal shifts can all trigger flares. The condition is chronic but manageable. Most people find significant relief through dietary changes, stress management, and sometimes targeted medications.

Small Intestinal Bacterial Overgrowth (SIBO)

SIBO occurs when bacteria that normally live in the large intestine colonize the small intestine in excessive numbers. These misplaced bacteria ferment food earlier than they should, producing hydrogen and other gases that cause bloating and distension. The byproducts of that fermentation are also osmotically active, meaning they pull water into the intestine. On top of that, the bacteria can damage the intestinal lining, interfere with fat absorption by breaking down bile salts, and cause secondary lactose intolerance by depleting lactase enzymes. The result is a combination of bloating, gas, diarrhea, and sometimes fatty stools.

SIBO is diagnosed with a breath test that measures hydrogen and methane levels after you drink a sugar solution. It often develops in people with slow gut motility, prior abdominal surgery, or conditions like diabetes that affect intestinal movement.

Celiac Disease

Celiac disease is an autoimmune condition where gluten (a protein in wheat, barley, and rye) triggers your immune system to attack the lining of the small intestine. In adults, the most common symptoms are intermittent diarrhea, bloating, flatulence, and diffuse abdominal pain. Many adults with celiac disease don’t present with the dramatic weight loss and malnutrition seen in children. Instead, they experience vague, recurring digestive discomfort that’s easily mistaken for IBS.

Celiac disease is confirmed through blood tests for specific antibodies followed by an intestinal biopsy. It’s important not to start a gluten-free diet before testing, because removing gluten can cause false-negative results. Once diagnosed, a strict gluten-free diet resolves symptoms in most people within weeks to months.

Inflammatory Bowel Disease

Crohn’s disease and ulcerative colitis are the two main forms of inflammatory bowel disease (IBD). Both can cause diarrhea and abdominal distension, but they differ in important ways. Ulcerative colitis almost always involves bloody, mucus-containing diarrhea and is limited to the colon. Crohn’s disease can affect any part of the digestive tract and typically presents with abdominal pain, diarrhea, poor appetite, and weight loss.

IBD involves visible inflammation and damage to the intestinal wall, which sets it apart from functional conditions like IBS. It’s diagnosed through colonoscopy and imaging. If your diarrhea is persistent, contains blood, or comes with unexplained weight loss, these conditions need to be ruled out.

Pancreatic Insufficiency

Your pancreas produces enzymes that break down fats, proteins, and carbohydrates. When it doesn’t produce enough of these enzymes, a condition called exocrine pancreatic insufficiency (EPI), food passes through your intestines in an undigested state. Fats are especially poorly absorbed, leading to bloating, gas, and pale, oily, foul-smelling stools that float. Diarrhea is common, and over time, the inability to absorb nutrients can cause weight loss and vitamin deficiencies.

EPI most often develops in people with chronic pancreatitis, cystic fibrosis, or after pancreatic surgery. It’s treatable with enzyme replacement taken with meals.

Medications That Cause Gut Problems

Several widely prescribed medications list bloating and diarrhea as side effects. Metformin, one of the most common diabetes medications, causes diarrhea through changes in gut bacteria, increased bile acid turnover, and altered glucose handling in the intestine. These effects sometimes appear not at the start of treatment but after months or even years of use.

Antibiotics are another frequent cause. They can disrupt the balance of gut bacteria, leading to diarrhea during or shortly after a course of treatment. In some cases, this creates an opening for Clostridioides difficile (C. diff), a bacterium that causes severe, watery diarrhea and bloating. Magnesium supplements, particularly magnesium oxide and magnesium citrate, draw water into the intestine and can cause loose stools at higher doses.

Warning Signs That Need Attention

Most causes of bloating and diarrhea are manageable and not dangerous. But certain symptoms alongside them suggest something more serious is happening. Watch for unintentional weight loss, diarrhea that wakes you up at night, rectal bleeding, iron deficiency anemia, unexplained vomiting, or pain that doesn’t improve after passing gas or having a bowel movement. Nighttime diarrhea in particular is a red flag because functional conditions like IBS almost never disrupt sleep. These symptoms warrant testing to rule out inflammatory bowel disease, celiac disease, or, less commonly, colorectal cancer.