Bad-smelling gas comes down to sulfur. When bacteria in your large intestine break down certain foods, they release sulfur-containing gases that carry that distinctive rotten-egg smell. Everyone produces these gases, but the intensity depends on what you eat, how your gut bacteria behave, and how quickly food moves through your system.
The Sulfur Gases Behind the Smell
Most of the gas you pass is actually odorless. Nitrogen, carbon dioxide, and even hydrogen make up the bulk of flatulence and have no smell at all. The stink comes from a small fraction of sulfur-based compounds. A study published in the journal Gut identified three main culprits: hydrogen sulfide (the primary offender, responsible for the rotten-egg smell), methanethiol, and dimethyl sulfide. Hydrogen sulfide was present at roughly five times the concentration of methanethiol and more than ten times that of dimethyl sulfide.
These gases are produced by sulfate-reducing bacteria in your colon. These microbes feed on sulfur from two sources: the food you eat and the mucus your intestinal lining naturally produces. So even on a bland diet, your gut bacteria have some sulfur to work with. But certain foods give them a lot more.
Foods That Make It Worse
The biggest dietary drivers of smelly gas are foods high in sulfur compounds. The usual suspects include broccoli, cauliflower, cabbage, Brussels sprouts, onions, and garlic. Beans and lentils also contribute, partly because of sulfur content and partly because they contain carbohydrates your small intestine can’t fully digest, leaving more material for bacteria to ferment.
Mushrooms, eggs, and red meat are other common triggers. Meat and eggs are rich in sulfur-containing amino acids, which gut bacteria break down into those same foul-smelling gases. If you’ve recently increased your protein intake through shakes, bars, or just eating more meat, you may notice your gas smells worse than usual. The protein itself doesn’t necessarily make you gassier in terms of volume, but the sulfur byproducts from digesting it can make each episode more pungent.
Beer and wine deserve a mention too. Both contain sulfites and can alter gut fermentation in ways that amplify odor.
How Constipation Makes It Worse
When stool sits in your colon longer than usual, bacteria have more time to ferment it. The longer the fermentation, the more sulfur gas builds up. This is one of the most overlooked reasons for a sudden change in how bad your gas smells. If you’re constipated and noticing that your flatulence has become particularly foul, the two are likely connected. Getting things moving again with fiber, water, and physical activity often resolves the smell on its own.
Gut Conditions That Affect Gas Odor
Persistently foul-smelling gas can sometimes point to a condition where your body isn’t absorbing nutrients properly. When food isn’t fully broken down and absorbed in the small intestine, it reaches the colon largely intact, giving bacteria far more to ferment. Several conditions cause this pattern:
- Lactose intolerance leaves undigested milk sugar in the colon, where bacteria ferment it aggressively. Bloating, cramps, and foul gas after dairy are the hallmark signs.
- Celiac disease damages the small intestine’s lining, reducing its ability to absorb nutrients from food. Smelly gas, chronic diarrhea, and unexplained weight loss are common symptoms.
- Irritable bowel syndrome (IBS) doesn’t necessarily cause more gas production, but research from Monash University found that people with IBS experience significantly more pain and discomfort from the same amount of gas compared to people without the condition. Their guts are more sensitive to distension.
If your foul-smelling gas is accompanied by persistent diarrhea, abdominal pain, or weight loss you can’t explain, those are signs worth investigating with a healthcare provider. A sudden change in your gas patterns, especially alongside changes in bowel habits, can signal something beyond diet.
Antibiotics and Medications
Antibiotics are one of the most common medication-related causes of smelly gas. They disrupt the balance of bacteria in your gut, sometimes killing off beneficial species while allowing others to flourish. This temporary imbalance can produce unusually foul-smelling flatulence that lasts days to weeks after finishing a course. In some cases, antibiotics can trigger a C. difficile infection, which causes particularly offensive gas along with watery diarrhea.
Metformin, a widely used diabetes medication, is another frequent culprit. It alters gut bacteria and can cause bloating, gas, and changes in stool for weeks or months after starting it.
How Much Gas Is Normal
If you’re wondering whether you’re gassier than average, recent research using wearable sensors found that healthy young adults passed gas about 32 times per day on average, with a range from 4 to 59 times daily. That’s a huge spread, and researchers noted that the true “normal” range hasn’t been well established because nobody had measured flatulence in real-world conditions before. So passing gas frequently is not, by itself, a problem. The smell is more informative than the frequency.
Reducing the Smell
The most effective approach is dietary. Cutting back on high-sulfur foods for a week or two is the simplest way to test whether your diet is the main driver. You don’t need to eliminate these foods permanently. Just reducing portions of cruciferous vegetables, onions, and high-protein meals can noticeably decrease odor.
A low-FODMAP diet, which restricts certain fermentable carbohydrates, can reduce gas volume and discomfort, particularly for people with IBS. It’s designed as a short-term elimination diet, typically done with guidance from a dietitian, where you remove high-FODMAP foods and then reintroduce them one at a time to identify your personal triggers.
For a more direct approach, bismuth subsalicylate (the active ingredient in Pepto-Bismol) has strong evidence behind it. In a clinical study, taking it four times daily for three to seven days reduced hydrogen sulfide release in the colon by more than 95%. The bismuth component binds to hydrogen sulfide and neutralizes it. This isn’t a long-term solution, but it works well for short-term situations where you want to reduce odor quickly.
Simpler habits also help. Eating slowly reduces the amount of air you swallow, which means less total gas. Staying hydrated and physically active keeps your digestive system moving, reducing the fermentation time that makes gas smell worse. Probiotics may help restore balance after antibiotics, though the evidence for their effect on gas odor specifically is limited.

