Farting is the result of gas building up in your digestive tract and finding its way out. Most of that gas comes from two sources: air you swallow and gases produced by bacteria in your large intestine as they break down food your body couldn’t digest higher up. The average person passes gas anywhere from 13 to 21 times a day, and in a study of healthy volunteers eating their normal diet plus a serving of baked beans, 24-hour gas volume ranged from about 475 ml to nearly 1,500 ml.
How Gas Forms in Your Gut
Your small intestine absorbs most nutrients, but certain carbohydrates pass through undigested. When they arrive in the colon, trillions of bacteria ferment them, producing hydrogen, carbon dioxide, and sometimes methane as byproducts. This bacterial fermentation is a normal, constant process. It also generates short-chain fatty acids that feed the cells lining your colon, so it’s not purely a nuisance.
The volume and speed of gas production depend on what you ate, which bacteria dominate your gut, and how quickly food moves through your system. A meal rich in fermentable carbohydrates sends more raw material to those bacteria, which means more gas.
Why Beans Are the Classic Offender
Beans contain sugars called raffinose and stachyose that humans simply cannot digest. Your small intestine lacks the enzyme needed to break them apart. In soybeans, for example, stachyose alone makes up roughly 3 to 6 percent of the bean by weight. All of that passes intact to the colon, where bacteria feast on it and pump out gas. Other legumes, lentils, and chickpeas work the same way.
An over-the-counter enzyme product (sold under names like Beano) contains alpha-galactosidase, which breaks down these sugars before they reach the colon. A randomized, placebo-controlled trial confirmed it reduces gas production by handling those undigestible sugars in the upper gut, so bacteria never get the chance to ferment them.
Lactose, Fructose, and Sugar Alcohols
If you’re lactose intolerant, you don’t produce enough of the enzyme that splits milk sugar into absorbable pieces. Undigested lactose stays in the intestinal tract, draws water in through osmotic pressure, and gets fermented by bacteria into hydrogen, methane, carbon dioxide, and hydrogen sulfide. The combination of extra fluid and extra gas is why dairy can cause both bloating and loose stools at the same time.
Fructose intolerance works similarly. Some people absorb fructose poorly, and the excess reaches the colon for fermentation.
Sugar alcohols like sorbitol, xylitol, and erythritol (common in sugar-free gum, candy, and protein bars) are absorbed slowly and incompletely through passive diffusion. Whatever your small intestine doesn’t pick up moves to the colon and ferments. The effect is dose-dependent: a stick of sugar-free gum might do nothing, but a whole bag of sugar-free candy can cause impressive flatulence and cramping in even healthy people.
Swallowed Air Adds Up
Not all gas in your digestive tract is made there. You swallow small amounts of air every time you eat, drink, or talk. Certain habits increase that volume significantly:
- Eating too fast or talking while eating
- Drinking through straws
- Chewing gum or sucking on hard candy
- Drinking carbonated beverages
- Smoking
Most swallowed air is nitrogen and oxygen. Some of it comes back up as a burp, but whatever passes into the intestines exits as flatulence. Slowing down while you eat, taking sips from a glass instead of a straw, and skipping gum between meals can noticeably reduce this source of gas.
What Makes Gas Smell
The bulk of flatulence is odorless. Nitrogen, hydrogen, carbon dioxide, and methane have no smell. The odor comes from trace sulfur compounds, primarily hydrogen sulfide (the rotten-egg gas), along with smaller amounts of methanethiol and dimethyl sulfide. In lab measurements of human flatulence, hydrogen sulfide was the dominant sulfur gas, and its concentration correlated directly with how bad the smell was rated.
Your diet controls how much sulfur reaches those colonic bacteria. More than half the volatile compounds in garlic, onions, leeks, and chives contain sulfur. Cruciferous vegetables like broccoli, cabbage, and Brussels sprouts are also rich sources. Asparagus, spinach, and avocados contain glutathione, another sulfur compound. Eggs, meat, and aged cheeses (especially Camembert, Limburger, and Cheddar) contribute sulfur amino acids that gut bacteria can convert into hydrogen sulfide. Eating more of these foods doesn’t necessarily make you gassier in volume, but it makes the gas you do produce smell worse.
Other Foods That Increase Gas
Beyond beans and dairy, several everyday foods are heavy fermenters. Whole grains, especially wheat and oats, contain fibers that resist digestion. Fruits like apples, pears, and peaches are high in both fructose and sorbitol. Vegetables like artichokes, asparagus, and onions contain fructans, another carbohydrate your small intestine absorbs poorly.
Fiber supplements can also spike gas production, particularly when you increase your intake suddenly. Your gut bacteria adapt over time, so a gradual increase in fiber tends to cause less trouble than jumping straight to a high-fiber diet.
When Gas Signals Something Else
Occasional gas is completely normal. But a sudden change in your pattern, or gas paired with other symptoms, can point to an underlying condition. Small intestinal bacterial overgrowth (SIBO) occurs when excess bacteria colonize the small intestine, producing gas earlier in the digestive process and often causing diarrhea and weight loss. Celiac disease, in which gluten triggers immune damage to the intestinal lining, impairs absorption and increases fermentation. Irritable bowel syndrome can alter how gas moves through the intestines and make the gut more sensitive to normal volumes of gas, so even typical amounts feel painful.
Gas accompanied by persistent abdominal pain, unintended weight loss, chronic diarrhea or constipation, or a noticeable shift in symptoms deserves a conversation with your doctor. In rare cases, digestive blockages from conditions including colorectal cancer can change gas patterns, which is why new and persistent changes are worth investigating.