Everyone burps and passes gas. Some do these things more often than others. It can be loud and sometimes smelly, but gas is a normal part of the digestive process – even if it’s uncomfortable or embarrassing.

Understanding what causes gas can help you feel less self-conscious and find some relief. It’s also important to recognize when gas, bloating and belly pain are actually warning signs of a more serious health condition, according to Brian van der Linden, MD, an HCA Healthcare gastroenterologist.

What causes gas?

Eating quickly or drinking carbonated beverages are among the ways you can accidentally swallowing more air than usual. When this swallowed air – or gas – is released through your mouth, it’s called a burp, or a belch. Carbonated drinks and beer also release carbon dioxide gas, which can increase belching. Swallowing air and drinking bubbly beverages can also make you pass gas or “fart” if it travels through your digestive tract and is released through your anus. Which direction the air travels may depend on your posture. Gas tends to head from your stomach toward your small intestine when you’re laying down on your back.

“A lot of times, when people are eating soup or something liquid with a spoon, they tend to swallow more air,” Dr. van der Linden says. This can also happen when you slurp hot liquids, like coffee or tea, he adds. Chewing gum and smoking can also cause you to swallow more air.

Another gas-causing culprit: bacteria. Gas can also be caused by microorganisms, particularly bacteria, in your large intestine. Your body can’t completely breakdown some sugars, starches and fiber in certain foods, such as beans, grains and some vegetables, including cabbage, Brussels sprouts and broccoli. Lactose, a sugar found in milk and other dairy products, poses a problem for people who don't produce enough lactase, the enzyme needed to break down lactose. Food that isn’t digested in the stomach and small intestine is broken down by bacteria in the large intestine, and gut bacteria produce gas during digestion.

Fiber – found in foods like apples, squash, beans and oats – is an essential nutrient that can support digestion and prevent constipation. Like some sugars and starches however, most fiber isn’t broken down in the stomach and small intestine. What’s left is digested by bacteria in the colon. Dietary fiber can lead to gas and bloating, particularly if you consume more fiber than usual. “Of course you don't want to make too much gas, but a lot of the fiber [in these foods] is healthy,” van der Linden says.

Some foodborne illnesses, like Cyclospora, and certain medications, like acarbose, which is sometimes prescribed to people with diabetes, may also be to blame. Powerful prescription painkillers, called opioids, and antidepressants can make you constipated, which can make it harder to pass gas and increase symptoms like bloating and abdominal discomfort.

What’s normal?

Belching is common during and after meals. It’s also normal for otherwise healthy adults to pass gas between 10 to 20 times each day. In fact, many people who think they have more gas than others, actually fall within this normal range.

The vast majority of the gas you expel each day is made up of nitrogen, oxygen, carbon dioxide, hydrogen and methane. When gas includes hydrogen sulfide and ammonia, the result may be particularly odorous flatulence (smelly farts). The frequency and unpleasant smell associated with passing gas can sometimes be controlled by altering your diet. For example, if your gas is particularly stinky, cutting back on foods that contain sulfuric compounds, such as broccoli, cauliflower and cabbage, could help.

Signs of trouble

Temporary discomfort and bloating could signal a normal buildup of gas, but excessive gas that’s accompanied by abdominal pain, bloating or fullness, nausea or weight loss could be a warning sign of a more serious health issue – especially if you haven’t made any significant changes to your diet or lifestyle.

“When somebody complains they have a lot of gas or that they feel bloated, that's when we would say it’s something more,” he says. “When it becomes symptomatic, that’s when we know it’s too much."

In some cases, excessive gas may signal a digestive condition, such as:

  • IBS (irritable bowel syndrome) is a gastrointestinal disorder that causes symptoms like persistent gas along with bloating, abdominal pain, mucus in your stool, changes in bowel habits and feeling like you haven’t finished a bowel movement. These issues develop without visible signs of damage to their digestive tract.

For those with IBS, “something that would normally be digested and absorbed can still cause gas,” van der Linden says. "Essentially, food gets squirted down into the colon too quickly.”

Doctors and researchers believe IBS could result from miscommunication between the brain and the gut, which make the digestive tract hypersensitive. This can lead to symptoms like belly pain and bloating. It can also alter the way bowel muscles move and work, resulting in constipation or diarrhea. Genetics, infections and certain food intolerances could also play a role. Foods containing FODMAPs (fermentable oligosaccharides, disaccharides, monosaccharides, and polyols), like milk, apples, chickpeas and pears, can cause particular pain for those with IBS. If these foods make you especially gassy, your doctor may recommend what's known as a low FODMAP diet, or an eating plan that limits these symptom-causing foods.

  • Food intolerances develop when people have trouble digesting or breaking down a particular food. This can lead to symptoms like gas, belly pain, bloating and diarrhea. Food intolerances involve the digestive system and should not be confused with food allergies, which trigger an immune system reaction. If you have an intolerance to a certain food or ingredient, the more you eat, the worse your symptoms may become. If you have a food allergy, on the other hand, exposure to even a tiny amount of a particular food allergen can trigger a serious reaction.

Common intolerances include lactose (sugar found in dairy products), fructose (a simple sugar found in fruit, some vegetables and honey) and short-chain fermentable carbohydrates, like pasta, beans, yogurt, cherries and cauliflower. In some cases, the body lacks necessary enzymes to digest nutrients in certain foods, like lactose.

“It’s pretty common that by middle age and older, people have some lactose intolerance,” van der Linden says. “You begin to lose the lactase enzyme that’s produced in the small intestine,” he adds.

  • GERD (gastroesophageal reflux disease) develops when the muscles at the bottom of the esophagus don’t work properly. This causes stomach acid to back up into the esophagus, which can lead to burning in the chest or throat, or heartburn, as well as problems swallowing and coughing. This problem may be considered GERD if it happens at least twice a week for several weeks. GERD could cause excessive belching, since the condition can make you swallow more air than usual, although it's not the main symptom. Smokers, pregnant women and people who are obese are more likely to develop GERD. Some medications, like painkillers and antidepressants, also increase your risk for the condition.
  • IBD (inflammatory bowel disease) is an umbrella term for two conditions – Crohn’s disease and ulcerative colitis – that trigger inflammation in different parts of the digestive tract. Crohn's disease usually affects part of the small intestine but may involve any part of the gastrointestinal (GI) tract. Ulcerative colitis, however, is usually limited to the colon and rectum. Over time, this inflammation can damage the lining of the digestive tract. In addition to frequent or persistent gas, IBD can cause abdominal pain, fatigue, weight loss, bloody stool, persistent diarrhea or bloating.

In 2015, an estimated three million Americans reported being diagnosed with IBD. Experts still aren't sure what causes the condition, but there could be an abnormal immune response, triggered by some environmental factor, that damages the intestinal tract. Your genes may also play a role. Some studies suggest there may be an increased risk for some types of IBD, especially among those who are obese, inactive or eat a high-fat or western-style diet – which may include a lot of processed, fried or sugary foods.  In fact, regular physical activity is associated with a decreased risk for Crohn’s disease.

  • Peptic ulcers are open sores in the upper digestive tract that can cause chronic belching along with abdominal pain, feeling full quickly during meals, bloating, heartburn or bloody stool. Ulcers can be caused by a certain bacterial infection or nonsteroidal anti-inflammatory drugs (NSAIDs) – medications commonly used to relieve pain and reduce inflammation. Stress, smoking and having a close relative with a peptic ulcer could increase your risk for the condition.
  • Celiac disease is a digestive disorder triggered by eating gluten, a protein found in wheat, rye, barley, malt and products, like bread, pasta and even some soy sauces. When someone with the condition eats gluten, the immune system overreacts and attacks the lining of the small intestine, which can cause symptoms like excess gas, along with diarrhea, abdominal pain, unintended weight loss, bloating and constipation.

As many as 1 in 141 Americans have celiac disease, but many do not seek out medical help for their uncomfortable symptoms. What causes the condition is unclear, but experts believe a combination of genetic and environmental factors may be involved.

When to seek relief

Most minor fluctuations in gas and bowel habits are normal, but if you experience excessive or persistent gas or bloating, it’s time to seek medical attention, cautions van der Linden. “A little gas is probably healthy, but a lot of gas, that could be a problem,” he says.

Talk to your doctor if gas symptoms change suddenly, become severe, begin to interfere with your normal activities or are accompanied by other symptoms. A physical exam, stool tests, blood tests and imaging tests, which may include an endoscopy or colonoscopy, might be performed to help rule out or diagnose an underlying health issue. Your physician will also review your symptoms and family history and may recommend keeping a food journal or eliminating certain foods from your diet.

Dietary changes, such as eating more slowly, not gulping food or drinks and avoiding or limiting certain foods or beverages, can help relieve some uncomfortable symptoms. Adding even small bouts of exercise to your day can help push gas through your system and ease bloating. Stress management techniques, like yoga or meditation, can help keep you from unintentionally swallow air when you’re talking, which can happen when you're upset or nervous.

If an underlying condition is causing uncomfortable gas, your doctor may recommend treatments, including over-the-counter or prescription medication to help alleviate abdominal pain, diarrhea and constipation, as well as interventions like therapy or surgery, although these are less common.

Red flags you shouldn’t ignore

Gas is usually not a medical emergency, but when accompanied by certain worrisome symptoms, it’s a good idea to speak with your doctor. Colon cancer is one potential concern, van der Linden says. “If [colorectal cancer] is in the lower part of the colon and causing a partial blockage, it could make things back up a little bit easier,” he says.

Additional warning signs of a potentially serious health issue that requires medical attention include:

  • Bloody stool
  • Changes in frequency of bowel movements
  • Persistent diarrhea or constipation
  • Unexplained weight loss
  • Severe abdominal pain
  • Loss of appetite

This content originally appeared on Sharecare.com.