What Causes Pain in Your Stomach and When to Worry

Stomach pain has dozens of possible causes, ranging from trapped gas and indigestion to infections, ulcers, and organ-specific problems like gallstones or appendicitis. Functional dyspepsia alone, the medical term for recurring upper-belly discomfort with no clear structural cause, affects more than 20% of the population. The key to narrowing down what’s behind your pain is paying attention to where it is, what it feels like, and what makes it better or worse.

Where the Pain Is Matters

Your abdomen houses more than a dozen organs packed into four rough quadrants, and the location of your pain is one of the strongest clues to its source. Upper-right pain, just below the ribs, points toward your gallbladder or liver. Gallstones are one of the most common culprits here, producing an ache that often flares after eating and may come with nausea. That pain can come and go as the gallbladder contracts and relaxes around a partial blockage. Liver-related conditions, including fatty liver disease, hepatitis, and toxic reactions to alcohol or medications, also concentrate in this area.

Upper-left or upper-center pain is more likely tied to your stomach itself or your pancreas. A stomach ulcer typically causes a burning, gnawing sensation that can feel like it’s boring straight through you. Pancreatic pain tends to be severe and squeezing, and it often radiates to the back, chest, or shoulder. Eating makes both worse, because activating your digestive system increases enzyme and acid production right where the problem is.

Lower-right pain deserves special attention because it’s the classic location for appendicitis. The pain usually starts vaguely near the belly button, then migrates lower and to the right over several hours, getting worse with movement, coughing, or deep breaths. Lower abdominal pain in women has additional possibilities: ovulation pain, ovarian cysts, endometriosis, and ectopic pregnancy can all produce sharp or cramping pain on one or both sides.

The Most Common Everyday Causes

For most people searching this question, the pain is uncomfortable but not an emergency. The likeliest explanations are the simplest ones.

Indigestion and acid reflux top the list. Burning pain in the upper abdomen after eating is one of the defining features of indigestion, and it’s usually related to stomach acid irritating the lining of the stomach or esophagus. Overeating, spicy or fatty foods, alcohol, and stress all make it worse.

Gas is another extremely common cause. Air trapped in the small or large intestine can produce surprisingly sharp, cramp-like pain that shifts location and eventually passes. Constipation creates a similar effect: backed-up stool stretches the intestinal walls, triggering dull, widespread discomfort that improves after a bowel movement.

Gastroenteritis, the “stomach bug,” causes pain alongside nausea, vomiting, or diarrhea. It’s usually viral, resolves on its own within a few days, and is often accompanied by a low fever.

How Pain Medications Can Cause Stomach Pain

Over-the-counter painkillers like ibuprofen, aspirin, and naproxen are a surprisingly frequent cause of stomach pain. These drugs work by blocking enzymes that produce inflammation throughout the body, but those same enzymes also maintain the stomach’s protective lining. When that protection drops, acid secretion increases while mucus production decreases. The result is that the stomach’s inner surface is exposed directly to acid and digestive enzymes, which can create erosions and ulcers even in people who’ve never had stomach problems before.

The damage isn’t always immediate. Some people take these medications for weeks before noticing a burning or gnawing sensation in the upper abdomen. If you use them regularly and develop new stomach pain, the medication itself is a likely contributor.

Ulcers and Bacterial Infections

Peptic ulcers are open sores on the lining of the stomach or the first section of the small intestine. They cause a burning, penetrating pain that’s often worse on an empty stomach and temporarily relieved by eating or taking antacids. The two main causes are long-term use of the pain medications described above and infection with a bacterium called H. pylori, which burrows into the stomach lining and weakens its defenses against acid. H. pylori infection is common enough that the American College of Gastroenterology updated its treatment guidelines as recently as 2024.

Food Intolerances and Gluten Reactions

If your stomach pain reliably follows meals, a food intolerance is worth considering. Lactose intolerance and gluten-related disorders are the most common. With gluten specifically, there’s an important distinction between two conditions. Celiac disease is an autoimmune reaction where eating gluten triggers the immune system to attack and damage the small intestine. It develops slowly, causes bloating, diarrhea, fatigue, weight loss, and anemia, and is diagnosed through blood tests that look for specific antibodies followed by a biopsy of the intestinal lining.

Gluten intolerance (sometimes called non-celiac gluten sensitivity) produces a more immediate reaction, like diarrhea or cramping shortly after eating, but without the intestinal damage or immune response seen in celiac disease. The telltale sign for either condition is the same: symptoms improve when you stop eating gluten and return when you start again. If you suspect celiac disease, avoid going gluten-free before testing, because eliminating gluten beforehand can produce a false negative result on the blood test.

Irritable Bowel Syndrome

IBS is one of the most common causes of chronic, recurring stomach pain, particularly in the lower abdomen. It’s diagnosed when abdominal pain occurs at least one day per week for three months, with symptoms having started at least six months before diagnosis. The pain is closely tied to bowel habits: it tends to flare with diarrhea, constipation, or both, and often improves after a bowel movement.

What makes IBS particularly frustrating is that the gut becomes hypersensitive over time. Nerve endings in the intestinal wall that normally respond only to strong stimuli start firing at much lower thresholds. This sensitization can also spread: the spinal cord neurons that process gut signals overlap with nerves from other body regions, which is why many people with IBS also experience referred pain in the lower back or pelvis that seems unrelated to digestion.

Gallbladder and Pancreas Problems

Gallbladder pain and pancreatic pain are sometimes confused because both flare after eating, but they feel different and sit in different spots. Gallbladder pain is typically an ache under the right rib cage, often triggered by fatty meals, and it may come in waves as the gallbladder squeezes against a stone blocking the bile duct. Pancreatic pain sits more to the upper left or center, feels sharp or squeezing, and tends to radiate to the back. Severe upper abdominal pain that starts mild and worsens with eating, especially if it’s accompanied by nausea, fever, or a rapid pulse, fits the pattern of acute pancreatitis and needs prompt medical attention.

The two conditions are sometimes directly linked. Gallstones that travel out of the gallbladder can block the duct shared by both the bile system and the pancreas, triggering gallstone pancreatitis. Eating worsens this because digestion signals the pancreas to release more enzymes and the gallbladder to push more bile, increasing pressure behind the blockage.

When Stomach Pain Is an Emergency

Most stomach pain resolves on its own or with simple treatment, but certain patterns signal something more serious. Pain so severe it interrupts your ability to function, pain paired with uncontrollable vomiting or inability to keep liquids down, complete inability to pass gas or have a bowel movement combined with worsening pain, and pain that follows a recent abdominal surgery all warrant an emergency room visit.

Appendicitis has its own distinct warning signs: pain that begins near the belly button and shifts to the lower right, comes on suddenly, worsens over hours, and gets sharper when you move, cough, or sneeze. Loss of appetite, nausea, fever, and abdominal swelling may follow. This combination calls for immediate evaluation, because a ruptured appendix can become life-threatening within hours.