What Causes Stomach Pain and When to Worry

Stomach pain has dozens of possible causes, ranging from something as simple as trapped gas to conditions that need urgent medical attention. The location, timing, and quality of the pain all offer clues about what’s going on. Most episodes are temporary and tied to digestion, but persistent or severe pain points to something worth investigating.

Where It Hurts Narrows the Cause

Your abdomen contains many organs packed into a relatively small space, and pain in different areas maps loosely to different problems. Upper right pain, just below the ribs, often involves the gallbladder or liver. Gallbladder pain typically flares after eating, especially fatty meals, and can come with nausea. Upper left pain may involve the stomach itself, the pancreas, or the spleen. Lower right pain is the classic location for appendicitis, while lower left pain is more commonly linked to issues with the colon, such as diverticulitis or constipation.

Pain that’s hard to pinpoint, sitting vaguely in the middle of your abdomen, is often coming from the organs themselves. Internal organs don’t have the same precise nerve wiring as your skin, so pain signals from the gut tend to feel dull, deep, and spread out rather than sharp and localized. This is why early appendicitis often starts as a general ache around the belly button before migrating to the lower right as inflammation reaches the abdominal wall, where nerve endings can better identify the source.

The Most Common Everyday Causes

For most people searching this question, the pain is uncomfortable but not dangerous. The most frequent culprits include indigestion, gas, constipation, mild food reactions, and stomach bugs. These tend to come on after eating, resolve within hours to a couple of days, and don’t come with alarming symptoms like fever or bloody stool.

Certain foods are particularly good at producing pain and bloating. A group of carbohydrates found in foods like onions, garlic, wheat, beans, and some fruits are poorly absorbed in the small intestine. They travel slowly, drawing extra water into the gut as they go. When they reach the large intestine, bacteria ferment them and produce gas. The combination of extra water and gas stretches the intestinal wall. For most people this causes mild bloating at worst, but for those with a sensitive gut, the stretching triggers exaggerated pain signals.

Stress is another common trigger that people often underestimate. The gut has its own extensive nervous system, and it communicates constantly with the brain. Anxiety and emotional stress can directly alter how fast your intestines contract and how sensitive they are to normal sensations like stretching or movement. This is one reason stomach pain often flares during stressful periods even when nothing has changed in your diet.

Infections and Ulcers

A bacterium called H. pylori infects the stomach lining of a significant portion of the world’s population, often without causing any symptoms at all. In some people, though, it damages the protective mucus layer that shields the stomach from its own acid. Once that barrier breaks down, acid can create an open sore (an ulcer) in the stomach or the first part of the small intestine. Ulcer pain typically feels like a burning or gnawing ache in the upper abdomen, and it often gets worse when the stomach is empty, which is why some people notice it most between meals or in the middle of the night.

Stomach infections from viruses or contaminated food are another frequent cause. These usually bring on cramping, nausea, vomiting, or diarrhea that peaks within a day or two and clears up on its own. Bacterial food poisoning tends to hit harder and faster, sometimes within hours of eating the contaminated food.

IBS and Inflammatory Bowel Disease

Irritable bowel syndrome is one of the most common causes of recurring stomach pain. It’s a functional disorder, meaning the gut looks perfectly normal on scans and scopes but doesn’t work the way it should. The muscle contractions that move food through the intestines become irregular, and the nerve endings lining the bowel are unusually sensitive to normal stimuli like gas and stretching. IBS is diagnosed based on a pattern: abdominal pain linked to bowel movements, along with changes in how often you go or what your stool looks like, recurring over at least 12 weeks.

Inflammatory bowel disease, which includes Crohn’s disease and ulcerative colitis, is a fundamentally different problem. IBD involves actual inflammation that damages the intestinal wall and is visible on imaging or during a colonoscopy. It can cause permanent harm to the intestines and raises the risk of colon cancer. IBS does neither. The distinction matters because the two conditions require very different treatment approaches, even though they can feel similar on a day-to-day basis.

Gallbladder and Pancreas Pain

Gallstones are extremely common, and many people carry them without ever knowing. Problems start when a stone blocks the duct that drains the gallbladder. This produces a distinctive pain pattern: an ache under the right rib cage that often comes on after eating, builds in waves as the gallbladder contracts and relaxes against the blockage, and can last anywhere from 20 minutes to several hours. Gallbladder disease is the most common reason for abdominal surgery in adults over 55, accounting for roughly a third of emergency department visits for acute abdominal pain in that age group.

If a gallstone travels further and blocks the duct shared with the pancreas, it can trigger pancreatitis. Pancreatic pain is severe, typically felt on the upper left side, and can radiate to the back, chest, or shoulder. It often feels sharp or like a squeezing sensation, and eating makes it worse because digestion signals the pancreas to release more enzymes, increasing pressure behind the blockage.

How Age Changes the Picture

In children and younger adults, stomach pain is most often caused by viral infections, constipation, food intolerances, stress, or functional disorders like IBS. Appendicitis peaks in the teens and twenties.

In older adults, the landscape shifts. Diverticulitis, where small pouches in the colon wall become inflamed, becomes increasingly common with age. About two thirds of people over 90 have some degree of diverticular disease, compared to roughly 5 percent of the general population. Bowel obstructions from scar tissue (often from prior surgeries) or tumors are more frequent. Peptic ulcer disease accounts for about 16 percent of abdominal pain complaints in older patients. And reduced blood flow to the intestines, a condition called mesenteric ischemia, becomes a risk as atherosclerosis builds up in the arteries feeding the gut, particularly in smokers.

Older adults also tend to present with subtler symptoms. Pain may be less intense even when the underlying condition is serious, which is one reason complications and mortality rates are higher in this group. Pancreatitis, for example, carries a mortality rate of 20 to 25 percent in older patients compared to 8 to 10 percent overall.

Signs That Need Prompt Attention

Most stomach pain isn’t an emergency, but certain combinations of symptoms suggest something more serious is happening. Pain accompanied by a persistent fever, vomiting that won’t stop, blood in your stool or vomit, visible swelling and tenderness in the belly, or yellowing of the skin and eyes all warrant medical evaluation sooner rather than later. The same applies to pain that is sudden and severe, pain that gets worse with physical activity, or pain that follows an injury. Shortness of breath alongside abdominal pain can indicate a problem above the diaphragm, like a heart issue, presenting in an unusual way.

Unexplained pain that lingers for more than a few days, keeps coming back in the same pattern, or gradually worsens over time is also worth investigating. Many serious conditions are highly treatable when caught early, and a clear diagnosis often brings relief just from knowing what you’re dealing with.