What Causes Your Stomach to Hurt and When to Worry

Stomach pain has dozens of possible causes, ranging from something as simple as trapped gas to conditions that need medical attention like appendicitis or gallstones. Most of the time, the culprit is one of a handful of common issues: indigestion, muscle strain in the abdominal wall, a viral stomach bug, constipation, or a food that didn’t agree with you. Where the pain is, how long it lasts, and what other symptoms come with it are the biggest clues to what’s going on.

Where the Pain Is Matters

Your abdomen holds a lot of organs packed into a relatively small space, and different areas of pain point toward different problems. Pain in the upper right side often traces back to the gallbladder or liver, including gallstones or inflammation of the gallbladder. Upper left pain is less common but can signal problems with the spleen or stomach itself. Lower right pain is the classic location for appendicitis, while lower left pain is more associated with diverticulitis (inflamed pouches in the colon wall), kidney stones, or, in women, ovarian cysts.

Pain that’s spread across the whole abdomen rather than pinpointed to one spot is more typical of a stomach virus, gas, indigestion, or constipation. If you can point to the pain with one finger, that’s generally more diagnostically useful than a vague ache that covers everything.

The Most Common Everyday Causes

Gas and bloating are probably the single most frequent reason for short-lived stomach pain. When bacteria in your large intestine ferment undigested carbohydrates, the gas they produce stretches the intestinal wall and causes cramping. This is especially common after eating beans, cruciferous vegetables, or carbonated drinks.

Constipation is another extremely common cause, particularly in children. When stool sits in the colon too long, it hardens and distends the intestinal walls, producing dull, crampy pain that’s often worse in the lower left abdomen. In severe cases, hardened stool can become completely impacted and impossible to pass without intervention.

Viral gastroenteritis, the classic “stomach bug,” causes nausea, vomiting, diarrhea, and cramping that usually resolves within one to three days. It’s the most common reason for sudden-onset stomach pain that comes with other symptoms.

Acid-Related Problems

Your stomach lining is coated with a protective layer of mucus that shields it from the hydrochloric acid your stomach produces to break down food. When that protective barrier weakens or the amount of acid increases, the acid itself starts irritating the tissue underneath, causing a burning or gnawing pain in the upper abdomen. This is the basic mechanism behind both gastritis (inflammation of the stomach lining) and peptic ulcers (open sores in the stomach or the first section of the small intestine).

Two things most commonly disrupt this balance. The first is a bacterium called H. pylori, which burrows into the mucus layer and triggers inflammation. Many people carry H. pylori without symptoms, but in some, it gradually damages the lining enough to cause pain. The second major cause is regular use of common over-the-counter pain relievers like ibuprofen (Advil, Motrin) and naproxen (Aleve). These medications reduce the mucus your stomach produces, leaving the lining exposed to acid. Occasional use is rarely a problem, but daily or frequent use over weeks or months significantly raises the risk of developing an ulcer.

Acid reflux, or GERD, produces a burning sensation higher up, often behind the breastbone, when stomach acid flows backward into the esophagus. Many people describe this as stomach pain even though the discomfort is technically in the chest or upper abdomen.

Food Intolerances

If your stomach consistently hurts after eating certain foods, a food intolerance is a likely explanation. Unlike a food allergy (which involves the immune system and can cause hives, swelling, or anaphylaxis), a food intolerance happens when your digestive system can’t properly break down a specific component of food. The most common example is lactose intolerance: your body doesn’t produce enough of the enzyme needed to digest lactose, the sugar in milk and dairy products. The undigested lactose passes into the large intestine, where bacteria ferment it and produce gas, leading to bloating, cramping, and diarrhea.

Similar mechanisms are at work with fructose (found in fruit, honey, and many sweetened foods) and a group of fermentable carbohydrates often called FODMAPs, which are found in foods like garlic, onions, wheat, and certain fruits. If you notice a pattern between specific meals and stomach pain 30 minutes to a few hours later, keeping a food diary for a couple of weeks can help you identify the trigger.

IBS vs. Inflammatory Bowel Disease

Irritable bowel syndrome is one of the most common causes of chronic, recurring stomach pain. It’s diagnosed when someone has abdominal pain at least one day per week for three months, and the pain is linked to bowel movements, changes in how often they go, or changes in stool consistency. IBS is classified as a syndrome, not a disease, because it doesn’t cause visible damage to the intestines. If a doctor examines the colon of someone with IBS, it looks completely normal.

Inflammatory bowel disease, which includes Crohn’s disease and ulcerative colitis, is fundamentally different. IBD causes real, destructive inflammation that can be seen on imaging and during a colonoscopy. It can permanently damage the intestines and increases the risk of colon cancer. Warning signs that point toward IBD rather than IBS include blood in the stool, unexplained weight loss, anemia, and fever. IBS does not cause any of these symptoms.

Stomach Pain in Children

Kids get stomachaches frequently, and the causes skew differently than in adults. Constipation is the leading culprit in children, followed by stomach viruses, gas, and food intolerances. Young children may also experience abdominal migraines, which cause recurring episodes of belly pain, nausea, and sometimes vomiting without a headache. Anxiety and emotional stress are also well-established triggers for real stomach pain in children, particularly around school or social situations.

When a child complains of pain spread across the whole belly, it’s more likely to be gas, a virus, or constipation. Pain that localizes to one specific spot, especially the lower right, warrants closer attention.

Causes That Aren’t Digestive

Not all stomach pain starts in the digestive system. Kidney stones can cause severe pain in the flank or lower abdomen. Urinary tract infections often produce lower abdominal discomfort along with burning during urination. In women, ovarian cysts, endometriosis, and pelvic inflammatory disease are common causes of lower abdominal pain that can easily be mistaken for a gut problem. An ectopic pregnancy, where a fertilized egg implants outside the uterus, can cause sudden severe abdominal pain and is a medical emergency.

Even a pulled or strained abdominal muscle can mimic internal stomach pain, especially after heavy lifting or an intense workout. The key difference is that muscle pain typically gets worse with movement or when you tense your core, while internal pain doesn’t change much with body position.

Signs That Need Urgent Attention

Most stomachaches pass on their own, but certain features signal something more serious. A rigid or distended abdomen that feels hard to the touch, severe pain with guarding (where you instinctively tense up and can’t let anyone press on your belly), vomiting bile (green or yellow fluid), signs of gastrointestinal bleeding like vomiting blood or dark tarry stools, and fainting or dizziness with abdominal pain all warrant prompt evaluation.

Adults over 50 who develop new abdominal, flank, or back pain should be aware that an abdominal aortic aneurysm can present this way, particularly if there’s a significant difference in blood pressure between the two arms. Elderly patients with abdominal pain in general tend to have more serious underlying causes and vaguer symptoms, which makes timely evaluation especially important in this group.

Progressive pain that gradually worsens over weeks or months, rather than coming and going, can sometimes indicate conditions like Crohn’s disease, an enlarged spleen, or, less commonly, cancers of the stomach, liver, pancreas, or kidneys. Unintentional weight loss alongside worsening abdominal pain is a combination that always deserves medical investigation.