Why Does the Top of My Stomach Hurt: Causes

Pain at the top of your stomach, in the area just below your breastbone, is one of the most common digestive complaints. Doctors call this the epigastric region, where your stomach, liver, and pancreas all overlap. The most likely cause is simple indigestion, but that same spot can also signal acid reflux, an ulcer, gallbladder trouble, or a handful of other conditions worth knowing about.

Indigestion: The Most Common Cause

Burning or aching pain in the upper stomach after eating is one of the defining features of indigestion. It often comes with bloating, nausea, or a feeling of uncomfortable fullness that hits before you’ve finished your meal. For most people, indigestion is triggered by eating too fast, eating too much, or consuming foods that are fatty, spicy, or acidic. Alcohol, caffeine, and carbonated drinks are frequent offenders too.

Indigestion that happens occasionally is rarely a sign of anything serious. But when it becomes a regular pattern, lasting three months or longer with no clear structural cause, it may qualify as functional dyspepsia. This is a real, recognized condition where the upper digestive tract is persistently sensitive or slow to empty, even though tests come back normal. It affects a significant portion of people who seek help for chronic upper stomach pain.

Acid Reflux and GERD

Your stomach and esophagus are separated by a ring of muscle called the lower esophageal sphincter. It opens when you swallow, then closes to keep stomach acid where it belongs. When that muscle weakens or relaxes at the wrong time, acid escapes upward. If it happens frequently, it becomes gastroesophageal reflux disease, or GERD.

The pain can show up in different ways. Some people feel a classic burning sensation in the chest (heartburn), while others feel it closer to the stomach as acid indigestion. You might notice a sour taste from acid washing back into your throat, a persistent sore throat, difficulty swallowing, or even a chronic cough. Some people develop asthma-like symptoms including wheezing and shortness of breath, which makes GERD easy to mistake for a respiratory problem.

Several things increase your risk. Obesity and pregnancy both raise pressure inside the abdomen, pushing against that sphincter muscle. Smoking relaxes it directly and also weakens the surrounding diaphragm muscles over time. A hiatal hernia, where the top of your stomach pushes up through the diaphragm into the chest cavity, traps acid and moves the sphincter out of position. Hiatal hernias are most common in people over 50 and those carrying extra weight.

Peptic Ulcers

A peptic ulcer is an open sore in the lining of your stomach or the first stretch of your small intestine. It produces a dull or burning pain in the upper stomach that’s often worse on an empty stomach. The pain can last minutes to hours and tends to come and go over days or weeks, sometimes improving briefly after eating before returning.

The main cause is a bacterial infection called H. pylori, which affects roughly 30 to 40% of people in the United States. Most carriers never develop ulcers, but the bacteria damages the protective mucus layer of the stomach lining, making it vulnerable to acid. The other major cause is long-term use of anti-inflammatory painkillers like ibuprofen or naproxen, which reduce that same protective layer through a different mechanism.

If you notice that your upper stomach pain follows a predictable pattern tied to meals or fasting, and it’s been cycling for more than a few days, an ulcer is worth considering. H. pylori can be detected with a simple breath test or stool test, and the infection is treatable.

Gastritis

Gastritis is inflammation of the stomach lining itself. It causes many of the same symptoms as an ulcer, including upper stomach pain, nausea, and a gnawing or burning sensation, but without an actual sore forming. The same culprits are often responsible: H. pylori infection, overuse of anti-inflammatory painkillers, heavy alcohol consumption, and chronic stress. Gastritis can be a short-lived response to something irritating or a long-standing condition that gradually worsens.

Gallbladder Problems

Your gallbladder sits under your liver on the right side, just below the rib cage. When gallstones partially or intermittently block the ducts that drain bile, you get what’s called biliary colic: an ache on the upper right side of your abdomen, often after eating, frequently accompanied by nausea. The pain can come and go unpredictably.

Because the gallbladder and stomach are close neighbors, gallstone pain sometimes feels like it’s coming from the top of the stomach rather than the right side. It can also radiate to the back or right shoulder. If a gallstone travels further and blocks the duct leading to the pancreas, it triggers gallstone pancreatitis, which causes severe pain on the upper left side that may feel sharp or like a squeezing sensation and can radiate to the chest, shoulder, or back. This is a medical emergency.

Functional Dyspepsia

Sometimes upper stomach pain persists for months without any identifiable cause. When symptoms have been present for at least three months (with onset at least six months prior), and an upper endoscopy and other tests show no structural, metabolic, or organic explanation, the diagnosis is functional dyspepsia. The key symptoms include bothersome pain or burning in the epigastric area, uncomfortable fullness after meals, and feeling full unusually early during a meal.

This isn’t a diagnosis of exclusion that means nothing is wrong. The nerves and muscles of the upper digestive tract genuinely function differently in people with this condition. It’s treated with a combination of dietary adjustments, stress management, and sometimes low-dose medications that calm the gut’s nerve signaling.

When Upper Stomach Pain Is an Emergency

Most upper stomach pain resolves on its own or responds to straightforward treatment. But certain patterns demand immediate attention. Sudden, excruciating pain that comes on abruptly can signal a perforated ulcer, a ruptured blood vessel, blocked blood flow to the intestines, or a gallstone or kidney stone lodged in a duct. These are surgical emergencies.

Other warning signs include fever combined with severe pain, a rapid heartbeat, lightheadedness or fainting, vomiting blood or material that looks like coffee grounds, and black or tarry stools. Pain that keeps getting worse over hours rather than waxing and waning also warrants urgent evaluation. If you’re experiencing any of these alongside your upper stomach pain, that’s a situation to take seriously and act on quickly.

What Helps and What to Expect

For mild, occasional pain, the fix is often practical. Eating smaller meals, avoiding foods that trigger symptoms, cutting back on alcohol and caffeine, not lying down right after eating, and managing stress can make a noticeable difference. Elevating the head of your bed by a few inches helps if nighttime acid reflux is part of the picture.

If your pain recurs regularly, lasts more than a couple of weeks, or disrupts your daily life, a medical evaluation typically starts with a detailed history of your symptoms, particularly their timing relative to meals, their quality (burning vs. cramping vs. sharp), and whether anything makes them better or worse. From there, testing might include blood work, a breath or stool test for H. pylori, an abdominal ultrasound to check the gallbladder, or an upper endoscopy where a small camera examines the esophagus, stomach, and upper intestine directly.

The good news is that the most common causes of upper stomach pain, including GERD, gastritis, ulcers, and functional dyspepsia, are all highly treatable once identified. Most people see significant improvement within weeks of starting the right approach.