What Causes an Upset Stomach and When to Worry

An upset stomach can be triggered by dozens of different things, from something you ate an hour ago to stress you’ve been carrying all week. Chronic indigestion affects 10% to 30% of people worldwide, making it one of the most common reasons people search for health answers. The cause is usually temporary and harmless, but understanding what’s behind the discomfort helps you figure out whether it will pass on its own or needs attention.

Foods and Drinks That Irritate Your Gut

Diet is the most common and most fixable cause of stomach upset. Several types of food trigger discomfort through specific, well-understood mechanisms.

Fatty and fried foods are a frequent culprit. When your body can’t fully absorb fat early in digestion, undigested fat reaches the colon, where it gets broken down into fatty acids. Those acids cause your colon to secrete extra fluid, leading to cramping, nausea, and loose stools. Spicy foods containing capsaicin can irritate the lining of your stomach and intestines directly, producing a burning sensation that sometimes persists all the way through your digestive tract.

Dairy products cause trouble for people who don’t produce enough of the enzyme that breaks down lactose, the natural sugar in milk. The undigested lactose ferments in your gut, producing gas, bloating, and sometimes diarrhea. Caffeine speeds up your entire digestive system, which can mean cramping and urgency, especially on an empty stomach.

Sugar and artificial sweeteners deserve special mention. Sugars stimulate your gut to release water and electrolytes, which loosens bowel movements. Fructose is particularly problematic: people who consume more than 40 to 80 grams per day often develop diarrhea. Sugar alcohols found in “sugar-free” gum and candy (sorbitol, mannitol, xylitol) are poorly digested and ferment in the gut, causing bloating, gas, and stomach pain.

Gluten triggers stomach upset in people with celiac disease or gluten sensitivity. In celiac disease, gluten provokes an immune attack on the lining of the small intestine, which can cause serious long-term damage. People with non-celiac gluten sensitivity experience similar digestive symptoms without the intestinal damage.

Viral and Bacterial Infections

Gastroenteritis, often called the “stomach flu,” is one of the most common causes of sudden, intense stomach upset. Symptoms typically appear within one to three days of infection and can range from mild nausea to severe vomiting and diarrhea. Most episodes resolve in a day or two, though some last up to 14 days.

Norovirus is the most common cause of foodborne illness worldwide, affecting both children and adults. It spreads rapidly through contaminated food, water, and surfaces. Rotavirus is the leading cause of viral gastroenteritis in young children, who typically pick it up by putting contaminated fingers or objects in their mouths. Bacterial infections from contaminated food (Salmonella, E. coli, Campylobacter) tend to cause more severe symptoms and can take longer to clear.

Stress and the Gut-Brain Connection

Your brain and your gut are in constant two-way communication. Psychological stress, anxiety, and depression can directly alter how your digestive system moves and contracts. This isn’t imaginary or “all in your head.” Stress hormones physically change gut function: they can speed up or slow down the movement of food through your intestines, increase acid production, and heighten the sensitivity of nerve endings in your digestive tract. Even the thought of eating can release stomach acid before any food arrives.

This is why you might feel nauseated before a job interview, get stomach cramps during a stressful week, or notice your digestion gets worse during periods of anxiety. For some people, this stress-gut cycle becomes chronic and contributes to conditions like irritable bowel syndrome.

Medications That Upset the Stomach

Many common medications list stomach upset as a side effect. Pain relievers like ibuprofen and aspirin (NSAIDs) are among the most well-known offenders. They work by blocking chemicals that cause inflammation, but those same chemicals help protect your stomach lining. Without that protection, stomach acid can irritate the tissue directly, causing pain, nausea, and in some cases ulcers.

Antibiotics frequently cause digestive problems because they don’t only kill the bacteria causing your infection. They also disrupt the balance of helpful bacteria in your gut, which can lead to nausea, cramping, and diarrhea. In some cases, antibiotic use allows a harmful bacterium called C. difficile to take over, causing more severe and persistent diarrhea. Iron supplements, magnesium-containing antacids, and several other medication classes are also commonly responsible for stomach irritation.

Chronic Conditions Behind Ongoing Symptoms

When stomach upset keeps coming back or never fully goes away, an underlying condition may be involved.

Irritable bowel syndrome (IBS) is a functional disorder, meaning the digestive tract looks structurally normal but doesn’t work the way it should. The muscles that move food through your intestines contract too quickly (causing diarrhea) or too slowly (causing constipation). On top of that, the nerve endings in the digestive tract become oversensitive. Small bubbles of gas that wouldn’t bother most people can be genuinely painful. Common symptoms include belly pain and cramping related to bowel movements, bloating, and a feeling of incomplete evacuation.

Gastroesophageal reflux disease (GERD) occurs when stomach acid repeatedly flows back into the tube connecting your mouth and stomach. This causes a burning sensation in the chest and upper abdomen, often worse after meals or when lying down. Over time, the acid can damage the lining of the esophagus.

H. pylori infection is a bacterial infection that damages the protective lining of the stomach and small intestine. Once that lining is compromised, stomach acid can create open sores called ulcers. About 10% to 15% of people infected with H. pylori eventually develop an ulcer. Many people carry the bacteria without symptoms, but when symptoms do appear, they include a gnawing or burning pain in the upper abdomen, nausea, and bloating.

Functional dyspepsia is the medical term for chronic indigestion that has no identifiable structural cause. You feel pain or discomfort in the upper stomach repeatedly, but tests come back normal. It affects a significant portion of the population and is thought to involve a combination of gut sensitivity, motility problems, and psychological factors.

Warning Signs That Need Urgent Attention

Most stomach upset resolves on its own. But certain patterns signal something more serious. If abdominal pain is sudden, severe, and doesn’t ease within 30 minutes, that warrants emergency care. The same applies to continuous, severe pain accompanied by persistent vomiting. Sudden abdominal pain is often an indicator of serious conditions like a perforated ulcer or other intra-abdominal emergencies.

Other red flags include vomiting blood or material that looks like coffee grounds, black or tarry stools (which suggest bleeding in the digestive tract), unexplained weight loss, difficulty swallowing, and pain that wakes you from sleep. Any of these symptoms alongside an upset stomach suggest something beyond routine indigestion.

Narrowing Down Your Trigger

Because so many things cause stomach upset, identifying your specific trigger takes some detective work. Timing is your best clue. Symptoms within a few hours of eating point toward food triggers. Symptoms that appear one to three days after exposure to someone who was sick suggest an infection. Upset that worsens during stressful periods but improves on weekends or vacations points to the gut-brain connection. Symptoms that started or worsened after beginning a new medication make that drug the likely cause.

A food diary can be surprisingly revealing. Track what you eat and when symptoms appear for two to three weeks, and patterns often become obvious. If symptoms are chronic, recurring, or accompanied by any of the warning signs above, that’s a signal to get evaluated rather than continuing to troubleshoot on your own.