What Is an Ulcer in Your Stomach? Causes & Treatment

A stomach ulcer is an open sore that forms in the lining of your stomach when the protective barrier breaks down and digestive acid eats into the tissue beneath it. Roughly 5 to 10 percent of people will develop a peptic ulcer at some point in their lives. Despite decades of blame placed on stress and spicy food, the two real culprits are a specific bacterial infection and long-term use of common pain relievers.

How the Stomach Normally Protects Itself

Your stomach produces powerful hydrochloric acid to break down food, yet the organ doesn’t digest itself under normal conditions. That’s because it maintains a layered defense system. Surface cells secrete a thick gel of mucus that acts as a physical shield, blocking acid and digestive enzymes from reaching the tissue underneath. Other cells pump out bicarbonate, a neutralizing agent that buffers any acid that gets close to the stomach wall. Blood flow through the lining also helps carry away stray acid and deliver repair materials to damaged cells.

When a cell is injured, neighboring healthy cells migrate to the wound site in a process called restitution, patching small gaps before they become a problem. A stomach ulcer develops when something disrupts this balance, tipping the scales so that acid overwhelms the defenses. The sore extends through the inner lining and into the muscular layer beneath it, which is what separates a true ulcer from superficial irritation or gastritis.

The Two Main Causes

H. pylori Infection

The bacterium Helicobacter pylori is the most common cause of stomach ulcers worldwide. It burrows into the mucus layer, triggers inflammation, and weakens the protective barrier from the inside. Many people carry H. pylori without symptoms, but in some, the chronic inflammation eventually allows acid to damage the exposed tissue and form an ulcer. A simple breath test, stool test, or biopsy during an endoscopy can confirm the infection.

Pain Relievers (NSAIDs)

Nonsteroidal anti-inflammatory drugs like ibuprofen, aspirin, and naproxen are the second leading cause. These medications work by blocking an enzyme called COX-1, which is the same enzyme responsible for producing the protective compounds that keep your stomach’s mucus layer thick and its blood flow healthy. When you take NSAIDs regularly, that protective mucus thins out, leaving the lining exposed to acid. The risk rises with higher doses, longer use, and age over 60. Taking NSAIDs on an empty stomach or combining them with alcohol increases the danger further.

What a Stomach Ulcer Feels Like

The most common symptom is a burning or gnawing pain in the upper abdomen, somewhere between your navel and breastbone. The pain often flares when your stomach is empty, sometimes waking you at night, and temporarily improves after eating or taking an antacid. Some people describe it as more of a dull ache than a sharp pain.

Other symptoms include bloating, nausea, feeling full quickly during meals, and a loss of appetite. Small ulcers can be nearly silent, producing only mild discomfort that’s easy to dismiss as indigestion. Larger or deeper ulcers tend to cause more persistent pain that doesn’t respond well to over-the-counter remedies.

Dangerous Warning Signs

Most ulcers are manageable, but two complications are medical emergencies. The first is bleeding: if an ulcer erodes into a blood vessel, you may vomit blood (which can look like coffee grounds) or pass dark, tarry black stools. Significant blood loss can cause dizziness, fainting, and rapid heartbeat. The second is perforation, where the ulcer burns completely through the stomach wall. This causes sudden, severe abdominal pain, a rigid abdomen that’s painful to touch, and signs of shock like excessive sweating or confusion. Both situations require immediate emergency care.

How Stomach Ulcers Are Diagnosed

If your doctor suspects an ulcer, the most definitive test is an upper endoscopy. A thin, flexible camera is passed through your mouth into your stomach, allowing direct visualization of the ulcer and the ability to take a small tissue sample. That biopsy can check for H. pylori and rule out anything more serious. For younger patients with straightforward symptoms, doctors sometimes start with a noninvasive H. pylori breath or stool test and begin treatment without an endoscopy first.

Treatment and Healing Time

Treatment depends on the cause. If H. pylori is present, the goal is to eliminate the bacteria. Current guidelines from the American College of Gastroenterology recommend a 14-day course of combination therapy that pairs an acid-reducing medication with antibiotics and bismuth (the active ingredient in Pepto-Bismol). This regimen clears the infection in the majority of cases. If the first round fails, your doctor can adjust the antibiotic combination.

For ulcers caused by NSAIDs, the first step is stopping or replacing the offending medication. Acid-suppressing drugs, most commonly proton pump inhibitors (PPIs), are then prescribed to reduce stomach acid and give the lining time to rebuild. These medications dramatically lower acid production, creating an environment where the ulcer can close.

Healing typically takes 8 to 12 weeks, confirmed by a follow-up endoscopy showing that the crater has closed over with new tissue. Most people start feeling better within a few days to a couple of weeks once acid levels drop, but the tissue itself needs the full treatment course to heal properly. Stopping medication early because symptoms improve is one of the most common reasons ulcers come back.

Food, Caffeine, and Common Myths

For decades, doctors told patients that spicy food and stress caused ulcers. Neither one does. Food doesn’t create ulcers, and it doesn’t cure them. That said, certain foods can aggravate an existing ulcer and make the pain worse. Spicy dishes, acidic foods like tomatoes and citrus, and alcohol are frequent offenders, though the specific triggers vary from person to person.

The evidence on coffee is mixed. Caffeine does stimulate acid production, but research hasn’t consistently shown that it worsens ulcer outcomes. If coffee doesn’t bother you, there’s no strong reason to eliminate it. If it intensifies your pain, cutting back is a reasonable move. The same applies to carbonated drinks and chocolate: pay attention to your body’s response rather than following blanket restrictions.

What does help is eating regular meals rather than going long stretches without food, since an empty stomach means acid has nothing to work on except the lining itself. Smoking slows ulcer healing and increases the risk of recurrence, so quitting makes a measurable difference in recovery time.

Why Ulcers Come Back

Recurrence is common when the underlying cause isn’t fully addressed. If H. pylori isn’t completely eradicated, the infection will continue damaging the lining and a new ulcer can form. If you need to keep taking NSAIDs for a chronic condition like arthritis, your doctor may prescribe a daily acid reducer to protect the stomach long-term, or switch you to a pain reliever that’s easier on the gut. Smoking, heavy alcohol use, and inconsistent medication use all raise the odds of a repeat episode. Once you’ve had one ulcer, staying aware of early symptoms helps you catch a recurrence before it becomes serious.