Stomach Cramps And Gas: The 5 widespread causes & Their Treatment (GI Doctor Explains).

Our content is not intended nor recommended as a substitute for medical advice by your doctor. Use for informational purposes only.

Hello, I’m Dr. Farahat, a seasoned gastroenterologist, and I understand how stomach cramps and gas can turn a normal day into a challenging one.

These symptoms are more than just a minor inconvenience – they can significantly impact your quality of life. But here’s the good news: understanding is the first step to overcoming.

In this article, I’ll share my expertise on the four most common causes of stomach cramps and gas and the effective treatments that can help you regain control of your gut health. So, let’s embark on this journey to a more comfortable and gas-free life together!

The Short answer:

Stomach cramps and gas can be caused by certain foods, digestive disorders like irritable bowel syndrome (IBS), food intolerances, overeating, and swallowing air while eating or drinking. To relieve the cramps and gas, you must first identify the cause.

1- Lactose Intolerance (Very Common & Underrated  Cause of Cramps and Gas).

Ever had a delicious ice cream sundae only to be rewarded with a symphony of stomach cramps and gas? If so, you might be part of the surprisingly large club of people dealing with lactose intolerance.

How Common is Lactose Intolerance Anyway?

You’d be surprised! Globally, about 65% of people cannot digest lactose post-infancy. This phenomenon, known as primary lactose intolerance, is particularly prevalent among adults.

Lactose intolerance may reach a prevalence of 100% percent in certain populations (reference). These shockingly high rates of lactose intolerance explain why many people have chronic or recurrent stomach cramps and gas that comes and goes. 

In the United States, the numbers are equally staggering, with an estimated 30 to 50 million people grappling with lactose intolerance. That’s no small number!

What is lactose? And what are its sources?

Lactose is a sugar that’s primarily found in milk and dairy products. The usual suspects include milk, cheese, yogurt, and ice cream. But lactose can be sneaky, hiding in less obvious places.

Here are some of the most common sources of lactose:

  1. Milk: This includes all types of cow’s milk (whole, semi-skimmed, and skimmed), as well as goat’s and sheep’s milk.

  2. Cheese: Most types of cheese contain lactose, especially soft cheeses. Hard cheeses like cheddar and Swiss contain less lactose and may be more tolerable.

  3. Yogurt: Both regular and Greek yogurt typically contain lactose.

  4. Ice Cream: Ice cream is made from cream and milk, both containing lactose.

  5. Butter: While it contains less lactose than other dairy products, butter still has some.

  6. Cream: This includes heavy cream, half-and-half, and even sour cream.

  7. Custards and Puddings: These are typically made with milk, making them a source of lactose.

In addition, lactose can also be found in many processed and prepared foods. These can include:

  1. Bread and Baked Goods: Some bread and baked goods can contain milk or milk products.

  2. Processed Meats: Some processed meats, like sausages or deli, may contain lactose.

  3. Breakfast Cereals: Some cereals may contain lactose, especially those meant to be eaten with milk.

  4. Salad Dressings and Sauces: Some can contain milk or milk products.

  5. Snack Foods: Some snack foods, like chips or pre-packaged snacks, may contain lactose.

  6. Prepared Meals: Some ready-to-eat meals may contain lactose.

Spotting the Symptoms of Lactose Intolerance

Lactose intolerance can manifest differently in different people, but some common symptoms include gas, bloating, diarrhea, and, yes, those pesky stomach cramps. These symptoms typically show up anywhere from 30 minutes to 2 hours after you consume lactose-laden foods or drinks.

The symptoms’ severity is often dose-dependent. The more lactose you intake, the more stomach cramps, gas, bloating, diarrhea, and nausea you will get. 

Here is a breakdown of the symptoms:

  1. Bloating: This is a feeling of fullness or swelling in your abdomen.

  2. Diarrhea: This can sometimes be severe and usually occurs soon after eating.

  3. Gas: Excess flatulence can occur.

  4. Stomach cramps or pain: These can range from mild to severe.

  5. Nausea: This can occur with or without vomiting.

  6. Rumbling or gurgling sounds in your belly.

  7. Loose stools or diarrhea: The stools may be foamy.

How to confirm lactose intolerance?

If you suspect lactose intolerance, getting a proper diagnosis is crucial. This usually involves a lactose intolerance test, which your doctor can administer.

The test involves drinking a lactose-heavy liquid, followed by breath tests to measure the hydrogen in your breath.

High hydrogen levels typically indicate that your body isn’t fully breaking down and absorbing lactose.

Pro Tip: If you cannot take the lactose intolerance test for any reason. You can try a therapeutic test by cutting lactose from food (for at least one week) and watching for your symptoms. Lactose intolerance is highly suspected if the recurrent stomach cramps and gas improve dramatically or disappear.

Management and remedies:

While there’s no magic cure for lactose intolerance, dietary changes can effectively manage it. This usually means cutting down on lactose or avoiding it altogether.

Tweaking Your Diet

Living with lactose intolerance means being vigilant about what you eat. This involves scrutinizing food labels to check for hidden lactose. You might also want to explore lactose-free alternatives like lactose-free milk or cheese.

Interestingly, some people with lactose intolerance can still tolerate small amounts of lactose without triggering symptoms. It’s all about finding your lactose threshold.

Learn more about lactose intolerance symptoms and how long it last. Also, learn about what happens if you ignore lactose intolerance.

2- Irritable bowel syndrome (IBS).

Irritable bowel syndrome is a very common medical condition. It affects nearly 15% of people worldwide. IBS is one of the main causes of stomach cramps and gas. Many people don’t know they have irritable bowel syndrome.

Symptoms: How to know if IBS is causing your stomach cramps and gas:

Irritable bowel syndrome (IBS) is characterized by (reference):

  • Abdominal pain (stomach cramps) that occurs at least one day per week in the past three months (with symptom onset from at least six months):
  • The onset of stomach cramps has to be associated with at least 2 of the following:
    • Defecation: defecation may improve your abdominal pain (with fewer people, defecation may worsen the stomach cramps).
    • Change in your stool form: the stool becomes harder or softer.
    • Change in stool frequency: onset of stomach cramps is associated with diarrhea, constipation, or a mix of both.

Although “Gas” is not in the ROME IV of diagnosis of irritable bowel syndrome, it is one of the most frequent features of irritable bowel syndrome. Gas and bloating are more common in people with IBS with constipation or mixed type.


IBS diagnosis infographic representing the rome IV criteria including abdominal pain, changes in stool form, changes in stool frequency, and the associated of the pain onset with defecation

How to deal if you think your have IBS, or you already have IBS:

If you think IBS is the cause of your stomach cramps and gas, consult your doctor. Your doctor with review your symptoms and may need some laboratory investigations to confirm your condition.

REMEMBER: you cannot diagnose yourself for the first time with IBS; you must see a doctor.

Read more about How is IBS diagnosed.

If you already have IBS, then it is probably the cause of your stomach cramps and gas; try to:

  • Stay away from diets that trigger your IBS and cause Gas (enlisted above), plus other specific foods that may play a role in your IBS, like FODMAPs and grassy foods.
  • Eat slowly, and move after eating.
  • Take over-the-counter medications for stomach cramps and gas (see my resources page for best recommendations).
  • More tips about IBS pain relief are here.

The symptoms of Lactose intolerance and IBS may overlap. Also, Most IBS sufferers are lactose intolerant (Lactose is one of the FODMAPs). The table below compares IBS and lactose intolerance: 

AspectLactose IntoleranceIrritable Bowel Syndrome (IBS)
DefinitionA digestive disorder caused by the inability to digest lactose, the main carbohydrate in dairy products.A common disorder that affects the large intestine and can cause cramping, abdominal pain, bloating, gas, and changes in bowel habits.
PrevalenceLactose intolerance is quite common, affecting about 65% of the world’s population to some degree. In the USA, it’s estimated that around 30 to 50 million people are lactose intolerant.IBS is also common, affecting 10 to 15% of the population worldwide. In the USA, it’s estimated that 10 to 15% of adults have IBS, although only 5 to 7% have been diagnosed.
SymptomsSymptoms include bloating, diarrhea, gas, nausea, and stomach pain. These usually occur 30 minutes to 2 hours after consuming dairy products.Symptoms can vary but often include cramping, abdominal pain, bloating, gas, diarrhea, constipation, or both.
DiagnosisLactose intolerance can be diagnosed through a lactose intolerance test, a hydrogen breath test, or a stool acidity test.IBS is typically diagnosed based on symptoms and the exclusion of other conditions. Tests may include stool sampling tests, blood tests, and endoscopic procedures.
TreatmentThe most effective treatment is to limit or avoid foods and drinks that contain lactose. Lactase enzyme supplements can also help.Treatment focuses on relieving symptoms and often includes diet, lifestyle, and stress management changes. Medications and other therapies may also be used.
Dietary ModificationsAvoiding lactose-containing foods and drinks, such as milk, cheese, and yogurt, is usually necessary. Many people can tolerate small amounts of lactose.A diet low in FODMAPs (fermentable oligosaccharides, disaccharides, monosaccharides, and polyols) is often recommended. This includes limiting certain fruits and vegetables, beans, lentils, wheat, and dairy products.

3- Too much gassy foods (beyond the capacity of your digestive system).

  • How common: Intermittent attacks of mild stomach cramps and gas due to overeating certain types of ‘gassy’ food are very common.
  • Characteristic features: Gas, bloating, and mild cramps after eating too much gassy foods. The condition typically improves after defecation or passing gas. 

If you’ve been experiencing stomach cramps and gas, you might be quick to assume you’re dealing with a medical condition. However, these symptoms don’t always point to a disease. They could be your body’s way of telling you it’s not happy with something you’re eating.

Our digestive system is not wired to deal with large amounts of certain amounts of food. Overeating one or more of these foods can lead to 

The Role of Food in Gas and Cramps

Food plays a significant role in the production of gas and cramps. Certain foods undergo fermentation by gut bacteria, leading to gas production. It’s not just the type of food that matters, but also the quantity. A small serving of a gas-producing food might not cause discomfort, but larger amounts could lead to cramps and gas.

Identifying Food-Related Cramps and Gas

If you notice that your stomach cramps and gas tend to start after eating certain foods or drinks and that cutting these foods out improves your condition, you’re likely dealing with food intolerance.

Most common foods causing stomach cramps and gas: (ref)

1-Beans, lentils.

2- Dairy products: milk, ice cream, cheese, and yogurt

3- Some vegetables: cabbage, broccoli, asparagus, and Brussels sprouts.

4- Whole grains: wheat and oats.

5- sodas and other carbonated drinks.

6- onions.

7- Certain fruits: apples, pears, prunes, and peaches.

8- Hard candies, chewing gum: contain artificial sweeteners and make you swallow air.

9- processed foods: packaged bread, snack foods, cereal, and salad dressings.


How to decrease stomach cramps and gas caused by foods.

  • Start a food diary; it will help you to detect foods that cause stomach cramps and gas.
  • You don’t have to stop eating these foods completely. You can try to eat smaller amounts.
  • Regarding beans, soaking them overnight can help reduce gas.
  • Using over-the-counter products like Beano can help reduce gas and stomach cramps.
  • Completely avoid hard candies and chewing gum.

4- Food Intolerance and Allergy: Beyond Lactose Intolerance.

  • How common: Food intolerance affects about 20% of the population, while food allergy affects about 2-5% of people (reference).
  • Common characteristics: the same symptoms of lactose intolerance but after ingesting a different type of food. Food allergy may cause allergic symptoms such as skin rashes, swollen lips, itching, etc.

While lactose intolerance is a common food intolerance, it’s not the only one. Several other types of food intolerances and allergies can cause discomfort and digestive issues. Let’s delve into the differences between food intolerance and food allergy and explore some common examples.

Food Intolerance vs. Food Allergy

Food intolerance and food allergy might seem similar but fundamentally different. Food intolerance involves the digestive system and occurs when your body has difficulty digesting certain foods. On the other hand, food allergy involves the immune system and occurs when your body reacts to certain foods as if they were harmful invaders.

 Food IntoleranceFood Allergy
DefinitionDifficulty digesting certain foodsImmune system reaction to certain foods
OnsetIt can be gradual, and usually occurs a few hours after eating the offending foodIt can be immediate, and usually occurs within minutes to an hour after eating the offending food
SymptomsMainly digestive discomfort, such as bloating, gas, cramps, constipation, or diarrheaIt can cause a range of symptoms, from mild (rashes, hives, itching, swelling) to severe (difficulty breathing, wheezing, loss of consciousness)
Quantity of FoodSymptoms can occur with any amount of food but are often dose-dependentEven a tiny amount of food can trigger an allergic reaction
Common Offending FoodsLactose, fructose, gluten, caffeine, FODMAPsPeanuts, tree nuts, milk, eggs, wheat, soy, fish, shellfish

Common Food Intolerances

Apart from lactose intolerance, other common food intolerances include:

  1. Fructose Intolerance: Difficulty digesting fructose, a sugar found in fruits, honey, and high-fructose corn syrup.
  2. Gluten Intolerance (Non-Celiac Gluten Sensitivity): Reactions to gluten, a protein found in wheat, barley, and rye, in people who do not have celiac disease.
  3. Caffeine Sensitivity: Reactions to caffeine, a stimulant found in coffee, tea, chocolate, and some medications.
  4. FODMAP Intolerance: Difficulty digesting certain carbohydrates (FODMAPs) found in various foods, from apples to beans.

Common Food Allergies

Common food allergies include:

  1. Peanut Allergy: Reactions to peanuts range from mild to severe.
  2. Milk Allergy: Not to be confused with lactose intolerance, milk allergy involves an immune reaction to the proteins in cow’s milk.
  3. Egg Allergy: Reactions to proteins in egg whites and yolks.
  4. Wheat Allergy: Reactions to proteins in wheat. This differs from celiac disease and non-celiac gluten sensitivity, which involve reactions to gluten, a specific type of protein found in wheat, barley, and rye.

5- Infection or gastroenteritis (stomach flu): Common cause of sudden severe stomach cramps, diarrhea, and gas.

Stomach flu is a viral infection of your stomach and intestine. Millions of people get viral gastroenteritis every year. It results from eating or drinking contaminated foods or drinks. Stomach flue causes sudden or acute onset of severe stomach cramps, nausea, vomiting, diarrhea, and gas that typically lasts 3 to 5 days.

Symptoms (how to suspect stomach flu)

  • Sudden onset of diarrhea, severe stomach cramps (short course for a few days)
  • Gas and bloating.
  • It may be a fever (Low or high grade).
  • Muscle aches and fatigue.
  • Nausea and vomiting may occur.

Graphical illustration of stomach flu (acute gastroenteritis) symptoms.

How to deal with:

  • Put your stomach at rest by quitting solid food for hours
  • Drink small amounts of water or non-caffeinated drinks frequently.
  • Avoid alcohol, nicotine, caffeine, and fatty foods.
  • Rest.
  • Consult your doctor about medications, and be cautious about medications that may cause more stomach upset, like ibuprofen and other NSAIDs.

Learn more about stomach flu here.

Other less common causes of stomach cramps and gas

Stomach cramps and gas can be caused by various factors, ranging from dietary habits to certain medical conditions. Here’s a list of common causes, along with a brief explanation and characteristic symptoms for each:

  1. Eating Too Quickly: Eating too quickly can cause your stomach to stretch, leading to discomfort and gas. Symptoms include a feeling of fullness, bloating, and belching.

  2. Swallowing Air: This can occur when you eat or drink too quickly, chew gum, smoke, or drink carbonated beverages. The swallowed air can lead to belching and bloating.

  3. Gastritis: This is an inflammation of the stomach lining, which can be caused by factors such as long-term use of NSAIDs, infection with Helicobacter pylori, or excessive alcohol consumption. Symptoms can include upper abdominal pain, nausea, and bloating.

  4. Peptic Ulcers: These are sores that develop on the lining of the stomach, upper small intestine, or esophagus, often due to infection with Helicobacter pylori or long-term use of NSAIDs. Symptoms can include burning pain in the middle or upper stomach between meals or at night.

  5. Gallstones are hard deposits in the gallbladder that can cause pain and cramping, especially after eating fatty meals. Other symptoms can include pain in the right upper or middle upper abdomen, back pain between shoulder blades, and nausea and vomiting.

  6. Pancreatitis: This is an inflammation of the pancreas, which can cause pain in the upper abdomen, nausea, vomiting, and bloating.

  7. Appendicitis: This is an inflammation of the appendix, which can cause severe pain in the lower right abdomen, loss of appetite, nausea, vomiting, and bloating.

  8. Diverticulitis occurs when small pouches, called diverticula, in the digestive tract, become inflamed or infected. Symptoms can include severe pain in the lower left side of the abdomen, fever, nausea, and a change in bowel habits.

  9. Celiac Disease: This is an autoimmune disorder where ingesting gluten leads to damage in the small intestine. Symptoms include abdominal pain, bloating, diarrhea, constipation, and gas.

  10. Gastroesophageal Reflux Disease (GERD): This chronic condition where stomach acid frequently flows back into the tube connecting your mouth and stomach (esophagus). This backwash (acid reflux) can irritate the lining of your esophagus, causing heartburn, chest pain, and belching.

  11. Inflammatory Bowel Disease (IBD): This term encompasses conditions characterized by chronic digestive tract inflammation, such as Crohn’s disease and ulcerative colitis. Symptoms can include severe diarrhea, abdominal pain, fatigue, and weight loss.

  12. Small Intestinal Bacterial Overgrowth (SIBO): This condition occurs when there is an abnormal increase in the overall bacterial population in the small intestine. Symptoms include gas, bloating, diarrhea, abdominal pain, and cramping.

  13. Gastroparesis: This is a condition where the stomach can’t empty itself of food in a normal fashion. It’s most often a complication of type 1 diabetes. Symptoms can include nausea, vomiting, abdominal bloating, and feeling full quickly when eating.

  14. Ovarian Cysts: These are fluid-filled sacs or pockets in an ovary or on its surface. While many women with ovarian cysts don’t have symptoms, a large cyst can cause pelvic pain, bloating, and a feeling of fullness in the abdomen.

  15. Endometriosis is a disorder in which tissue similar to the tissue that forms the lining of your uterus grows outside of your uterine cavity. Symptoms can include painful periods, pain with intercourse, discomfort with bowel movements or urination, and excessive gas or bloating.

  16. Certain Medications: Some medications or supplements can cause stomach cramps and gas as side effects. These can include certain types of antibiotics, pain relievers, iron supplements, and medications used for treating high blood pressure, among others.

Remember, it’s important to seek medical attention if you’re experiencing persistent or severe stomach cramps and gas. Your healthcare provider can help determine the cause and recommend appropriate treatment.

Red Flag signs: when to see your doctor for your stomach cramps and gas

The above conditions are the common causes of stomach cramps and gas. But this is not the complete list of causes. Some other medical conditions can cause stomach cramps and gas. Some of these medical conditions may be dangerous and require emergency medical consultation.

Serious causes of gas and stomach cramps include (but are not limited to):

  • Intestinal obstruction.
  • Perforated viscus.
  • Diverticulitis. 
  • Inflammatory Bowel Disease (Crohn’s and ulcerative colitis).
  • Food poisoning.
  • Intestinal or gastric masses and cancer.

All of the above conditions can cause stomach cramps and gas. But usually, the symptoms are more severe and associated with some red signs or flags.

If you experience any of the below symptoms and signs with your stomach cramps, please consult your doctor immediately:

  • Blood in the stool (red).
  • Blackish stool (melena).
  • Progressive weight loss.
  • Persistent/recurrent vomiting.
  • Intolerable pain or sudden onset of severe stomach cramps.
  • Chest pain, fainting attacks.


How to get rid of stomach cramps and gas Fast?

If you’re looking for swift relief from stomach cramps and gas, there are a few home remedies you can try:

  • Over-the-counter solutions: Products like simethicone can help break down gas bubbles, while antacids can neutralize stomach acid and lessen cramps.
  • Warmth: A hot water bottle or heating pad on your abdomen can relax your muscles and ease cramping.
  • Hydration: Staying well-hydrated can help food move through your digestive system, reducing constipation.
  • Physical activity: A bit of exercise can stimulate your gastrointestinal tract muscles, helping to move gas through and alleviate discomfort.
  • Dietary tweaks: Steering clear of foods that cause gas, such as beans, lentils, broccoli, onions, and fizzy drinks, can help prevent future discomfort.

What are the best positions to relieve stomach gas?

Certain positions can help to relieve gas and the discomfort it causes:

  • Knee-to-chest pose: Lying on your back and bringing your knees up towards your chest can help to expel trapped gas.
  • Child’s pose: This yoga position, where you kneel and then bend forward with your arms stretched out in front, can also help to relieve gas.
  • Walking or moving around: Physical activity can help to move gas through your digestive system.

What causes excessive gas and stomach pain in early pregnancy?

During early pregnancy, hormonal changes can slow your digestive system, increasing gas and bloating. Additionally, the growing uterus can pressure your abdominal cavity, contributing to gas pain.

What causes stomach cramps and gas without diarrhea?

Stomach cramps and gas without diarrhea can be caused by various conditions, including:

    • Irritable Bowel Syndrome (IBS): This condition can cause cramping, bloating, and gas, even without diarrhea.
    • Food intolerances: Certain food intolerances can cause gas and cramping without necessarily causing diarrhea.
    • Gastroesophageal Reflux Disease (GERD): This condition can cause stomach discomfort and gas due to acid reflux.
    • Gastroparesis: This condition slows or stops food movement from your stomach to your small intestine, leading to gas and cramping.
    • Peptic ulcers: These sores on the lining of your stomach or small intestine can cause abdominal pain and gas.