What Causes Stomach Ulcers? H. pylori and Beyond

The two causes behind nearly all stomach ulcers are a bacterial infection called H. pylori and overuse of common pain relievers like ibuprofen and aspirin. H. pylori alone accounts for 70% to 90% of gastric ulcers, while nonsteroidal anti-inflammatory drugs (NSAIDs) are the second most common cause. Stress and spicy food, long blamed for ulcers, do not actually cause them.

H. pylori: The Leading Cause

H. pylori is a corkscrew-shaped bacterium that lives in the stomach lining. Most bacteria can’t survive in the stomach’s acid, but H. pylori has a trick: it produces an enzyme called urease that breaks down urea into ammonia and carbon dioxide. The ammonia neutralizes the acid in the bacterium’s immediate surroundings, creating a safe pocket where it can thrive. Special channels on the bacterium’s surface open only when the environment is acidic, letting urea flood in exactly when protection is needed most.

Once settled in, H. pylori doesn’t just sit there. It injects proteins directly into the cells lining your stomach. One of these proteins disrupts normal cell structure, changing how cells grow, move, and stick together. Another punches tiny channels into cell membranes, allowing ions to leak in and causing cells to swell with water and eventually die. This protein can also trigger a self-destruct process in stomach lining cells by damaging their energy-producing machinery. The result is a weakened, inflamed mucosal barrier that stomach acid can eat through, forming an ulcer.

Many people carry H. pylori without ever developing an ulcer. Whether the infection progresses to ulceration depends partly on the strain of bacteria and partly on genetic factors. A large genome study of over 456,000 people identified eight genetic regions linked to ulcer risk, involving genes that affect susceptibility to H. pylori infection, the body’s ability to repair infection-related damage, and how much acid the stomach produces.

Pain Relievers That Damage the Stomach

NSAIDs like ibuprofen, aspirin, and naproxen are the second most common ulcer cause. These drugs work by blocking enzymes called COX-1 and COX-2, which reduces pain and inflammation throughout the body. The problem is that COX-1 also plays a housekeeping role in your stomach: it triggers the production of protective compounds called prostaglandins that maintain the mucus layer, promote blood flow to the stomach wall, and help cells secrete bicarbonate to neutralize acid at the surface.

When NSAIDs suppress COX-1, the stomach loses several defenses at once. Mucus and bicarbonate production drop, thinning the protective barrier. Blood flow to the stomach wall decreases, making tissue more vulnerable to injury and slower to repair. As the barrier weakens, acid begins seeping into the stomach wall. This acid triggers the release of a powerful vessel-constricting chemical that further chokes off blood supply, creating a cycle of damage. Ulceration from NSAIDs requires the suppression of both COX-1 and COX-2, which is why standard over-the-counter NSAIDs carry this risk while some newer selective drugs carry less.

Occasional NSAID use rarely causes ulcers. The risk climbs with regular, prolonged use, especially at higher doses, in older adults, or in people who also have an H. pylori infection.

Smoking, Alcohol, and Other Risk Factors

Smoking and heavy drinking don’t cause ulcers on their own, but they significantly raise the odds of serious complications. Smoking more than 15 cigarettes a day more than triples the risk of a perforated ulcer compared to never smoking. Heavy alcohol use, defined in one large population study as more than 42 drinks per week, quadruples the risk of a bleeding ulcer. Interestingly, the type of alcohol matters: in that same study, people who drank the same total amount but got more than 25% of it from wine had a much lower bleeding risk than those who drank no wine at all.

Smoking likely worsens ulcer outcomes by reducing blood flow to the stomach lining and impairing healing. Alcohol at high concentrations can directly irritate and erode the mucosal barrier, making existing damage worse.

Spicy Food and Stress: Not Actual Causes

For decades, doctors told patients that stress and spicy food caused their ulcers. The evidence doesn’t support this. Studies using endoscopy have found that eating highly spiced meals does not cause visible damage to the stomach or duodenal lining in healthy people, even though it temporarily increases acid and digestive enzyme secretion.

Capsaicin, the compound that makes chili peppers hot, actually appears to protect the stomach lining. Research in healthy volunteers found it had a powerful gastroprotective effect, and some evidence suggests that people taking NSAIDs regularly may reduce their risk of ulceration by eating moderately spicy food. Psychological stress can worsen ulcer symptoms and may slow healing, but it does not create the mucosal breakdown that leads to an ulcer forming in the first place.

A Rarer Cause: Acid-Producing Tumors

In a small number of cases, ulcers result from a condition called Zollinger-Ellison syndrome. Small tumors called gastrinomas, usually located in the pancreas or the first part of the small intestine, release excessive amounts of gastrin, a hormone that normally tells the stomach to produce acid after a meal. With gastrinomas flooding the system with gastrin, the stomach produces far more acid than the mucosal lining can handle, leading to severe or multiple ulcers. This condition is rare but worth investigating when ulcers keep returning despite treatment.

How Ulcers Are Diagnosed

If your doctor suspects an ulcer, testing typically starts with checking for H. pylori. The urea breath test is a simple, noninvasive option: you swallow a small amount of labeled urea, and if H. pylori is present in your stomach, the bacteria’s urease enzyme breaks it down into carbon dioxide that can be detected in your breath. In clinical testing, this method has shown sensitivity and specificity at or near 100%, making it highly reliable for confirming or ruling out infection.

An upper endoscopy, where a thin camera is passed through your mouth into the stomach, provides a direct look at the ulcer. It allows the doctor to assess the ulcer’s size and severity, check for active bleeding, and take tissue samples to test for H. pylori or rule out other conditions. Endoscopy is especially important when symptoms are severe, when there’s concern about bleeding, or when an ulcer hasn’t responded to initial treatment.

Treatment and Healing Timelines

Treatment depends on the cause. For H. pylori ulcers, the standard approach combines acid-suppressing medication with two or more antibiotics taken together for one to two weeks to kill the bacteria. After the antibiotic course, acid-suppressing medication typically continues to give the ulcer time to heal. For NSAID-caused ulcers, stopping or reducing the offending drug is the first step, paired with acid-suppressing medication.

Healing times vary by location. Duodenal ulcers (in the first part of the small intestine) tend to heal faster, with about 93% healed after six weeks of treatment. Gastric ulcers take longer: roughly 80% heal within eight weeks. Most people feel symptom relief well before the ulcer has fully closed, which is why completing the full course of treatment matters even after pain subsides.

When Ulcers Become Dangerous

Left untreated, ulcers can lead to two serious complications: bleeding and perforation. A bleeding ulcer may cause dark, tarry stools or vomit that looks like coffee grounds. You might feel lightheaded, unusually tired, or short of breath as blood loss progresses. Ulcers larger than 2 centimeters and those causing low blood pressure are more likely to require surgical intervention rather than endoscopic treatment alone.

Perforation, where the ulcer erodes completely through the stomach or intestinal wall, typically causes sudden, severe abdominal pain. Widespread abdominal tenderness from peritonitis, an infection of the abdominal cavity, occurs in about two-thirds of perforation cases. In the remaining third, the leak may be small or sealed off by surrounding tissue, producing more subtle symptoms that can delay diagnosis. Both complications are medical emergencies.