Stomach Cramps And Gas:8 Commonest Causes, Treatments (Oversimplified).


✅ Evidence-Based.

✅ By Dr. Farahat.

  • Almost everyone has experienced stomach cramps and gas at a certain time. 
  • The usual causes of stomach cramps and gas are simple, nondangerous.
  • You can manage and prevent them at home. 
  • But stomach cramps can be a sign of medical conditions that can be dangerous. 

Today, I’ll walk you through the common causes of stomach cramps and gas and how to deal with them.

Table summary for causes of Stomach cramps and gas. [Quick Overview]


Cause of stomach cramps and gasHow to suspect
1- Food and drinks causing cramps and gas.
  • Certain foods and drinks are gas-producing causing stomach cramps and gas
  • They include beans, dairy products, whole grains, certain vegetables (broccoli, cabbage, asparagus), and certain fruits. FOR THE COMPLETE LIST, READ BELOW.
  • Suspect if you find a pattern of pain and gas related to the ingestion of certain foods.
  • Avoid or minimize the amount of food causing you cramps and gas.
2- Irritable bowel syndrome (IBS)
  • IBS is a very common condition, affecting about 15% of the population.
  • It is underdiagnosed and may be the cause of your recurrent stomach cramps and gas.
  • Suspect IBS if you have prolonged cramps related to defecation, change in stool consistency and frequency.
3- Functional Dyspepsia (Indigestion)
  • Another common condition that affects 5 to 11% of the population.
  • Suspect if you have troublesome postprandial fullness, early satiety, or epigastric cramps. 
  • Your doctor has to rule out other medical conditions to be diagnosed with functional dyspepsia.
4- Gallbladder problems
  • Your gallbladder inflammation or stones can cause recurrent stomach cramps and gas.
  • Suspect if you have stomach cramps mainly in the upper right part of your abdomen.
  • The pain is usually more severe and associated with severe nausea, and maybe vomiting.
5- lactose intolerance
  • It is estimated that millions of us people have some sort of lactose intolerance.
  • Suspect if you experience gas, stomach cramps, and diarrhea every time you ingest dairy products such as milk, yogurt, and cheese.
6- stomach flu (Viral Gastroenteritis)
  • It is not a chronic infection, but acute onset cramps, diarrhea, gas, and maybe vomiting and fever.
  • The condition is usually self-limiting but older, younger ages and people with chronic illnesses have to see the doctor.
7- other food intolerances.
  • Some other types of food intolerances can cause stomach cramps and gas.
  • For example, FODMAPs, gluten can cause the same symptoms of lactose intolerance. 
RED SIGNS: emergency call your doctor
  • Reddish blood in the stool.
  • Blackish stool (Melena).
  • Progressive weight loss.
  • Persistent/recurrent vomiting.
  • Intolerable pain or sudden onset of severe stomach cramps.
  • Chest pain, fainting attacks.




1- Foods & drinks causing stomach cramps and gas:


Having gas and cramps doesn’t mean you have a disease.

Experiencing stomach cramps and gas doesn’t necessarily mean that you have a disease or medical condition.  Any excess gas may cause a stretch of your intestine wall causing stomach colics or cramps.

some foods get fermented by your gut bacteria. Foods are not the same, some of them produce gas more than others. 


Food may be the commonest reason why you are getting stomach cramps and gas.

Not only the food type But also the food amount.

worth mentioning, food TYPE is not the only factor causing stomach cramps and gas. Also, the AMOUNT you eat from that specific food may play a role.

So, eating a small amount of gas-producing food, may not cause you a problem. but, eating a larger amount of the same food may be the cause of gas cramps.

Symptoms: How to know if food is the cause of your stomach cramps and gas:

  • gas and stomach cramps start after eating certain foods or drinks.
  • Cutting these foods improves your condition.

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 completely stop eating these foods. 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.

MORE: Why Do You Have So Much Gas All The Time?

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 are 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 3 months (with symptom onset from at least 6 months):
  • The onset stomach cramps have to be associated with at least 2 of:
    • Defecation: defecation may improve your abdominal pain (with a smaller number of 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.



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 have to 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, move after eating.
  • Take over-the-counter medications for stomach cramps and gas (see our resources page for best recommendations).
  • More tips about IBS pain relief here


3- Functional dyspepsia (indigestion).

Another common cause of gas and stomach discomfort is functional dyspepsia. Functional dyspepsia ranges from 5 to 11% worldwide (reference).

The main feature of functional dyspepsia is a sense of fulness after meals. It may be associated with stomach discomfort or mild cramps and gas sensation.

Symptoms (how to know if you have functional dyspepsia or indigestion):

According to ROME IV criteria for the diagnosis of functional gastrointestinal disorders, the functional dyspepsia diagnosis criteria are as follow:

1- You have one or more of the following:

  1. Bothersome postprandial fullness: bloating or sense of fullness every time you eat. Especially after fatty meals.
  2. Bothersome early satiation: you quit eating early because you feel full too early.
  3. Bothersome epigastric pain: stomach cramps or discomfort in the upper part of your abdomen.
  4. Bothersome epigastric burning


2- No evidence of structural disease (including at upper endoscopy): for a complete diagnosis of indigestion or functional dyspepsia, you have to see your doctor. As your doctor has to do some investigations like H. Pylori testing,  barium x-ray, or an upper endoscopy. 

This is necessary to exclude other causes of upper stomach cramps like peptic ulcers or GERD (Gastro-oesophageal reflux disease).

Read more about functional dyspepsia

How to deal if you have functional dyspepsia:

  • Consult your doctor if you suspect you have functional dyspepsia (you cannot self-diagnose such a condition). 
  • If you have already been diagnosed with functional dyspepsia, you can try:
    • Eat small frequent meals instead of single large meals
    • Avoid carbonated and caffeinated drinks, heavy fatty meals.
    • Stay away from stress and anxiety
    • Consult your doctor about using medications that improve FD as proton pump inhibitors and pain medications.

MORE: Constant Indigestion and Gas: 8 Causes Explained.

4- Gallbladder problems (cholecystitis, gallstones).

The gall bladder is a small organ that is attached to your liver. It is connected to your intestine through a duct called (the bile duct). 

It commonly gets inflamed with or without the formation of gallbladder stones. Inflammation of the gallbladder may be the cause of your stomach cramps and gas.

Symptoms (how to suspect):

The gallbladder can be inflamed acutely with severe symptoms including severe stomach cramps in the right upper quadrant of your abdomen. The stomach cramps are usually very severe (Biliary colic) associated with nausea (especially after meals) and maybe vomiting or fever.

Gallbladder stones may cause no symptoms or cause mild symptoms like 

  • Mild stomach cramps (mainly in the upper right part of your abdomen)
  • Gas or bloating.
  • Mild nausea after eating.

Gallstones may also cause severe acute cholecystitis. With fever, intense stomach cramps, gas, nausea, and vomiting.

How to deal?

  • If you suspect having gallbladder problems: consult your doctor, it is usually diagnosed by abdominal ultrasound.
  • Gallstones usually need surgical intervention and removal of your gallbladder with its stones.
  • Avoid fatty meals and large meals.
  • Eat small frequent meals.
  • Some medications can help such as ibuprofen for the biliary pain, and Ursodeoxycholic acid to decrease inflammation and decrease stone size.

5- lactose intolerance:

Lactose intolerance is another common cause of gas and stomach cramps. It is estimated that millions of people in the US have some degree of lactose intolerance. It is common in  African-Americans, Latinos, Asians, and American Indians.

Symptoms (how to suspect?).

  • It is related to the ingestion of dairy products. (milk, ice cream, yogurt, and cheese). 
  • Besides the gas and cramps, you may experience diarrhea attacks every time you take any of lactose-containing foods.

Learn more about lactose intolerance here.

How to deal: 

  • Avoid lactose-containing foods like dairy products.
  • Lactase enzyme supplements may help.
  • Probiotics and regular lactose exposure can also ease symptoms.
  • Always discuss the issue with your own doctor for the best options.

6- Infection or gastro-enteritis. (stomach flu).

It 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.

Symptoms (how to suspect stomach flu)

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

stomach flue causes cramps and gas

How to deal:

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

Learn more about stomach flu here

7- Food intolerance.

Food intolerance is a very common condition more than you think. Approximately 15-20% of the population has some sort of food intolerance (reference). The main symptoms are diarrhea, stomach cramps, and gas. In severe cases, food intolerance can cause headaches or migraines, rashes, and anemia.

Common foods causing intolerance:

  • Lactose (discussed above).
  • FODMAPs (short-chain highly fermentable carbohydrates).
  • Gluten (in wheat and barley).
  • Caffeine.
  • Histamine is present in cured food, mushrooms, and pickles (weak evidence).
  • Food additives such as artificial sweeteners, flavorings.

Symptoms (when to suspect):

  • The onset of symptoms (Diarrhea, stomach cramps, and gas) occurs several hours after ingesting the offending food.
  • Symptoms continue for several hours or days.
  • It is difficult to suspect food intolerance because onset can occur late after eating. Also, many people are intolerant to more than one group of foods
  • The presence of some symptoms outside your intestine may augment the presence of food intolerance: Migraines, headaches, cough, hives, runny nose.

Discuss the issue with your doctor if you suspect the presence of food intolerance.

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

The above 7 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.

They include (but are not limited to):

  • Intestinal obstruction.
  • Gastric outlet obstruction.
  • Diverticulitis. 
  • Inflammatory Bowel Disease (Crohn’s and ulcerative colitis).
  • Small Intestinal Bacterial Overgrowth (SIBO).
  • 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.

A final thought:

The internet is not for practicing medicine or getting treatment. This can be hazardous to your health, use this article for informational purposes only. If you find any of the red signs together with your stomach cramps and gas, please contact your doctor immediately. #Stay_Safe.

yellow stool with IBS
Dr. I. Farahat

IBS Yellow Stools: Is It A Normal Or A Bad Sign?

The most common causes of IBS yellow stools are yellow foods, IBS-diarrhea flare-ups, gastroenteritis, and stress. Other less common causes such as liver, pancreas, and gallbladder disease can result in a yellow stool with IBS.

Read More »
Sharp upper stomach pain
Abdominal Pain
Dr. I. Farahat

Sharp Pain In The Upper Stomach: 8 causes & How To Differentiate.

Sharp pain in the upper stomach pain can originate from organs inside your abdomen or your chest. the most common cause of sharp upper stomach pain is gastritis and peptic ulcer disease. The most dangerous cause is heart attacks. always consult your doctor if you have sharp intolerable pain.

Read More »