Your body produces between 500 and 1,500 mL of intestinal gas every day, roughly one to three pints. Most of it forms when bacteria in your large intestine ferment carbohydrates that your small intestine couldn’t fully digest. The rest comes from swallowed air. Understanding how gas is made, both inside your body and in simple chemistry, starts with knowing what’s actually in it.
What Gas Is Actually Made Of
Intestinal gas is mostly odorless. A meta-analysis of its chemical composition found it averages about 65% nitrogen, 10% carbon dioxide, 3% hydrogen, 14% methane, and 2% oxygen. The nitrogen comes largely from swallowed air. The carbon dioxide, hydrogen, and methane are produced by bacterial fermentation in your colon. None of these gases have a smell.
The smell comes from trace sulfur compounds, particularly hydrogen sulfide, methyl mercaptan, and dimethyl sulfide. These make up a tiny fraction of total gas volume but are detectable by the human nose at extremely low concentrations. Foods rich in sulfur-containing amino acids (eggs, meat, cruciferous vegetables like broccoli and cabbage) tend to produce the most odor, while high-fiber, low-sulfur foods produce more volume with less smell.
How Your Gut Bacteria Produce Gas
The process starts when undigested carbohydrates reach your colon. Bacteria break down these molecules through fermentation, releasing hydrogen and carbon dioxide as byproducts. From there, other microbial species compete for the hydrogen. One group, led by a microbe called Methanobrevibacter smithii, converts hydrogen into methane. Only about one in three people harbor enough methanogens to show up on a breath test, which is why not everyone produces significant methane.
Another group of bacteria, including Fusobacterium and Desulfovibrio species, uses hydrogen to produce hydrogen sulfide, the compound responsible for the rotten-egg smell. These two microbial populations tend to dominate in different people. Research has found that people with higher methane-producing bacteria tend to have slower gut transit, while those with more hydrogen sulfide producers tend to have faster transit and looser stools. Your gut’s microbial balance essentially determines how much gas you make, what kind, and how it smells.
Foods That Produce the Most Gas
The biggest gas producers are foods containing a family of sugars called raffinose family oligosaccharides (RFOs). Humans lack the enzyme needed to break these sugars down in the small intestine, so they pass intact to the colon, where bacteria ferment them into hydrogen, carbon dioxide, and methane.
Beans and legumes are the most concentrated source. Soybeans contain 6 to 8 grams of these sugars per 100 grams, with stachyose as the dominant one. Chickpeas get about 27% of their soluble sugar content from stachyose and another 8 to 10% from raffinose. Faba beans are especially high in verbascose, a larger sugar molecule that produces even more fermentation, at about 2.3% of dry weight. Black gram contains 3.4% verbascose. Interestingly, polished rice contains none of these oligosaccharides, which is one reason it’s considered a low-gas food.
Beyond legumes, other common gas-producing foods include onions, garlic, wheat, artichokes, and most fruits with significant fructose. Dairy products cause gas in people who don’t produce enough lactase to digest lactose. The fiber in whole grains and vegetables also contributes to gas volume, though less intensely than the oligosaccharides in legumes.
In one controlled study, switching healthy volunteers from their normal diet to a fiber-free liquid diet for 48 hours cut their daily gas production from a median of 705 mL down to 214 mL and virtually eliminated hydrogen production. That gives a clear picture of how much dietary fiber and fermentable carbohydrates drive the process.
Gas Production During Sleep vs. Daytime
Your body doesn’t stop making gas while you sleep, but it does slow down. Healthy volunteers produce gas at a median rate of about 34 mL per hour during the day and 16 mL per hour at night. The slower rate likely reflects reduced gut motility and the absence of new food arriving in the colon. Men and women produce roughly the same total daily volume.
How to Make Gas With Simple Chemistry
If you’re looking for a hands-on demonstration, the classic baking soda and vinegar reaction is the simplest way to produce carbon dioxide gas. Baking soda (sodium bicarbonate) reacts with the acetic acid in vinegar to form carbonic acid, which immediately breaks apart into water and CO2. The CO2 is a gas at room temperature, so it bubbles out of the liquid.
The ratio matters if you want maximum gas output. To fully react 5 cubic centimeters (about one teaspoon) of baking soda, you need approximately 110 cubic centimeters of standard white vinegar, which is roughly half a cup. That amount produces about 0.083 moles of CO2, enough to inflate a small balloon. Using less vinegar leaves unreacted baking soda behind, and using more just means extra vinegar sitting in the mixture doing nothing.
How Biogas Is Made at Scale
The same basic principle that produces gas in your gut, microbial fermentation of organic matter in the absence of oxygen, is used industrially to produce biogas. Anaerobic digesters feed organic waste (food scraps, manure, crop residue) to microorganisms in sealed, oxygen-free tanks. The process happens in stages: bacteria first break down complex polymers through hydrolysis, then other microbes convert the resulting molecules into acids, and finally methane-producing archaea generate methane gas.
Digesters typically operate at one of two temperature ranges: mesophilic (around 35°C, or 95°F) or thermophilic (around 55°C, or 131°F). The hydrolysis stage works best at a pH between 5 and 7, while methane-producing microbes need a higher, more neutral pH. The balance of carbon to nitrogen in the feedstock also affects output. Dairy manure produces optimal methane at a carbon-to-nitrogen ratio of about 25:1 in mesophilic systems, while thermophilic systems perform best closer to 35:1. Research has even demonstrated biogas production at temperatures as low as -15°C using specialized cold-adapted microbes from Alaskan lake sediments, though yields drop significantly at those extremes.
About two-thirds of the methane in a typical digester comes from the breakdown of acetate, with the remaining third produced when microbes combine hydrogen and carbon dioxide. The resulting biogas, typically 50 to 70% methane, can be burned for heat, used to generate electricity, or refined into pipeline-quality natural gas.
Flammability of Gas
Both methane and hydrogen are flammable. Methane’s explosive range in air is between 5% and 15% concentration. Below 5%, there isn’t enough fuel to sustain a flame. Above 15%, there isn’t enough oxygen. Hydrogen has an even wider flammable range, from about 4% to 75% in air. Human intestinal gas occasionally contains enough hydrogen or methane to be flammable, which is why electrosurgical tools used during colonoscopies require specific safety protocols involving bowel preparation to clear combustible gases.

