How to relieve gas pain

By Jenilee Matz, MPH May 25, 2023 • 4 min

Everyone passes gas. While it's a normal bodily process, it can be embarrassing or uncomfortable. Gas that is not passed by the body through burping or flatulence (passing gas through the rectum) can lead to a feeling of bloating (fullness) and stomach pain. Here you'll learn what causes gas and what to do to get rid of gas pain.

What causes gas?

Gas typically comes from two sources:

Swallowed air. This is a common cause of gas in the stomach. It's normal to swallow a small amount of air when eating and drinking. However, eating or drinking too fast, talking while eating, chewing gum or smoking can cause you to swallow excess air.

Bacteria from undigested foods. Your body produces gas when naturally occurring bacteria in your colon ferments carbohydrates that aren't digested in your small intestine. Examples of these carbohydrate-containing foods include cabbage, cauliflower, broccoli and beans.

Some people have stomach pain, bloating and gas when they drink milk or eat certain cheeses or ice cream. This condition is known as lactose intolerance. People with lactose intolerance don't make enough lactase, an enzyme that is required to digest lactose, the sugar in milk and other dairy products.

Dietary fiber can contribute to increased gas. Excess gas can also be caused by some digestive system conditions or triggered by certain medications.

Other health conditions may also cause gas. These include celiac disease, gastroparesis, reflux disease, constipation, irritable bowel syndrome (IBS), gastrointestinal blockages or obstruction, and irritable bowel diseases such as Crohn’s disease and ulcerative colitis.

Relief for gas

While you can't stop gas entirely, these strategies can help prevent or reduce bothersome gas:

  • Avoid carbonated drinks and limit how much gas-producing foods you eat. These may include soda, beer, milk and dairy products, certain fruits or vegetables, whole grain foods and artificial sweeteners. 
  • Consider keeping a record of the foods and drinks you consume and note how they make you feel. This can help you identify which foods bother you.
  • Eat and drink more slowly. This can reduce how much air you swallow.
  • Limit your consumption of milk products if you're lactose intolerant. You might also consider using lactose-digestive aids, such as lactose-reduced milk and over-the-counter (OTC) lactase enzyme tablets or drops.
  • Seek treatment for reflux disease. Management may include over-the-counter antacids or prescribed medications.
  • Limit chewing gum and eating hard candy. Both can cause you to swallow more air, which can lead to excess gas.
  • Move around after you eat. Light exercise such as a short walk may help your digestive system move food and air after eating a meal.
  • Try OTC gas relief medications. Your healthcare provider or pharmacist can help you decide what to take. Simethicone-containing products, like Gas-X or Mylanta Gas, may help break up gas bubbles so you can belch them away more easily. Alpha-galactosidase, an enzyme found in Beano, can help break down some non-digestible carbohydrates, like those in beans and some vegetables. Bismuth subsalicylate, the active ingredient in products, such as Pepto-Bismol and Kaopectate, may help reduce the odor of bad-smelling gas

Most of the time gas is nothing to be concerned about. However, in some cases, it can be a symptom of a more serious problem. If your gas pain doesn't go away or seems to get worse, contact your healthcare provider.

Clinically reviewed and updated May 2023.

Explore more

4 min
By Jenilee Matz, MPH
Apr 03
8 min
By ​​Benjamin Renelus, MD, Gastroenterologist
Jan 08