Severe pain at the top of your stomach, the area just below your breastbone and between your ribs, usually comes from one of several organs packed tightly into that region: the stomach itself, the first part of the small intestine, the pancreas, the gallbladder, or the liver. The cause can range from something as manageable as acid irritation to something that needs immediate attention, like a gallstone blocking the pancreas. What the pain feels like, when it hits, and what other symptoms come with it are the best clues to narrowing it down.
Gastritis: Irritation of the Stomach Lining
Gastritis is one of the most common reasons for upper stomach pain, and it happens when the lining of your stomach becomes inflamed. The pain tends to feel like a dull ache or gnawing sensation, sometimes with nausea, vomiting, or a sense of fullness that hits unusually early in a meal. Many people with mild gastritis don’t have symptoms at all, but when it flares, the discomfort can be intense enough to feel alarming.
The most common cause of chronic gastritis is infection with a bacterium called H. pylori, which burrows into the stomach lining and triggers ongoing inflammation. Other frequent culprits include heavy use of pain relievers like ibuprofen or aspirin, alcohol, severe physical stress from illness or injury, and autoimmune conditions where the body attacks its own stomach cells. If you’ve been taking over-the-counter painkillers regularly, that’s worth paying close attention to: roughly one-third of people who take NSAIDs long-term develop stomach or intestinal ulcers visible on an endoscopy. These medications reduce the protective mucus layer in the stomach and restrict blood flow to the lining, leaving it vulnerable to acid damage.
Eating can either help or worsen gastritis pain, and there’s no single pattern. That unpredictability is actually a distinguishing feature compared to other causes.
Acid Reflux and GERD
If the pain feels more like burning and seems to rise from your upper stomach toward your chest or throat, acid reflux is a likely explanation. Gastroesophageal reflux disease (GERD) happens when the muscular valve between your esophagus and stomach doesn’t close properly, letting stomach acid wash upward. You might taste something sour in the back of your mouth, develop a chronic cough or hoarse voice, or feel pain when swallowing.
Several things can weaken that valve: carrying extra weight, pregnancy, eating spicy or fatty foods, and having a hiatal hernia (where part of the stomach pushes up through the diaphragm). Certain medications can also contribute, including some sedatives, asthma drugs, certain antidepressants, and blood pressure medications. GERD pain often worsens when you lie down or bend over, which helps distinguish it from other causes of upper stomach pain.
Peptic Ulcers and the Timing of Pain
An ulcer is an open sore that forms in the stomach lining or the upper part of the small intestine (the duodenum). The pain is often sharper than gastritis, sometimes described as a burning or boring sensation. The key diagnostic clue is when the pain shows up relative to meals.
Stomach ulcers tend to hurt during or shortly after eating, because food stimulates acid production right where the sore is. Duodenal ulcers behave differently: eating actually provides temporary relief, but pain returns two to three hours later, once food has moved on and acid is back in contact with the ulcer. Many people with duodenal ulcers notice the pain wakes them up at night, when the stomach is empty.
Most ulcers are caused by the same H. pylori bacteria behind chronic gastritis, or by regular NSAID use. Testing for H. pylori is straightforward. A breath test, where you drink a solution and breathe into a collection bag, catches the infection about 90% of the time and is highly accurate. Blood tests are even more sensitive at detecting exposure, though they can stay positive after the infection has cleared. Stool tests are another reliable option.
Gallbladder Pain
Gallbladder attacks produce a distinctive pain that sits in the upper right side of your abdomen, just under the right rib cage. It can easily be mistaken for general upper stomach pain, especially when it radiates toward the center. The pain typically comes on suddenly after a fatty meal and feels like a deep, steady ache or squeezing pressure rather than a sharp stab.
What sets gallbladder pain apart is its pattern. A gallstone temporarily blocking the bile duct causes episodes that come and go as the gallbladder contracts and relaxes. Each episode can last anywhere from 30 minutes to several hours, then resolve completely until the next one. If the pain becomes constant, that may signal a more serious complication like an inflamed gallbladder or a stone that’s fully stuck.
Pancreatitis: Sharp Pain That Radiates
Pancreatic inflammation, or pancreatitis, produces some of the most severe upper abdominal pain people experience. It typically starts on the upper left side and may feel sharp or like intense squeezing. A hallmark of pancreatitis is that the pain radiates, often to your back, chest, or shoulder. Leaning forward sometimes provides slight relief, while lying flat makes it worse.
Gallstones are one of the most common triggers. When a stone blocks the duct that drains the pancreas, digestive enzymes back up and start damaging the organ itself. Heavy alcohol use is the other major cause. Unlike a gallbladder attack that might resolve on its own, pancreatitis usually requires hospital care. Mild cases may clear up with a few days of supportive treatment, but severe cases can become dangerous quickly.
When Upper Stomach Pain Is Actually Your Heart
This is the possibility most people don’t consider, and it’s the most important one to rule out. A heart attack can present as upper abdominal pain, nausea, and what feels like bad indigestion, particularly in women, older adults, and people with diabetes. The Mayo Clinic notes that women are more likely than men to experience a heart attack through symptoms like nausea, jaw or back pain, and shortness of breath rather than the classic chest-clutching scenario.
The combination that should get you to an emergency room immediately: upper stomach pain alongside shortness of breath, a tight or squeezing sensation in the chest, cold sweat, lightheadedness, or pain spreading to your jaw, neck, or arms. People with high blood pressure, diabetes, or high cholesterol are at higher risk. If there’s any doubt, it’s safer to treat it as a cardiac event and let medical testing confirm or rule it out.
Patterns That Help Identify the Cause
Because so many conditions overlap in this part of the body, paying attention to a few specifics can help you and your doctor figure out what’s going on faster:
- Pain that burns and rises upward points toward acid reflux or GERD.
- Dull, gnawing pain with early fullness suggests gastritis.
- Pain that improves with eating but returns 2 to 3 hours later is a classic duodenal ulcer pattern.
- Sudden pain in the upper right side after a fatty meal suggests a gallbladder attack.
- Severe pain radiating to the back raises concern for pancreatitis.
- Pain with shortness of breath, sweating, or dizziness needs emergency evaluation for a possible heart event.
Also worth noting: if you see blood in your vomit, notice dark or tarry stools, or feel your abdomen becoming rigid and extremely tender to touch, those are signs of a serious complication like a bleeding ulcer or a ruptured organ that needs immediate medical care. Persistent, severe, or worsening pain that doesn’t respond to antacids or changes in position is another signal that something beyond simple indigestion is happening.

