What Causes Gas? Swallowed Air, Foods, and More

Gas is produced by two basic mechanisms: swallowing air and bacterial fermentation of food in your large intestine. Most people pass gas up to 25 times a day, producing a total volume between roughly 500 and 1,500 milliliters. That wide range is normal, and it shifts depending on what you eat, how you eat, and how your gut bacteria respond to what arrives in your colon.

Swallowed Air

Every time you eat, drink, or swallow saliva, a small amount of air travels into your stomach. This is called aerophagia, and certain habits increase it: eating or drinking quickly, chewing gum, smoking, and wearing loose-fitting dentures. Most of that swallowed air leaves your body as a belch. Whatever doesn’t get belched is partially absorbed in the small intestine, and a small portion continues into the large intestine and exits as flatulence.

Swallowed air is mostly nitrogen and oxygen, which are odorless. So if your main symptom is frequent, odorless gas, air swallowing is a likely contributor. Slowing down at meals and cutting back on gum or carbonated drinks can make a noticeable difference.

Fermentation in the Large Intestine

The bigger source of gas for most people is bacterial fermentation. Your large intestine is home to trillions of bacteria, and they survive by feeding on carbohydrates that your small intestine couldn’t fully digest. As these bacteria break down those leftover carbohydrates, they produce hydrogen, carbon dioxide, and methane. Together, these three gases make up more than 99% of intestinal gas. The remaining fraction, less than 1%, consists of sulfur-containing compounds, which are responsible for the smell.

The process works like this: undigested food residues arrive in your colon, gut bacteria ferment them rapidly, and gas is released as a byproduct. Some of the hydrogen produced gets absorbed into your bloodstream and expelled through your breath rather than as flatulence. The total volume of gas you actually pass depends on how much fermentable material reaches your colon and how active your particular mix of gut bacteria is.

Foods That Produce the Most Gas

The foods most likely to cause gas are rich in carbohydrates that resist digestion in the small intestine. These include pulses (beans, lentils, chickpeas), certain vegetables (onions, garlic, broccoli, cabbage), fruits (apples, pears, watermelon), whole grains, and for some people, dairy products. What these foods have in common is that they contain short-chain carbohydrates collectively known as FODMAPs.

FODMAPs include several categories of sugars: fructans and galacto-oligosaccharides (found in wheat, onions, and legumes), lactose (in milk and soft cheeses), excess fructose (in honey, apples, and high-fructose corn syrup), and polyols like sorbitol and mannitol (in stone fruits and sugar-free products). When these sugars reach your small intestine, they move through slowly and draw extra water into the gut. Once they pass into the large intestine, bacteria ferment them quickly, producing gas. The combination of extra water and extra gas stretches the intestinal wall, which is what causes that bloated, uncomfortable feeling.

Not everyone reacts to the same FODMAPs equally. Your individual gut bacteria, enzyme levels, and intestinal sensitivity all play a role. Someone might handle beans without issue but bloat after eating an apple, while another person experiences the reverse.

Fiber: Soluble vs. Insoluble

Fiber is healthy, but it’s also a major gas producer, and the type of fiber matters. Soluble fiber, found in oats, beans, lentils, and many fruits, dissolves in water and is highly fermentable. The more soluble fiber that reaches your colon, the more gas your bacteria produce. In fermentation studies, increasing the proportion of soluble fiber consistently increased total gas output.

Insoluble fiber, found in whole wheat, nuts, and vegetable skins, is less fermentable. It adds bulk to stool and speeds transit through the gut but generates comparatively less gas. If you’re increasing your fiber intake and experiencing more flatulence, it’s likely the soluble fiber doing most of the work. Gas production from soluble fiber typically ramps up within 4 to 16 hours after eating and can continue for a full day or more. Your gut bacteria do adapt over time, so gradually increasing fiber intake over a few weeks tends to reduce symptoms compared to a sudden jump.

Sugar Alcohols and Artificial Sweeteners

Sugar alcohols are low-calorie sweeteners used in sugar-free gum, candy, protein bars, and some beverages. Common ones include sorbitol, xylitol, mannitol, and erythritol. Most of them are poorly absorbed in the small intestine, which means they travel to the colon where bacteria ferment them, producing gas. They also pull water into the gut through osmosis, which can add bloating and loose stools on top of the flatulence.

Tolerance varies widely by the specific sugar alcohol. Sorbitol and mannitol can trigger symptoms in adults at doses as low as 10 to 20 grams per day. Xylitol is better tolerated, with most healthy adults handling a single dose of 10 to 30 grams without diarrhea, though flatulence often shows up before diarrhea does. Erythritol stands apart: it’s mostly absorbed in the small intestine before reaching the colon, so it rarely causes gastrointestinal symptoms at normal doses. If sugar-free products consistently give you trouble, checking the label for the specific sweetener can help you identify which one your gut doesn’t tolerate.

Enzyme Deficiencies

Your small intestine produces enzymes that break down specific sugars so they can be absorbed before reaching the colon. When you lack enough of a particular enzyme, the corresponding sugar passes through undigested and becomes fuel for gas-producing bacteria.

Lactose intolerance is the most common example. People who produce insufficient lactase can’t break down the lactose in milk and dairy, so it ferments in the colon. This affects an estimated two-thirds of the global adult population to some degree, though severity varies. A similar situation happens with the sugars in beans and cruciferous vegetables: humans don’t produce the enzyme (alpha-galactosidase) needed to break down raffinose and stachyose, the oligosaccharides abundant in legumes. That’s why beans are such a reliable gas producer for nearly everyone.

Digestive Conditions That Increase Gas

While gas is normal, certain conditions can amplify it. In irritable bowel syndrome (IBS), the gut is hypersensitive to normal amounts of stretching. People with IBS often produce similar total volumes of gas as healthy individuals, but they experience more pain, bloating, and discomfort from it. Their intestinal wall reacts more intensely to the same degree of distension, making ordinary gas feel much worse.

Small intestinal bacterial overgrowth (SIBO) is a different problem. Normally, your small intestine has relatively few bacteria compared to your colon. In SIBO, excess bacteria colonize the small intestine and begin fermenting food there, before it even reaches the large intestine. This produces hydrogen, methane, and carbon dioxide higher up in the digestive tract, leading to distension, flatulence, bloating, and abdominal pain. SIBO and IBS can overlap, and some researchers believe bacterial overgrowth may contribute to bloating in a subset of IBS patients.

Other conditions that increase gas include celiac disease (where gluten damages the small intestine and impairs nutrient absorption), chronic pancreatitis (where reduced enzyme production leaves more food undigested), and gastroparesis (where slow stomach emptying changes how food moves through the system). In each case, the core mechanism is the same: more undigested material reaches the colon, and bacteria produce more gas from it.

Everyday Habits That Add Up

Beyond food choices, several daily habits influence gas production. Eating large meals delivers more fermentable material to the colon at once. Drinking through straws or sipping carbonated beverages adds extra air to your stomach. Sedentary behavior slows intestinal transit, giving bacteria more time to ferment residues. Even stress and anxiety can increase air swallowing and alter gut motility.

Antibiotics can temporarily change your gut bacteria composition, sometimes increasing gas production until your microbiome recovers. Certain medications, particularly some used for diabetes and cholesterol management, list gas and bloating as common side effects because they alter how carbohydrates or fats are absorbed. If you notice a change in gas after starting a new medication, that connection is worth exploring with your prescriber.