Everyone passes gas between 13 and 21 times a day, and it can happen even while sleeping.﻿﻿ Gas is part of the natural digestive process. If gas isn't bothersome for any reason, it's typically not something to worry about. However, many people find gas embarrassing, particularly if they pass an excessive amount of gas.

It is true that some foods may tend to make a person produce more gas than other foods.﻿﻿ In particular, foods that have a high fiber content are a frequent offender when it comes to causing symptoms of gas and bloating.

It is also true that most people do not get enough fiber in their diet and should be eating more fibrous foods. One food that has an especially notorious reputation when it comes to gas is beans. Beans are well-known for their ability to cause flatulence, but the cause as to why may surprise you.

Understanding Gas

Intestinal gas is primarily composed of hydrogen, nitrogen, and carbon dioxide, all gasses that are, odorless. In about one-third of people, however, intestinal gas also contains another ingredient: methane.

It's unclear why some people's bodies produce methane and others do not. One way to tell if there is methane in gas is to look at stool: people who produce methane typically will have stools that float in water.

Sulfur is the substance that gives gas to have its distinctive odor. Therefore, it follows that eating foods high in sulfur, such as garlic, onions, broccoli, cauliflower, and cabbage, can cause your gas to be "smellier."

Why Beans Cause Gas

Beans (legumes) cause gas because they contain a particular sugar, called an oligosaccharide, that the human body can not break down fully. Oligosaccharides are large molecules. Other sugars are broken down and absorbed in the small intestine, but the human body does not produce an enzyme that breaks down oligosaccharides.

Oligosaccharides in beans make it all the way to the large intestine undigested. Bacteria in the large intestine finally break down these sugars. Doing so causes fermentation and the production of gas that we release as flatulence.

By the same principle, other foods that come into the large intestine without being absorbed in the small intestine will cause gas. For example, stress can affect digestion and nutrient absorption and result in the production of excess gas.﻿﻿

Preventing Gas From Beans

To prevent gas that is caused by eating beans or other foods, the oligosaccharides must be broken down before they reach the large intestine and become food for the resident bacteria that live there.

There is an enzyme that breaks down oligosaccharides, called alpha-galactosidase. This enzyme, which the human body does not make, is derived from the fungus Aspergillus niger and is available in pill form under the brand name Beano and others.﻿﻿

Alpha-galactosidase may not appropriate for people with diabetes as the premature breakdown of oligosaccharides can lead to an increase in blood sugar. It should also be avoided in people with a mold allergy.

Alpha-galactosidase may also increase galactose levels in the blood and should not be used by those who have the genetic disease galactosemia.

A Word From Verywell

As long as it's not causing pain or excessive bloating, gas is a normal and expected part of the digestive process. In fact, gas is an indication that things are going the way they should in the intestines.

Gas itself from diet won't cause any real harm, but taking steps to minimize gas can be used if it causes too much trouble. People who feel they truly have too much gas or discomfort from gas should talk to a doctor about how best to manage it.