What Foods Are Gassy? Beans, Dairy, and More

Beans, dairy products, and certain vegetables are among the most reliably gas-producing foods, but the reasons differ for each. Beans deliver sugars your small intestine cannot break down, dairy causes trouble when you lack the enzyme to digest lactose, and high-fiber vegetables simply give your gut bacteria more to ferment. The common thread is fermentation by bacteria in the large intestine, which pump out hydrogen, carbon dioxide, and sometimes methane as metabolic byproducts. Understanding which foods trigger gas and why can help you manage the discomfort without unnecessarily cutting nutritious staples from your diet.

Why Food Makes You Gassy in the First Place

Your large intestine hosts trillions of bacteria. When certain carbohydrates arrive in the colon undigested, those bacteria break them down through fermentation, producing gases as a side effect.1Journal of Functional Foods. Intestinal gas production by the gut microbiota: A review The main gases are nitrogen, carbon dioxide, and hydrogen, with methane and hydrogen sulfide showing up in some people.2Nature. Gases produced by Human Intestinal Microflora Most of these gases are odorless. Hydrogen and methane are both produced entirely by bacteria inside the gut, not swallowed from the air. The volume and composition of gas varies dramatically from person to person, depending on diet, gut bacteria composition, and transit time through the intestines.

Any food that delivers fermentable material to the colon has the potential to cause gas. But some foods are far more potent than others because of the specific types of carbohydrates they contain, how much fiber they carry, or whether your body lacks a particular enzyme.

Beans and Legumes

Beans have earned their gassy reputation for a specific biochemical reason. They contain a family of sugars called raffinose oligosaccharides, including raffinose, stachyose, and verbascose. Humans do not produce alpha-galactosidase, the enzyme needed to break these sugars apart in the small intestine, so they pass through completely intact and arrive in the colon as a feast for bacteria.3Journal of the American Oil Chemists’ Society. Flatulence caused by soya and its control through processing The result is a reliable burst of gas, particularly hydrogen and carbon dioxide.

This applies to virtually all legumes: black beans, kidney beans, lentils, chickpeas, soybeans, and peas. The oligosaccharide content varies between types, but none are low enough to dodge the issue entirely. Soybeans and navy beans tend to sit at the higher end, while lentils are sometimes slightly easier on the gut, though individual reactions vary.

The silver lining is that preparation matters. Soaking beans before cooking and discarding the soaking water removes a meaningful share of those oligosaccharides. One study found that soaking common beans before cooking and tossing the soak water reduced raffinose by about 25% and stachyose by a similar amount, without harming nutritional value.4PubMed. Soaking the common bean in a domestic preparation reduced the contents of raffinose-type oligosaccharides but did not interfere with nutritive value Longer soaks, baking soda in the water, and pressure cooking all push removal further. Research on multiple legume types found that cooking unsoaked seeds already produced a large decrease in oligosaccharides compared to soaking alone, and pressure cooking (autoclaving) soaked seeds eliminated raffinose entirely.5Food Chemistry. Effect of domestic processing on oligosaccharide content of some dry legume seeds A more recent study found that soaking chickpeas, lentils, and beans in slightly acidic water at warm temperatures reduced these sugars by 50 to 85% within a few hours.6PubMed. Hydrolysis and diffusion of raffinose oligosaccharides family products in chickpeas, lentils, and beans under different pH and temperature steeping conditions So the traditional advice to soak your beans overnight genuinely works, and adding a splash of vinegar or lemon juice to the soak water can help even more.

Dairy Products and Lactose

Dairy is the other classic culprit, but only for people who don’t produce enough lactase, the enzyme that breaks down lactose (the main sugar in milk). When undigested lactose reaches the colon, bacteria ferment it just like bean sugars, producing gas along with short-chain fatty acids that draw water into the intestines.7SN Comprehensive Clinical Medicine. Lactose Intolerance—Old and New Knowledge on Pathophysiological Mechanisms, Diagnosis, and Treatment The combination causes bloating, cramps, flatulence, and sometimes diarrhea.

The majority of the world’s adult population has some degree of lactase decline after childhood. People of East Asian, West African, and Native American ancestry lose lactase activity at especially high rates, while those of Northern European descent are more likely to maintain it into adulthood. If you handle milk fine, dairy is not gassy for you; the food itself is not inherently gas-producing the way beans are.

Not all dairy products are equally problematic even for people who are lactose intolerant. Hard aged cheeses like cheddar, Parmesan, and Gruyère have very little lactose left, since bacteria consumed most of it during the aging process. Analysis has shown lactose levels below the detection limit in ripened cheeses.8International Dairy Journal. Detection of lactose in products with low lactose content Yogurt also tends to be better tolerated because the live cultures continue digesting lactose in the gut. Ice cream and soft fresh cheeses like ricotta can be more troublesome. Lactose-free milk, which is treated with added lactase enzyme, tested below 0.1% lactose in the same analysis, making it a reliable option if you want to avoid symptoms entirely.

Vegetables, Fruits, and Fiber

Cruciferous vegetables like broccoli, cauliflower, Brussels sprouts, and cabbage are gas producers in their own right. They contain both raffinose-type sugars (the same family found in beans, though in smaller amounts) and sulfur compounds. The sulfur part matters: these vegetables contribute not just to gas volume but also to gas odor, because sulfur compounds get converted into hydrogen sulfide during fermentation.

Onions and garlic, staples in cooking around the world, are rich in fructans, a type of carbohydrate that humans cannot fully digest. Like bean sugars and undigested lactose, fructans travel to the colon and feed bacteria. Artichokes, leeks, and asparagus also contain fructans at meaningful levels.

Fiber in general promotes gas production. Soluble fiber, found in oats, apples, beans, and many fruits, is particularly fermentable. Research on fiber fermentation has demonstrated that as the proportion of soluble fiber increases, total gas production rises.9PubMed Central. In Vitro Fermentation Characteristics for Different Ratios of Soluble to Insoluble Dietary Fiber by Fresh Fecal Microbiota from Growing Pigs Insoluble fiber, found in whole wheat and vegetable skins, adds bulk and speeds transit but ferments less. So a bowl of oatmeal with an apple has more gas potential than a slice of whole-wheat toast, even though both are “high fiber” foods.

Some fruits deserve their own mention. Apples, pears, and mangoes are high in fructose, which can trigger gas in people who absorb it incompletely. Prunes and dried fruits concentrate sugars and sorbitol, a sugar alcohol that the gut handles poorly in large amounts.

Fructose and Sugar Alcohols

Fructose malabsorption is more common than most people realize. When fructose overwhelms the small intestine’s absorption capacity, the excess spills into the colon, where bacteria ferment it and produce gas, bloating, and discomfort.10PubMed Central. Fructose Malabsorption, Gut Microbiota and Clinical Consequences: A Narrative Review of the Current Evidence The risk increases with age and with higher doses of fructose in a single sitting. Honey, agave syrup, high-fructose corn syrup, and large servings of fruit juice are common triggers. Eating fructose alongside glucose (as happens in table sugar, which is a 50/50 split) improves absorption, which is why a candy bar might cause less gas than an equivalent dose of fructose from honey.

Sugar alcohols, also called polyols, are another frequent source of gas that catches people off guard. Sorbitol, mannitol, xylitol, and erythritol appear in sugar-free gum, candy, protein bars, and many “diet” or “keto” packaged foods. These molecules are poorly absorbed in the small intestine, pull water into the gut through osmosis, and get fermented by bacteria in the colon. The severity of symptoms depends on the dose, the specific polyol, and individual tolerance. People who are unaccustomed to sugar alcohols tend to react more strongly.11PubMed Central. Gastrointestinal Disturbances Associated with the Consumption of Sugar Alcohols with Special Consideration of Xylitol: Scientific Review and Instructions for Dentists and Other Health-Care Professionals Erythritol is the gentlest of the group because most of it is absorbed before reaching the colon. Sorbitol and mannitol are the worst offenders, and the “sugar-free gummy bear” horror stories you may have seen online are real: a large dose of sorbitol or maltitol from candy can cause explosive gas and diarrhea.

Whole Grains and Starches

Whole grains like wheat, barley, and rye contain both fiber and fructans, making them moderate gas producers for some people. Refined grains cause less gas because the processing strips away much of the fiber and the bran where fructans concentrate. Rice is a notable exception among grains: it is almost completely digested and absorbed in the small intestine, producing very little colonic gas. If you are trying to identify what is giving you trouble, white rice is often used as a baseline “low-gas” starch.

Resistant starch, found in cooled potatoes, green bananas, and some whole grains, also reaches the colon undigested. It behaves similarly to soluble fiber once bacteria get to work on it. Reheated pasta or cold potato salad contains more resistant starch than the same food served fresh and hot, which is why leftovers sometimes seem gassier than the original meal.

What Makes Gas Smell

Most intestinal gas is actually odorless. Hydrogen, carbon dioxide, nitrogen, and methane have no smell. The stink comes from trace sulfur-containing gases, primarily hydrogen sulfide. A study that directly measured flatus composition found that hydrogen sulfide was the dominant malodorous compound, and its concentration correlated strongly with perceived odor intensity.12Gut. Identification of gases responsible for the odour of human flatus and evaluation of a device purported to reduce this odour Methanethiol and dimethyl sulfide contributed as well, but at lower concentrations.

This distinction matters practically. Foods that produce a lot of gas volume, like beans, don’t necessarily produce the smelliest gas. Foods rich in sulfur compounds, like eggs, cruciferous vegetables, garlic, and red meat, tend to produce lower volumes but with a much stronger odor. A big serving of broccoli might give you both: volume from the fermentable fiber and smell from the sulfur. A bowl of beans with rice could produce a lot of gas that barely smells at all. The two problems, volume and odor, have different dietary causes.

Why Some People Are Gassier Than Others

Two people can eat the same meal and have wildly different gas responses. A big part of this comes down to gut bacteria. Everyone’s microbiome is different, and the specific mix of bacterial species determines how efficiently your colon ferments different substrates and what gases are produced. Roughly 30 to 50% of adults harbor methane-producing archaea (methanogens) in their gut, and these organisms convert hydrogen into methane, which can affect both gas composition and gut transit time.13Journal of Neurogastroenterology and Motility. Methanogens, Methane and Gastrointestinal Motility Interestingly, methane production has been linked to slower intestinal transit and constipation, which could further worsen bloating and discomfort.

Enzyme levels matter too. Lactase persistence varies by genetic background. Some people produce more pancreatic amylase, which may influence how much starch reaches the colon. Gut transit speed plays a role: faster transit means less time for small-intestine enzymes to work, potentially sending more fermentable material downstream. Stress and hormonal fluctuations can also change motility and gut sensitivity, which is why some people notice more bloating during certain times of the month or during periods of anxiety.

Then there is the perception side. Some people produce average amounts of gas but feel it more intensely. Visceral hypersensitivity, where the gut’s nerves are more reactive to stretching and distension, is a recognized factor in irritable bowel syndrome and functional bloating. If you feel extremely bloated and uncomfortable but your gas volume is not objectively unusual, the issue may be how your gut processes the sensation rather than how much gas is present.

Does Your Gut Adapt to Gassy Foods?

There is a widespread belief that if you eat beans regularly, your gut eventually adjusts and the gas goes away. The truth is more nuanced. A feeding study that tracked people eating half a cup of beans daily for several weeks found that reports of increased flatulence dropped substantially over time. By the second week, only about 6% of participants eating pinto beans and 12% eating black-eyed peas still reported extra gas, and the numbers continued to decline through week eight.14PubMed Central. Perceptions of flatulence from bean consumption among adults in 3 feeding studies That sounds like clear adaptation.

But an earlier study that actually measured gas output, rather than asking people how they felt, found something different: the total volume of gas excreted did not decrease over 23 days of regular bean consumption. What did change was subjective tolerance. People reported feeling less bothered by the gas even though they were still producing the same amount.15The American Journal of Clinical Nutrition. Influence of frequent and long-term consumption of legume seeds on excretion of intestinal gases So “adaptation” may be partly real and partly perceptual. Your bacteria may shift somewhat, but your brain also recalibrates what counts as discomfort. Either way, people who stick with beans for a few weeks generally feel better about it, which is a practical win even if the mechanism is partly psychological.

Practical Ways to Reduce Gas

If beans are your problem, preparation is your first line of defense. Soak them overnight, drain the water, and cook them thoroughly. Canned beans are pre-cooked but still benefit from a rinse under running water to wash away some of the oligosaccharide-rich liquid. Pressure cooking is especially effective at breaking down these sugars. Starting with smaller portions and building up gradually also helps, both for potential microbiome shifts and for perceptual adaptation.

Over-the-counter alpha-galactosidase supplements (sold under brands like Beano) provide the missing enzyme that breaks down bean sugars before they reach the colon. A double-blind crossover trial found that alpha-galactosidase significantly reduced flatulence events compared to placebo over a six-hour period after a bean-heavy meal.16PubMed. Does Beano prevent gas? A double-blind crossover study of oral alpha-galactosidase to treat dietary oligosaccharide intolerance You take the enzyme with the first bite of food, not after. It doesn’t help with lactose, fructose, or fiber-related gas, only with oligosaccharides from beans and certain vegetables.

For dairy-related gas, lactase supplements work on the same principle: supplying the enzyme your body doesn’t make enough of. A placebo-controlled crossover study found that lactase supplementation cut hydrogen breath levels (a proxy for colonic fermentation) by about 55% and improved clinical symptoms in people with lactose intolerance.17PubMed Central. Effect of lactase on symptoms and hydrogen breath levels in lactose intolerance: A crossover placebo-controlled study Alternatively, switching to aged cheeses, yogurt, or lactose-free milk sidesteps the problem at the source.

For gas from fructose or sugar alcohols, the main strategy is dose control. Smaller servings of fruit, avoiding large amounts of honey or agave at once, and checking labels on sugar-free products for sorbitol and mannitol can all make a noticeable difference. Erythritol-sweetened products are worth trying as a substitute, since most of it gets absorbed before reaching the colon.

Simethicone, the active ingredient in Gas-X and similar products, works differently from the enzyme supplements. It breaks up gas bubbles in the gut, which can relieve the pressure feeling but does not reduce the total amount of gas produced. It is a comfort measure, not a preventive one. Activated charcoal products are sometimes marketed for gas but have mixed evidence and can interfere with medication absorption.

Carbonated Drinks and Swallowed Air

Not all gas comes from food fermentation. Carbonated beverages deliver carbon dioxide directly to the stomach, and while most of it is belched out, some makes its way further down the tract. Beer combines carbonation with fermentable carbohydrates, doubling the gas potential. Swallowed air, technically called aerophagia, is another source. Eating quickly, chewing gum, smoking, and drinking through straws all increase the amount of air you swallow. This air is mostly nitrogen and oxygen. Nitrogen is not absorbed by the gut, so it has to come out one end or the other. If rapid eating habits coincide with a high-fiber meal, the combination can be particularly uncomfortable.

Some people swallow air habitually without realizing it, especially under stress. If you have unexplained gas that doesn’t seem to correlate with particular foods, paying attention to eating speed and chewing habits before overhauling your diet is worth the effort.

When Gas Signals Something More

Occasional gas after a bean burrito or a milkshake is normal human physiology, not a medical problem. But persistent, worsening, or severe gas accompanied by other symptoms can sometimes point to conditions worth investigating. Celiac disease, small intestinal bacterial overgrowth (SIBO), inflammatory bowel disease, and pancreatic insufficiency can all cause excessive gas as one of their symptoms. A sudden change in gas patterns that doesn’t line up with dietary changes, or gas paired with unintended weight loss, blood in the stool, or persistent pain, warrants a conversation with a doctor rather than another round of dietary tinkering. For the vast majority of people, though, gas is a byproduct of a healthy, fiber-rich diet doing exactly what it should in the colon. The bacteria producing that gas are also generating short-chain fatty acids that feed the cells lining your intestine and support immune function. Eliminating all gas-producing foods is neither realistic nor desirable, and the goal is usually management and tolerance rather than total elimination.