What Causes Ulcers? H. pylori, NSAIDs, and More

Most ulcers are caused by a bacterial infection or by long-term use of common pain relievers like ibuprofen and aspirin. These two factors account for the vast majority of peptic ulcers, which are open sores that develop on the inner lining of your stomach or the upper part of your small intestine. Stress and spicy food, long blamed as the primary culprits, play a much smaller role than most people think.

H. pylori: The Leading Cause

A corkscrew-shaped bacterium called Helicobacter pylori is responsible for the majority of ulcers, particularly in the duodenum (the first section of the small intestine). Studies in lower-income settings report that H. pylori is present in 70 to 90 percent of duodenal ulcer cases. The bacterium is remarkably common worldwide, and many people carry it without ever developing symptoms. But in some individuals, the infection triggers enough damage to the stomach’s protective lining that an ulcer forms.

H. pylori survives the stomach’s harsh acid environment through a clever chemical trick. The bacterium produces an enzyme called urease, which breaks down urea into ammonia and carbon dioxide. The ammonia quickly neutralizes the acid in the immediate area around the bacterium, creating a small protective bubble. Once safe from the acid, H. pylori uses whip-like tails called flagella to swim through the thick mucus layer and attach to the stomach’s surface cells. Over time, the bacterium damages that mucus lining, leaving patches of tissue exposed to digestive acid. The acid eats into the now-unprotected tissue, and an ulcer develops.

Most people pick up H. pylori during childhood, likely through contaminated food, water, or close contact with an infected person. The infection can persist for decades without causing problems. Why some carriers develop ulcers while others don’t appears to depend on the specific strain of bacteria, the person’s immune response, and genetic factors.

Pain Relievers That Erode the Stomach Lining

Nonsteroidal anti-inflammatory drugs, commonly called NSAIDs, are the second most frequent cause of ulcers. This group includes over-the-counter medications like ibuprofen, naproxen, and aspirin, as well as prescription-strength versions. NSAIDs are implicated in 30 to 50 percent of gastric (stomach) ulcers, especially in older adults.

Your stomach lining normally protects itself by producing compounds called prostaglandins, which maintain blood flow to the lining, stimulate mucus production, and promote the release of bicarbonate to neutralize acid. NSAIDs work by blocking an enzyme involved in prostaglandin production. That’s how they reduce pain and inflammation elsewhere in the body, but in the stomach, the same mechanism strips away the lining’s built-in defenses. With less mucus and reduced blood flow, acid begins to damage the exposed tissue.

The risk is dose-dependent and cumulative. On any given day, more than 10 percent of people taking NSAIDs chronically will have a gastric ulcer, a rate 5 to 10 times higher than in people who aren’t taking these drugs. Occasional use carries far less risk, but daily use over weeks or months significantly increases your chances, particularly if you’re over 65, take higher doses, or combine NSAIDs with blood thinners or corticosteroids.

Stress Ulcers From Severe Illness

Everyday psychological stress does not cause ulcers. But severe physical stress on the body, such as major burns, traumatic brain injuries, or critical illness requiring intensive care, can trigger a distinct type of ulcer known as a stress ulcer. These form when the body diverts blood flow away from the digestive tract during a crisis, weakening the stomach lining’s ability to resist acid damage.

Stress ulcers that develop after major burns are sometimes called Curling ulcers, while those following acute brain injuries are known as Cushing ulcers. These typically appear in the upper part of the stomach and can range from shallow erosions that cause no symptoms to deeper sores that bleed significantly. They are a concern in hospital settings and are treated differently from standard peptic ulcers.

Excess Acid From Rare Tumors

A small number of ulcers result from a condition called Zollinger-Ellison syndrome, in which tumors called gastrinomas form in the pancreas or duodenum. These tumors release large amounts of gastrin, a hormone that normally tells your stomach to produce acid after a meal. When gastrinomas flood the body with gastrin, the stomach produces far more acid than it needs, overwhelming the protective mucus layer and causing recurrent, hard-to-treat ulcers. This condition is rare, but doctors consider it when ulcers keep coming back despite standard treatment.

Genetics and Family History

Some people are more biologically prone to ulcers than others. Evidence from twin studies, family studies, and blood group research supports a genetic component to peptic ulcer disease. One specific marker, an elevated blood level of pepsinogen I (a precursor to a digestive enzyme), has been found in a subgroup of duodenal ulcer patients. Analysis of affected families suggests this trait follows an autosomal dominant inheritance pattern, meaning a single copy of the gene from one parent can increase risk.

Having a close relative with peptic ulcer disease doesn’t guarantee you’ll develop one, but it does mean your stomach may be inherently more vulnerable to the other triggers on this list, particularly H. pylori infection.

Alcohol and Smoking

Alcohol and smoking don’t rank alongside H. pylori and NSAIDs as primary causes, but both can significantly worsen the problem. Alcohol interferes with normal acid secretion and triggers inflammatory compounds in the stomach lining. Beverages above roughly 15 percent alcohol concentration also slow stomach emptying, prolonging the lining’s exposure to both alcohol and acid. Heavy, sustained drinking can damage the mucus barrier enough to contribute to ulcer formation.

Smoking impairs blood flow to the stomach lining and slows the healing of existing ulcers. People who smoke are more likely to develop ulcers and more likely to experience complications like perforation. Quitting smoking measurably improves healing rates.

Spicy Food: A Persistent Myth

For decades, doctors told ulcer patients to avoid spicy food. The evidence doesn’t support this. Studies in healthy volunteers show that eating highly spiced meals does not cause visible damage to the stomach or duodenal lining on endoscopy, even though acid and enzyme secretion may temporarily increase. Some research has even found that capsaicin, the compound that makes chili peppers hot, has protective effects on the stomach lining.

Spicy food can aggravate symptoms if you already have an ulcer, making the burning or discomfort worse. But it does not cause the ulcer in the first place. The same is generally true of coffee and acidic foods: they may be uncomfortable, but they aren’t eroding your stomach lining.

How Doctors Identify the Cause

Because treatment depends entirely on the underlying cause, identifying what triggered your ulcer is a critical step. For H. pylori, the most common screening method is a urea breath test. You swallow a capsule or liquid containing specially labeled urea. If H. pylori is present in your stomach, the bacteria break down the urea and release labeled carbon dioxide, which is detected in your breath a few minutes later. The test is non-invasive and highly accurate.

When doctors need to see the ulcer directly, they perform an upper GI endoscopy, passing a thin, flexible tube with a camera down your throat to examine the lining of your esophagus, stomach, and duodenum. During the procedure, they can take small tissue samples to check for H. pylori, rule out cancer, and assess the severity of the damage. If you’re taking NSAIDs regularly and develop an ulcer, your doctor will typically identify the medication as the likely cause and discuss alternatives or protective strategies.