Skip to main content
Read about

Stomach Spasms

GERD is the main cause of stomach spasms, but they can also be caused by peptic ulcers, celiac disease, gluten intolerance, bacterial or viral gastroenteritis, or food poisoning. Treatments include GERD medications, avoiding certain foods, taking antacids, or surgery.
Tooltip Icon.
Last updated March 25, 2024

Personalized stomach spasms treatment

Get virtual care from a licensed clinician today

Get treated today

Care Plan


First steps to consider

  • If you have the most common causes of stomach spasms—heartburn or peptic ulcers—it can usually be treated with OTC antacids.
  • You should also try to avoid foods that make your symptoms worse, like greasy, spicy, high-fat foods, alcohol, and coffee.
Get stomach spasms treatment today

When you may need a provider

  • OTC medications are not making your stomach spasms better.
  • You have stomach spasms more often.
  • You are trying to avoid stomach spasms by not eating.
Get stomach spasms treatment today

Emergency Care

Arrow Icon.

Go to the ER if you have any of the following symptoms:

  • Sudden spasms with intense pain
  • You have stomach spasms and blood in your stool, fevers, chills, or yellowing of your skin and eyes.

Stomach spasms quiz

Take a quiz to find out if you have stomach spasms.

Take stomach spasms quiz

Stomach spasms occur in your mid to upper abdomen. The spasms can feel like twitching, flutters, or sharp pains. You may also have other gastrointestinal (GI) symptoms, such as diarrhea and vomiting.

Most causes of abdominal spasms aren’t emergencies. For example, you may have eaten a meal that didn’t agree with you, or you might experience stomach twitching and stomach flutters when you’re anxious or have heartburn.

But some causes of stomach spasms are serious and need to be treated as soon as possible. These include acute pancreatitis and gallbladder infections.

Depending on the cause, treatments range from taking antacid medication to needing surgery. Because many mild conditions that cause abdominal pain share common symptoms with more severe diseases, it’s important to see your doctor to get the correct diagnosis.

Most common symptoms

Stomach spasms occur in the upper middle region of the abdomen. They can be sudden and sharp, or chronic and cramping, and can occur with or without eating food.

Dr. Rx

It is important to know “red flag” symptoms that occur with the pain, such as blood in stool, weight loss, and having fevers/chills. If you are experiencing any of these symptoms along with the stomach spasms, you must be seen by a doctor instead of attempting home remedies. —Dr. Jonathan Xia

Main symptoms

  • Pain in your mid to upper abdomen, sharp and sudden or that comes and goes
  • Pain that radiates to your back or shoulder
  • Pain that worsens when you eat greasy and spicy food and food high in fat
  • Cramping
  • Stomach twitching
  • Stomach flutters
  • Burning sensation in your stomach and throat
  • Bloating

Other symptoms you may have

  • Fever
  • Chills
  • Nausea
  • Vomiting
  • Diarrhea
  • Feeling like food is getting stuck in your throat when you eat
  • Blood in stool
  • Black stools
  • Yellowing of the eyes and skin
  • Shortness of breath

Stomach spasms quiz

Take a quiz to find out if you have stomach spasms.

Take stomach spasms quiz


The most common cause of spasms is GERD, more commonly known as heartburn. Other causes include:

Sometimes the cause of stomach spasms can’t be identified. When that happens, you’re diagnosed with functional dyspepsia. People with functional dyspepsia usually experience pain that feels like stomach twitching or stomach flutters. The condition is more common in women and people with a history of anxiety or depression.

Pro Tip

The most common causes of stomach spasms are benign. However, it can still cause a severe amount of discomfort and interruption of daily life. Many of the symptoms can be fixed with over-the-counter antacids or avoiding food triggers. —Dr. Xia

Stomach spasms when lying down

Sometimes abdominal spasms are more intense when you lie down. This commonly affects people with heartburn. Symptoms such as burning and cramping in the middle abdomen, regurgitation, and even coughing can wake you up in the middle of the night. It usually occurs when you’ve eaten a large dinner or ate late at night.

Acute pancreatitis can also cause pain that worsens when you lie down. It may improve when you sit up or lean forward.

Sometimes the pain caused by gallstones or gallbladder disease feels worse when you lie down. This usually happens after you eat a big meal.

Risk factors

Common risk factors for stomach spasms include:

  • Obesity
  • Hiatal hernia
  • Eating large meals
  • Eating late at night
  • Eating fatty or greasy foods
  • Drinking alcohol or coffee
  • Taking medications such as naproxen or ibuprofen

Certain health conditions can also cause stomach spasms, such as:



If you’re diagnosed with heartburn or peptic ulcers, the most common treatments are antacids (such as Tums) or medications that decrease stomach acid production such as H2-blockers or proton-pump inhibitors.

If your doctor suspects an infection in your gallbladder, liver, or biliary ducts, you’ll likely need to be treated with IV antibiotics. People diagnosed with acute pancreatitis should also be hospitalized for several days to receive IV fluids and possibly IV antibiotics to ease the inflammation.

For those diagnosed with functional dyspepsia, antispasmodic medications such as dicycloverine and hyoscyamine are recommended. If you require long-term treatment, your doctor may prescribe tricyclic antidepressants to control the spasms.


If you have gallbladder disease, you may need to have surgery to remove your gallbladder.

Lifestyle changes

Stomach spasms caused by celiac disease or a gluten intolerance can be controlled by avoiding foods that contain gluten, such as bread, pasta, and cereal.

Ready to treat your stomach spasms?

We show you only the best treatments for your condition and symptoms—all vetted by our medical team. And when you’re not sure what’s wrong, Buoy can guide you in the right direction.See all treatment options
Illustration of two people discussing treatment.
See prices for Tums on Amazon

Stomach spasms quiz

Take a quiz to find out if you have stomach spasms.

Take stomach spasms quiz

Illustration of a healthcare provider asking questions on a smart phone.
Acid reflux treatment - Online visit
Get virtual care from a licensed clinician—no appointment needed
Illustration of a healthcare provider asking questions on a smart phone.
  • $29 one-time assessment
  • No video call or appointment necessary
  • Personalized treatment plan prescribed for your condition


Some conditions that cause stomach spasms can’t be prevented. But if you have heartburn, you can limit symptoms by:

  • Losing weight
  • Quitting smoking
  • Avoiding foods that are greasy, spicy, and high in fat
  • Limiting alcohol and coffee
  • Avoiding eating large meals late at night or near bedtime

Pro Tip

Sometimes, pain in that area can be due to organs not in the abdomen, so a thorough medical and surgical history is also important. —Dr. Xia

Next steps

See your doctor if your stomach spasms began gradually, are tolerable, and have lasted for a long time. You should also see your doctor if the pain is very mild and seems to be triggered by certain foods, drinks, or medications. They can help you identify what food and drinks you should avoid and suggest different medications that might be easier on your stomach.

Go to the ER if stomach spasms occur suddenly and are intolerable (even after taking over-the-counter medications like Pepto-Bismol or Imodium). Other concerning symptoms with intense stomach spasms include blood in your stool, fevers, chills, and yellowing of your skin and eyes.

Share your story
Once your story receives approval from our editors, it will exist on Buoy as a helpful resource for others who may experience something similar.
The stories shared below are not written by Buoy employees. Buoy does not endorse any of the information in these stories. Whenever you have questions or concerns about a medical condition, you should always contact your doctor or a healthcare provider.
Dr. Xia earned his undergraduate degree from Washington University in St. Louis, MO. He received his MD degree from the University of Texas Southwestern Medical Center and completed his residency at McGraw Medical Center of Northwestern University. Dr. Xia is currently completing his fellowship at Northwestern University Feinberg School of Medicine.

Was this article helpful?

124 people found this helpful
Tooltip Icon.
Read this next
Slide 1 of 4