Bad gas, whether that means too much of it or gas that smells terrible, comes down to what you eat, how you eat, and what your gut bacteria do with the food you give them. A healthy adult passes gas about 10 times a day on average, with an upper limit of normal around 20 times. The total volume ranges from roughly 500 to 1,500 milliliters over 24 hours. When you’re exceeding that range or clearing rooms with the smell, something specific is usually driving it.
How Gas Forms in Your Body
Gas in your digestive tract comes from two main sources: air you swallow and gases your gut bacteria produce. Swallowed air accounts for a portion of upper digestive gas and leads mostly to belching. Eating too fast, talking while eating, chewing gum, sucking on hard candy, using straws, drinking carbonated beverages, and smoking all increase the amount of air you take in.
The rest, and the part responsible for most flatulence, happens in your large intestine. When your small intestine can’t fully break down or absorb certain carbohydrates, they travel intact to the colon. There, trillions of bacteria ferment them, producing hydrogen, carbon dioxide, and sometimes methane as byproducts. In a typical day, hydrogen makes up the largest share of flatus volume (median around 361 ml), followed by nitrogen and carbon dioxide. Only about one in three people produces significant methane, depending on which bacterial populations dominate their gut.
Foods That Produce the Most Gas
The biggest gas producers are foods containing fermentable carbohydrates, sometimes grouped under the term FODMAPs. These are short-chain sugars and fibers that your small intestine simply can’t break down. Instead, your gut draws in extra water to push them along to the colon, where bacteria feast on them and release gas as a byproduct. The classic offenders include beans, lentils, onions, garlic, wheat, certain fruits, and artificial sweeteners like sorbitol and mannitol.
Fiber type matters too. Short-chain, highly fermentable soluble fibers (like those in onions, chicory root, and certain supplements) produce gas rapidly, sometimes faster than your body can absorb it into the bloodstream for elimination through the lungs. This overwhelms the system and leads to bloating, discomfort, and flatulence. Longer-chain, moderately fermentable fibers like psyllium produce far less gas. Insoluble fiber, found in whole grains and vegetable skins, mostly speeds things along mechanically rather than feeding bacteria, so it contributes less to gas production overall.
Why Some Gas Smells Worse
Here’s the thing most people don’t realize: the gases responsible for volume (hydrogen, carbon dioxide, methane, nitrogen) are all odorless. The smell comes entirely from trace sulfur compounds, particularly hydrogen sulfide, which has that unmistakable rotten-egg quality. Your colon also produces methanethiol and dimethyl sulfide, both potent even in tiny amounts.
Sulfur-rich foods are the primary dietary trigger for foul-smelling gas. The Allium family (garlic, onions, leeks, chives) contains concentrated sulfur compounds like allicin that get released when you crush or chew them. Cruciferous vegetables like broccoli, cabbage, and cauliflower are also high in sulfur. Eggs, red meat, and dairy contribute as well. Even some surprising foods carry sulfur compounds: aged cheeses like Camembert and Cheddar, coffee, nuts, and fruits including watermelon, strawberries, and durian.
Your gut bacteria determine how much sulfur ends up as hydrogen sulfide. Two major bacterial groups compete for hydrogen in your colon: methane-producing organisms and sulfate-reducing bacteria. In most people, one group dominates. If sulfate-reducing bacteria win out, they convert more hydrogen into hydrogen sulfide, making your gas smell worse. If methanogens dominate, you’ll produce more methane (odorless) and less sulfide. This bacterial competition helps explain why two people eating the same meal can have very different experiences.
Lactose and Other Enzyme Deficiencies
If dairy reliably gives you gas, you likely lack sufficient lactase, the enzyme that breaks lactose into simple sugars your small intestine can absorb. Without it, lactose passes undigested into the colon, where bacteria ferment it into hydrogen, carbon dioxide, methane, and short-chain fatty acids. This is lactose malabsorption, and it affects a large percentage of adults worldwide, particularly those of East Asian, African, and Hispanic descent.
The result isn’t just more gas but often gas paired with bloating, cramping, and diarrhea. The severity depends on how much lactase you still produce, how much dairy you consumed, and what else you ate with it. Similar patterns occur with fructose malabsorption, where the gut can’t efficiently absorb fruit sugar, leading to the same fermentation cycle in the colon.
When a Medical Condition Is Behind It
Persistent, excessive gas that doesn’t respond to dietary changes can signal an underlying condition. Small intestinal bacterial overgrowth, or SIBO, occurs when abnormally large or abnormal populations of bacteria colonize the small intestine, where they don’t normally thrive in large numbers. These bacteria start fermenting food earlier in the digestive process than they should, producing gas, bloating, diarrhea, and abdominal discomfort. SIBO can develop after abdominal surgery, with conditions that slow intestinal movement, or alongside other digestive disorders.
Irritable bowel syndrome (IBS), celiac disease, and inflammatory bowel disease can all increase gas production or make you more sensitive to normal amounts of gas. Celiac disease damages the lining of the small intestine, reducing its ability to absorb nutrients and leaving more material for colonic bacteria to ferment. Even conditions outside the gut, like diabetes (which can slow stomach emptying), may contribute indirectly.
Habits That Make Gas Worse
Beyond food choices, several everyday habits amplify gas problems. Eating quickly means swallowing more air with each bite and giving your digestive enzymes less time to work. Carbonated drinks introduce carbon dioxide directly into your stomach. Chewing gum keeps you swallowing air continuously throughout the day.
Sudden increases in fiber intake are one of the most common triggers for a temporary spike in gas. If you switch from a low-fiber diet to one heavy in beans, whole grains, and vegetables, your gut bacteria population shifts to handle the new fuel source, and the adjustment period produces significantly more gas. Increasing fiber gradually over two to three weeks gives your microbiome time to adapt.
Stress and anxiety can also play a role. They alter gut motility and may increase air swallowing without you noticing. Some medications, particularly certain diabetes drugs, antibiotics, and laxatives containing sugar alcohols, produce gas as a side effect.
Signs That Something More Serious Is Going On
Gas alone, even when it’s excessive or foul-smelling, is rarely a sign of something dangerous. But gas paired with other symptoms warrants attention. Unintentional weight loss, blood in the stool, persistent diarrhea or constipation, vomiting, or heartburn accompanying your gas can point to conditions that need evaluation. Severe gas that doesn’t improve after adjusting your diet for several weeks is also worth investigating, as it may indicate malabsorption, SIBO, or another treatable condition.