The most likely reason your stomach hurts and you have diarrhea is gastroenteritis, a short-lived infection of the digestive tract caused by a virus, bacterium, or parasite. Viral gastroenteritis is by far the most common type, with norovirus alone causing roughly 2,500 reported outbreaks in the United States each year and ranking as the leading cause of vomiting, diarrhea, and foodborne illness nationwide. But infections aren’t the only explanation. Food intolerances, stress, medications, and chronic digestive conditions can all produce the same pair of symptoms.
Viral Stomach Infections
Norovirus and rotavirus are the two most frequent culprits. They spread easily through contaminated food, water, and surfaces, or through close contact with someone who’s already sick. Symptoms typically hit fast: watery diarrhea, crampy abdominal pain, nausea, and sometimes vomiting and a low-grade fever. Most cases resolve on their own within one to three days, though you may feel drained for a few days after that.
Because it’s a virus, antibiotics won’t help. The main risk is dehydration, especially if you’re also vomiting. Small, frequent sips of water, broth, or an oral rehydration solution (a mix of water, a small amount of salt, and sugar) are the most effective way to replace what you’re losing. If you can’t keep fluids down for more than a few hours, that’s a sign you need medical attention.
Food Poisoning
Food poisoning overlaps heavily with viral gastroenteritis, and the two can feel identical. The difference is usually the source: contaminated or improperly stored food introduces bacteria or their toxins directly into your gut. How quickly you get sick depends on the specific organism involved.
- Staph toxins act fastest, triggering nausea, vomiting, cramps, and diarrhea within 30 minutes to 8 hours of eating contaminated food.
- Salmonella takes longer, with diarrhea (sometimes bloody), fever, and stomach cramps appearing 6 hours to 6 days after exposure.
- E. coli has the slowest onset at 3 to 4 days, but often causes severe stomach cramps and diarrhea that can turn bloody.
If your symptoms started shortly after a particular meal, or someone who ate the same food is also sick, food poisoning is the likely answer. Most bacterial food poisoning clears within a few days with rest and fluids, but bloody diarrhea, a high fever, or symptoms lasting more than two days warrant a call to your doctor.
Food Intolerances and Reactions
If stomach pain and diarrhea show up repeatedly after eating certain foods, an intolerance is worth considering. Lactose intolerance is the most common example. Your small intestine doesn’t produce enough of the enzyme needed to break down the sugar in dairy, so undigested lactose pulls water into the gut and gets fermented by bacteria, causing bloating, cramps, gas, and diarrhea. Symptoms usually start 30 minutes to two hours after consuming milk, cheese, or ice cream.
Interestingly, a stomach virus can temporarily cause lactose intolerance even if you’ve never had it before. The infection damages the lining of your small intestine, reducing enzyme production for weeks or sometimes months. If dairy seems to bother you after a recent bout of gastroenteritis, this secondary intolerance is likely the reason. It usually resolves as the intestinal lining heals.
Gluten, fructose, and artificial sweeteners (especially sugar alcohols like sorbitol and xylitol) are other common triggers. Paying attention to which foods precede your symptoms is the simplest way to start narrowing it down.
Stress and the Gut-Brain Connection
Anxiety, acute stress, and emotional distress can directly affect how your digestive system moves and contracts. The gut and brain communicate constantly through a network of nerves, and when your body enters a stress response, digestion can speed up dramatically. The result is cramping, urgency, and loose stools, sometimes seemingly out of nowhere. If your symptoms tend to flare around deadlines, conflict, or periods of high anxiety, this connection is probably playing a role.
Irritable Bowel Syndrome (IBS)
IBS is worth considering if your symptoms keep coming back over months rather than days. It’s classified as a functional disorder, meaning the gut doesn’t work the way it should but there’s no visible damage or inflammation. Diagnosis requires a specific pattern: recurrent abdominal pain at least one day per week for the past three months, with symptoms first appearing at least six months earlier. The pain needs to be connected to at least two of the following: going to the bathroom, a change in how often you go, or a change in the consistency of your stool.
IBS comes in subtypes. IBS-D (diarrhea-predominant) causes frequent loose stools along with cramping and bloating. IBS-C involves constipation instead, and IBS-M alternates between the two. The condition doesn’t cause structural damage to the intestines, which is what separates it from inflammatory bowel disease. Dietary changes, stress management, and certain medications can significantly reduce symptoms, but the first step is recognizing the pattern.
Inflammatory Bowel Disease
Crohn’s disease and ulcerative colitis are both forms of inflammatory bowel disease (IBD), and they do cause actual damage and inflammation in the digestive tract. This is a key distinction from IBS, which shares some surface-level symptoms but involves no inflammation. IBD tends to cause more severe symptoms: persistent diarrhea (often bloody), significant abdominal pain, weight loss, fatigue, and sometimes fever. Ulcerative colitis affects only the colon, while Crohn’s can involve any part of the digestive tract from the mouth to the rectum.
These conditions require a medical workup including blood tests and usually a colonoscopy. If you’re noticing blood in your stool, unexplained weight loss, or symptoms that have persisted for weeks and are getting worse rather than better, IBD is one of the things your doctor will want to rule out.
Medications That Cause Diarrhea
Antibiotics are the most common medication-related cause. They kill off beneficial gut bacteria alongside the targeted infection, disrupting the microbial balance in your intestines. This can cause cramping and watery diarrhea that starts during a course of antibiotics or shortly after finishing one. Magnesium-containing antacids, metformin (used for blood sugar management), and certain anti-inflammatory drugs can also trigger diarrhea. If your symptoms lined up with starting a new medication, that’s a strong clue.
Warning Signs That Need Prompt Attention
Most episodes of stomach pain and diarrhea resolve on their own within a day or two. But certain symptoms signal something more serious. Contact a doctor promptly if you notice any of the following:
- Diarrhea lasting more than two days
- High fever
- Six or more loose stools per day
- Blood, pus, or black tarry color in your stool
- Severe abdominal or rectal pain
- Signs of dehydration: extreme thirst, dark urine, dizziness, lightheadedness, or skin that stays tented when pinched
- Frequent vomiting that prevents you from keeping fluids down
For infants and young children, the thresholds are lower. Diarrhea lasting more than one day, any fever in infants, no wet diapers for three or more hours, or refusal to eat or drink all warrant immediate medical evaluation. Young children dehydrate faster and with less warning than adults.

