Stomach ulcers form when something damages the protective mucus lining inside your stomach, exposing the tissue underneath to digestive acid. In the vast majority of cases, the culprit is either a bacterial infection or long-term use of common pain relievers like ibuprofen and aspirin. Roughly 5 to 10% of people will develop a peptic ulcer at some point in their lives.
The Two Main Causes
Almost all stomach ulcers trace back to one of two things: a bacterium called H. pylori or a class of painkillers known as NSAIDs (ibuprofen, naproxen, aspirin). Understanding which one is responsible matters because the treatment is completely different for each.
H. pylori Infection
H. pylori is a spiral-shaped bacterium that can live in the mucus layer of your stomach for years, sometimes decades, without causing symptoms. It survives in one of the most acidic environments in your body by producing an enzyme called urease, which neutralizes the acid in its immediate surroundings. While it’s busy protecting itself, it weakens the mucus barrier that protects your stomach wall. The bacteria also attach directly to stomach cells, triggering inflammation that gradually erodes the tissue. Over time, acid reaches the unprotected lining and an ulcer forms.
Most people with H. pylori never develop an ulcer, but the infection dramatically raises the risk. You can pick it up through contaminated food, water, or close contact with someone who carries it, often in childhood. Many people carry H. pylori without knowing it.
NSAID Use
NSAIDs are the other major cause of stomach ulcers, and they work through a different mechanism. Your stomach lining depends on chemical messengers called prostaglandins to maintain its defenses. Prostaglandins stimulate mucus production, promote blood flow to the stomach wall, and help damaged cells repair themselves. NSAIDs block the enzymes that produce prostaglandins. That’s actually how they reduce pain and inflammation elsewhere in your body, but the same action strips your stomach of its protective toolkit.
The correlation between prostaglandin suppression and stomach damage is strong: the more an NSAID suppresses prostaglandin production, and the longer you take it, the more likely it is to cause an ulcer. This is why occasional use of ibuprofen is relatively low-risk, but daily use over weeks or months can be a serious problem. The risk climbs further if you’re over 60, take high doses, or combine NSAIDs with blood thinners or corticosteroids.
What About Stress?
The idea that stress causes stomach ulcers is one of the most persistent health beliefs around, and the truth is more nuanced than a simple yes or no. Everyday emotional stress does not directly bore a hole in your stomach lining. However, there is evidence that chronic stress and anxiety can shift hormone levels in ways that increase stomach acid production, which over time may contribute to ulcer formation, particularly if other risk factors are already present.
There is a separate condition called a “stress ulcer” that develops rapidly in people who are critically ill, recovering from major surgery, on ventilators, or dealing with severe burns or head injuries. These ulcers form because extreme physiological stress redirects blood flow away from the digestive tract, weakening the stomach’s ability to maintain its protective lining. This is a hospital-level concern, not something triggered by a tough week at work.
Smoking, Alcohol, and Other Risk Factors
Smoking increases ulcer risk through several pathways at once. Nicotine reduces blood flow to the stomach lining, decreases mucus and prostaglandin production, and slows the release of growth factors your stomach needs to repair everyday wear and tear. In short, it weakens your stomach’s defenses while boosting its aggressive factors. If you already have an H. pylori infection, smoking makes it harder for that ulcer to heal.
Alcohol irritates and erodes the stomach lining directly, especially in large amounts. It can also increase acid production. Neither smoking nor alcohol alone commonly causes ulcers in the absence of H. pylori or NSAID use, but both significantly raise your risk and slow healing if an ulcer has already started forming.
Rare Causes
A small number of stomach ulcers stem from a condition called Zollinger-Ellison syndrome. Tumors called gastrinomas, usually found in the pancreas or the first part of the small intestine, release massive amounts of a hormone called gastrin. Normally, your body releases a small amount of gastrin after meals to signal your stomach to produce acid. Gastrinomas flood the system with it, forcing your stomach to produce far more acid than the lining can withstand. People with this condition tend to develop ulcers that are unusually severe, keep coming back after treatment, or appear in unusual locations.
What a Stomach Ulcer Feels Like
The most common symptom is a dull or burning pain in your upper abdomen, somewhere between your belly button and your breastbone. The pain tends to come and go rather than staying constant. For some people, it flares when the stomach is empty or at night and improves briefly after eating. For others, eating actually makes the pain worse. This variability can make ulcers tricky to pin down based on symptoms alone.
Other common symptoms include bloating, nausea, feeling full quickly during meals, and a general loss of appetite. Some ulcers cause no noticeable symptoms at all, especially in older adults or people taking NSAIDs (which also dull pain signals).
Certain symptoms signal a complication that needs immediate attention: vomiting blood or material that looks like coffee grounds, black or tarry stools, sudden sharp abdominal pain that doesn’t let up, or signs of significant blood loss like pale skin, lightheadedness, or fainting. These can indicate that an ulcer is bleeding or has perforated through the stomach wall.
How Ulcers Are Diagnosed
If your doctor suspects an ulcer, the first step is usually testing for H. pylori. A urea breath test is the most accurate noninvasive option, with a sensitivity of 97% and near-perfect specificity. You swallow a substance containing a special form of carbon, and if H. pylori is present in your stomach, the bacteria break it down in a way that can be detected in your breath about 15 minutes later. A stool antigen test is another reliable noninvasive option, detecting the infection correctly about 92% of the time.
For people with more concerning symptoms, or those over 55 with new digestive complaints, an upper endoscopy gives a direct look. A thin, flexible camera is passed through your mouth into your stomach, allowing the doctor to see the ulcer, assess its size, and take small tissue samples. Those biopsies can test for H. pylori and also rule out stomach cancer, which can occasionally mimic an ulcer.
How Stomach Ulcers Are Treated
Treatment depends on the cause. If H. pylori is behind the ulcer, the goal is to eliminate the infection. This typically involves a combination of two antibiotics plus an acid-reducing medication, taken for about two weeks. Success rates for standard regimens hover around 80 to 83%, though a four-drug approach that includes bismuth (the active ingredient in Pepto-Bismol) can push eradication rates above 90%. Rising antibiotic resistance has made treatment somewhat less straightforward than it used to be, so your doctor may test to confirm the infection is gone a few weeks after you finish the course.
If NSAIDs caused the ulcer, the most important step is stopping or reducing the medication. An acid-suppressing drug is typically prescribed for four to eight weeks to let the lining heal. If you need to stay on an NSAID for a chronic condition like arthritis, your doctor may add a protective medication or switch you to a pain reliever that’s easier on the stomach.
Regardless of the cause, acid-reducing medications do the heavy lifting during healing. These drugs dramatically lower acid production, giving the damaged tissue the chance to rebuild its mucus layer and close the wound. Most uncomplicated ulcers heal within two months with proper treatment.
Why Some 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 in the same spot or nearby. If you return to regular NSAID use after healing, you’re essentially restarting the process that created the ulcer in the first place. Continued smoking also slows healing and increases the chance of recurrence. The ulcer itself is really just the visible damage; the conditions that allowed it to form are what need to change for good.