What Foods Cause Flatulence? Beans, Dairy, and More

Most flatulence comes from a short list of food categories: beans, cruciferous vegetables, dairy, high-fiber grains, certain fruits, and sugar-free products. Healthy adults pass gas up to 25 times a day, so some level of flatulence is completely normal. But specific foods can push that number higher or make the gas noticeably more odorous, depending on what your gut bacteria are fermenting.

Beans and Legumes

Beans are the most well-known gas producers, and the reason is a complex sugar called raffinose. Your small intestine lacks the enzyme needed to break raffinose down, so it passes intact into the large intestine. There, bacteria ferment it and produce hydrogen, carbon dioxide, and methane. Lentils, chickpeas, black beans, and kidney beans all contain significant amounts of raffinose.

The good news is that preparation matters. Soaking dried beans before cooking and discarding the soaking water reduces raffinose content by about 25%, with some related sugars dropping even more dramatically. This simple step won’t eliminate gas entirely, but it makes a real difference. Canned beans that have been sitting in liquid work similarly if you rinse them well before eating.

Over-the-counter enzyme supplements containing alpha-galactosidase (the enzyme your body doesn’t make enough of) can also help. In a randomized, double-blind trial, this enzyme significantly reduced bloating and flatulence compared to placebo, with no reported side effects. You take it with your first bite of beans or other high-raffinose foods.

Cruciferous Vegetables

Broccoli, Brussels sprouts, cabbage, cauliflower, and asparagus all contain raffinose, just like beans. They also contain organosulfur compounds called glucosinolates, which are the reason gas from these vegetables tends to smell worse than gas from other sources. When gut bacteria break down these sulfur compounds, the byproducts include hydrogen sulfide, the chemical responsible for that rotten-egg odor.

Cooking these vegetables softens some of the complex carbohydrates and can reduce gas production compared to eating them raw. That said, cruciferous vegetables are among the most nutrient-dense foods available, so avoiding them entirely is rarely worth it. Starting with smaller portions and increasing gradually gives your gut bacteria time to adapt.

Dairy Products

If you’re among the estimated 68% of people worldwide with reduced ability to digest lactose (the sugar in milk), dairy is a major gas trigger. Without enough of the digestive enzyme that breaks lactose down in the small intestine, the sugar moves into your colon, where bacteria ferment it into hydrogen, methane, carbon dioxide, and hydrogen sulfide.

The highest-lactose foods include milk (cow, goat, and sheep), ice cream, soft cheeses like cottage cheese and ricotta, cream cheese, buttermilk, whipping cream, sour cream, evaporated and condensed milk, pudding, custard, and whey protein concentrate. Hard aged cheeses like cheddar and Parmesan contain very little lactose and rarely cause problems. Yogurt, because its bacterial cultures partially digest lactose during fermentation, is also better tolerated by many people.

Whole Grains and High-Fiber Foods

Fiber is essential for digestive health, but it’s also a reliable source of gas. Dietary fiber is partially or fully fermented in the colon, producing carbon dioxide, hydrogen, and methane. Not all fiber is equally gassy, though. Soluble, fermentable fibers found in beans, fruits, and seeds generate the most gas. Oligosaccharides, a type of soluble fiber abundant in legumes, are especially potent. Other moderate gas producers include resistant starch, pectin, guar gum, and inulin (a fiber commonly added to “high-fiber” packaged foods).

Insoluble fiber from whole grains like wheat bran is less fermentable and produces less gas. So if you’re trying to increase your fiber intake without a significant uptick in flatulence, grain-based fibers are generally a gentler starting point than jumping straight to large servings of beans or fruit. Regardless of the source, increasing fiber gradually over a week or two rather than all at once gives your gut microbiome time to adjust.

Certain Fruits

Apples, pears, cherries, and peaches are high in fructose and sorbitol, two sugars that many people absorb poorly. When these sugars reach the large intestine undigested, bacteria ferment them just like they ferment raffinose or lactose. These fruits fall into the category of high-FODMAP foods, a group of short-chain carbohydrates that the small intestine absorbs inefficiently. People with irritable bowel syndrome are especially sensitive to high-FODMAP fruits, but even people without IBS can notice increased gas after eating large amounts.

Dried fruit is a particular culprit. The drying process concentrates sugars like sorbitol, so a handful of prunes or dried apricots delivers a much larger dose of fermentable sugar than the same weight of fresh fruit.

Sugar-Free and Diet Products

Sugar alcohols (polyols) are widely used as sweeteners in sugar-free gum, candies, protein bars, cough drops, and diabetic foods. The most common ones are sorbitol, mannitol, xylitol, maltitol, lactitol, and isomalt. Like other poorly absorbed sugars, they travel to the colon and get fermented by bacteria, producing gas and sometimes diarrhea.

Not all sugar alcohols are equally problematic. Sorbitol and mannitol cause the most severe gastrointestinal symptoms. Maltitol and isomalt, common in sugar-free chocolate and baked goods, also cause significant flatulence at higher doses. Xylitol, popular in chewing gum and mints, is better tolerated than the others. Erythritol, increasingly common in stevia-based sweeteners and keto products, is the gentlest of the group because most of it gets absorbed before reaching the colon.

If you chew several pieces of sugar-free gum a day or regularly snack on sugar-free candy, the cumulative dose of polyols can easily reach levels that trigger noticeable bloating and gas.

Carbonated Drinks and Swallowed Air

Not all flatulence comes from bacterial fermentation. Carbonated beverages introduce carbon dioxide directly into your digestive tract. Some of it gets released as a burp, but the rest travels through to the intestines. Similarly, eating quickly, chewing gum, drinking through a straw, and smoking all cause you to swallow extra air, which has to exit one way or another.

Why Some Foods Smell Worse Than Others

Volume and odor are two separate issues. High-fiber foods and beans tend to increase the volume of gas without making it particularly smelly. The odor comes primarily from sulfur-containing compounds. Foods rich in sulfur, including cruciferous vegetables, garlic, onions, eggs, and red meat, are the main drivers of foul-smelling gas. When gut bacteria break down sulfur-containing amino acids or glucosinolates, they produce hydrogen sulfide and related compounds in small but potent amounts.

If your main concern is the smell rather than the frequency, cutting back on sulfur-rich foods will have a bigger impact than reducing beans or fiber.