Why Is the Top Part of My Stomach Hurting?

Pain in the top part of your stomach, the area just below your ribs and breastbone, is called epigastric pain. It’s one of the most common reasons people search for health information, and in most cases it comes down to something digestive: acid irritation, indigestion, or inflammation in the stomach lining. But the upper abdomen also houses your gallbladder, pancreas, and sits close enough to your heart that certain serious conditions can mimic a stomachache.

Understanding what your pain feels like, when it shows up, and what makes it better or worse can help you narrow down the cause.

Indigestion and Acid-Related Pain

The most common reason for upper stomach pain is straightforward indigestion, also called dyspepsia. It typically feels like a burning sensation that shows up after eating. That burning quality comes from stomach acid contacting your stomach lining or splashing up into your esophagus. If the pain comes with a sour taste in your mouth, gets worse when you lie down, or wakes you up at night after a late meal, acid reflux (GERD) is the likely culprit.

Peptic ulcers produce a similar but often more intense version of this pain. An ulcer is an open sore in your stomach lining or the first section of your small intestine, caused by either a bacterial infection (H. pylori) or long-term use of anti-inflammatory painkillers like ibuprofen or aspirin. Ulcer pain tends to feel burning, gnawing, and deep, as if something is boring into your abdomen. It can improve briefly after eating, then return, or it can get worse on an empty stomach.

A stomach virus (gastroenteritis) can also inflame the stomach lining temporarily, causing upper pain along with nausea, vomiting, or diarrhea. This usually resolves within a few days on its own.

Gallbladder Pain

Your gallbladder sits under your right rib cage, and when gallstones partially block its drainage, you feel an ache in the upper right side of your abdomen. This is called biliary colic. It tends to come on after eating, especially after fatty meals, and often brings nausea. The pain can come and go, sometimes lasting 30 minutes to a few hours before fading.

If a gallstone fully blocks the bile duct or triggers inflammation, the pain becomes more constant and severe, and may radiate to your right shoulder or back. Fever alongside this kind of pain signals an infection that needs prompt medical attention.

Pancreas Problems

Pancreatitis produces severe pain in the upper left abdomen that can feel sharp or squeezing. It often radiates to your back, chest, or shoulder. Nausea and vomiting are common. Gallstones are actually one of the leading triggers of pancreatitis: when a stone blocks the duct shared by the gallbladder and pancreas, digestive enzymes back up and start damaging the pancreas itself. Heavy alcohol use is the other major cause. Pancreatitis pain tends to get worse after eating because digestion signals the pancreas to release more enzymes, adding pressure to an already blocked system.

What the Type of Pain Tells You

The character of your pain offers useful clues:

  • Burning after meals: Most likely acid-related, whether from indigestion, GERD, or an ulcer.
  • Aching in the upper right side after fatty food: Points toward your gallbladder.
  • Sharp or squeezing pain on the upper left, radiating to the back: Suggests the pancreas.
  • Pressure or tightness that spreads to your jaw, neck, or arms: Could involve your heart (more on this below).

When It Might Not Be Your Stomach at All

Heart attacks don’t always feel like chest-clutching Hollywood scenes. They can show up as what feels like bad indigestion: nausea, upper abdominal pain, and heartburn. Even experienced doctors sometimes can’t tell the difference based on symptoms alone. The key distinguishing features of a cardiac event are pressure or tightness that spreads to your neck, jaw, arms, or back, along with shortness of breath, cold sweat, sudden dizziness, or unusual fatigue.

Heartburn, by contrast, usually responds to antacids, worsens when you bend over or lie down, and may come with a sour taste or a small amount of stomach contents rising into your throat. If you have persistent pain in this area and you’re not sure whether it’s digestive, treat it as a potential emergency.

Common Triggers and Habits That Make It Worse

Many episodes of upper stomach pain trace back to something specific you ate, drank, or did:

  • Coffee and acidic drinks: Coffee, orange juice, grapefruit juice, and alcohol all increase stomach acid production or irritate the lining directly.
  • Spicy, fatty, or acidic foods: Tomatoes, chocolate, and fried foods are frequent offenders.
  • Anti-inflammatory painkillers: Ibuprofen (Advil, Motrin), naproxen (Aleve), and aspirin can erode the stomach lining, especially when taken on an empty stomach.
  • Eating large meals or lying down too soon: Both increase pressure on the stomach and push acid upward.
  • Smoking: Irritates the stomach lining and raises your risk of ulcers.
  • Stress: A known trigger for epigastric pain in some people, likely through increased acid production and changes in gut motility.

Simple adjustments can make a real difference: eating smaller meals, staying upright for at least 30 minutes after eating, cutting back on coffee and alcohol, and stopping any anti-inflammatory medications that might be causing irritation.

Over-the-Counter Options

For occasional heartburn or acid-related pain, an acid-blocking medication like famotidine (Pepcid) works quickly by temporarily reducing stomach acid production. If you deal with chronic acid reflux, omeprazole (Prilosec) is more effective as a longer-term solution because it blocks acid production more completely when taken regularly.

For general indigestion or upset stomach that doesn’t feel specifically like acid, peppermint oil products can soothe symptoms where acid blockers may not help. If bloating and gas are part of the picture, simethicone (Gas-X) helps break up gas bubbles. It’s mild enough that doctors use it during endoscopy procedures.

If over-the-counter treatments don’t improve your symptoms within two weeks, or if the pain keeps coming back, that’s a signal something beyond simple indigestion may be going on.

Warning Signs That Need Immediate Attention

Most upper stomach pain is uncomfortable but not dangerous. Certain patterns, however, signal a potential emergency. Seek immediate care if you experience:

  • Sudden, excruciating abdominal pain that comes on like a switch flipped
  • Pain with fever, rapid heartbeat, or feeling faint
  • Vomiting blood or material that looks like coffee grounds
  • A rigid, tender abdomen that hurts more when you cough, tap your heel on the ground, or release pressure after pressing on it
  • Pain with shortness of breath, cold sweat, or pressure radiating to your jaw, neck, or arms

These can indicate conditions like a perforated ulcer, internal bleeding, a blocked bile duct, or a heart attack, all of which require urgent evaluation. Abrupt, excruciating pain in particular raises concern for serious causes like organ perforation or a major blood vessel problem, especially in adults over 50.