An upset stomach can come from dozens of different sources, but most cases trace back to a handful of common triggers: something you ate, a viral or bacterial infection, stress, medication side effects, or an underlying digestive condition. Figuring out which one is behind your discomfort usually comes down to how fast symptoms appeared, how long they last, and whether they keep coming back.
Viral and Bacterial Infections
Infections are one of the most frequent causes of sudden stomach upset. Norovirus is the most common culprit worldwide for foodborne illness, affecting both children and adults. Rotavirus is the leading cause of viral stomach illness in children specifically. Symptoms from viral gastroenteritis typically show up one to three days after exposure and last a day or two, though they can occasionally drag on for up to 14 days.
Bacterial infections from contaminated food work on a different timeline depending on the organism involved. Staphylococcus aureus toxins act fast, causing nausea, cramping, and vomiting within one to six hours of eating contaminated food. Salmonella takes longer, with symptoms appearing 6 to 48 hours after exposure. E. coli infections develop over one to eight days depending on the strain. If your stomach upset hit within a few hours of a meal, a bacterial toxin is a likely suspect. If it took a day or more, a virus or a different type of bacteria is more probable.
Foods and Eating Habits
What you eat and how you eat it both matter. Fatty, greasy, or heavily spiced foods are classic triggers for nausea and stomach discomfort because they take longer to digest and increase acid production. Chocolate, coffee, alcohol, mint, garlic, and onions can all relax the valve between your esophagus and stomach, allowing acid to creep upward and cause that burning, unsettled feeling.
Eating too fast is a surprisingly common cause of bloating and stomach pain. When you rush through a meal or talk while chewing, you swallow excess air. That extra air builds up in your digestive tract, leading to bloating, gas pain, and a general feeling of fullness or discomfort. Slowing down and fully swallowing one bite before taking the next can make a noticeable difference.
Food Intolerances vs. Food Allergies
These two get confused often, but they work very differently in your body. A food intolerance, like lactose intolerance, affects only the digestive system. Your body lacks the enzyme needed to break down a specific component of food, so it ferments in your gut and causes gas, bloating, cramping, or diarrhea. With an intolerance, you can often eat small amounts of the problem food without much trouble.
A true food allergy involves the immune system and is a different situation entirely. Even tiny amounts of the trigger food can set off symptoms that go well beyond the stomach, including hives, swelling, and in severe cases, life-threatening reactions. If your stomach problems consistently appear after eating a specific food but stay limited to digestive symptoms, an intolerance is the more likely explanation.
Stress and Anxiety
Your gut has its own extensive network of nerve cells, sometimes called the “second brain,” and it responds directly to emotional stress. When you’re anxious or under chronic pressure, your body shifts signaling chemicals in the gut. Stress increases levels of certain neurotransmitters in the colon that slow down normal movement through the digestive tract. That slowdown can cause cramping, bloating, nausea, or a feeling of heaviness in your stomach.
This connection runs both directions. Gut distress can amplify anxiety, and anxiety can worsen gut symptoms, creating a cycle that’s hard to break without addressing both sides. If your stomach problems reliably show up during stressful periods, before presentations, or during emotional conflict, the gut-brain connection is likely playing a significant role.
Medications That Irritate the Stomach
Many common medications list stomach upset as a side effect. Antibiotics are among the worst offenders because they disrupt the balance of bacteria in your gut while fighting infection. Prolonged antibiotic use can also open the door to secondary infections that cause persistent diarrhea. Other drug classes known to cause gastrointestinal distress include antacids containing magnesium, cancer treatment drugs, heart medications like digoxin, and laxatives when overused.
Over-the-counter pain relievers like aspirin and ibuprofen deserve special attention. Beyond directly irritating the stomach lining, they can also relax the valve at the top of your stomach and contribute to acid reflux. If your stomach problems started around the same time as a new medication, that timing is worth noting.
Acid Reflux and GERD
Acid reflux happens when the muscular valve at the bottom of your esophagus relaxes when it shouldn’t, letting stomach acid flow upward. Occasional reflux is normal, but when it becomes frequent, it’s classified as gastroesophageal reflux disease. The result is a burning feeling in the upper stomach or chest, nausea, and sometimes a sour taste in the mouth.
Several things can weaken or relax that valve. Lying down after a large meal is a common trigger. Tobacco smoke, whether firsthand or secondhand, relaxes it. Pregnancy hormones do the same, which is why heartburn is so common during pregnancy. Certain blood pressure medications, sedatives, some antidepressants, and even asthma medications can also have this effect.
Irritable Bowel Syndrome
If your stomach problems keep returning over months without a clear food or infection trigger, irritable bowel syndrome is one possibility. IBS is diagnosed when someone has recurring abdominal pain at least one day per week for three months, and that pain is connected to bowel movements or changes in stool frequency or consistency. Symptoms need to have been present for at least six months before a diagnosis is made.
IBS doesn’t cause visible damage to the digestive tract, which is part of what makes it frustrating. It’s a disorder of how the gut functions, not a structural problem. Stress, certain foods, and hormonal changes can all trigger flare-ups, and the pattern varies widely from person to person.
When Stomach Pain Needs Urgent Attention
Most upset stomachs resolve on their own, but certain patterns point to something more serious. Pain that’s severe enough to interfere with your ability to function, vomiting so persistent you can’t keep liquids down, or complete inability to have a bowel movement paired with worsening pain all warrant an emergency room visit.
Appendicitis has a distinctive pattern: pain that begins near the belly button, then shifts lower and to the right, worsening over hours. It often comes with loss of appetite, fever, nausea, and pain that gets worse when you move, cough, or take deep breaths. Acute pancreatitis typically starts as mild upper abdominal pain that worsens after eating and can escalate to severe, constant pain with nausea, fever, and a rapid pulse. If your abdominal pain feels different from anything you’ve experienced before, or if a familiar pain is suddenly more intense, that change in pattern is itself a reason to seek care.