How Are Stomach Ulcers Caused? H. pylori and More

Stomach ulcers are open sores that develop in the lining of the stomach when something disrupts the protective barrier that normally shields it from its own digestive acid. Two causes account for the vast majority of cases: infection with a specific bacterium and long-term use of common pain relievers. Other factors, from smoking to rare tumors, can also play a role.

H. pylori: The Bacterial Cause

A spiral-shaped bacterium called Helicobacter pylori is one of the most common causes of stomach ulcers worldwide. This organism has evolved to survive in the harsh, acidic environment of the stomach, something almost no other bacteria can do. It produces an enzyme called urease that neutralizes the acid in its immediate surroundings, creating a small pocket of safety where it can thrive. It then burrows into the thick mucus layer that coats the stomach lining, where it’s largely shielded from both acid and the immune system.

Once established, H. pylori triggers chronic inflammation in the stomach wall. This inflammation disrupts the function of the cells that produce acid, temporarily altering acid levels and weakening the protective lining over time. The combination of ongoing inflammation and a compromised mucus barrier eventually allows digestive acid to eat into the stomach wall itself, forming an ulcer. A cross-sectional study of patients undergoing endoscopy from 2009 to 2018 found that roughly one in six gastric ulcers were associated with H. pylori infection.

Many people carry H. pylori for years without developing an ulcer. Whether the infection progresses to that point depends partly on the specific strain of bacteria (some produce a toxin that causes more damage than others) and partly on the individual’s immune response.

Pain Relievers That Damage the Stomach

Nonsteroidal anti-inflammatory drugs, commonly called NSAIDs, are the other major cause. This category includes aspirin, ibuprofen, and naproxen. These drugs work by blocking the production of compounds called prostaglandins, which trigger pain and inflammation throughout the body. The problem is that those same prostaglandins also perform a critical protective job in the stomach: they stimulate the production of mucus and bicarbonate that shield the stomach lining from acid.

When you take NSAIDs regularly, prostaglandin levels in the stomach drop. The mucus layer thins, bicarbonate production falls, and blood flow to the stomach lining decreases. On top of that, the stomach’s surface has a water-repelling (hydrophobic) layer made of fatty molecules that acts as a final barrier against acid. NSAIDs disrupt this layer directly, allowing acid to seep into the tissue and cause damage. Researchers demonstrated this in the early 1980s: when aspirin stripped away this fatty surface layer, acid penetrated deeper into the stomach wall, leading to tissue death.

The risk increases with higher doses and longer use. Taking NSAIDs occasionally for a headache is unlikely to cause an ulcer, but daily use over weeks or months significantly raises the odds, especially in older adults or people who also take blood thinners.

Smoking and Alcohol

Smoking constricts blood vessels in the stomach lining, reducing blood flow and weakening the tissue’s ability to repair itself. Smokers also have higher levels of carbon monoxide in their blood, which may further starve the stomach lining of oxygen. This doesn’t typically cause ulcers on its own, but it makes the stomach more vulnerable to damage from H. pylori or NSAIDs and slows healing once an ulcer has formed.

Alcohol works differently. At moderate to high concentrations, ethanol directly injures the cells lining the stomach. It damages the surface layer, causes swelling in deeper tissue, increases the permeability of tiny blood vessels, and can trigger bleeding within the stomach wall. Alcohol also slows stomach emptying, which means the lining sits in contact with irritating substances for longer. Like smoking, heavy alcohol use is more of an amplifier than a standalone cause, but the combination of alcohol with H. pylori infection or NSAID use substantially raises ulcer risk.

Stress: What the Evidence Actually Shows

For decades, people believed that everyday psychological stress caused stomach ulcers. That turns out to be mostly wrong. Most gastroenterologists now view emotional stress as something that does not cause stomach ulcers on its own. Stress can increase acid production temporarily and may worsen symptoms of an existing ulcer, but it doesn’t create one from scratch.

There is, however, a real medical condition called a “stress ulcer” that develops in people who are critically ill. Severe physical trauma, major surgery, extensive burns, or prolonged time on a ventilator can trigger ulcers in the stomach or upper intestine. These are driven by reduced blood flow to the stomach lining during the body’s crisis response, not by worry or anxiety. The term “stress ulcer” refers specifically to this critical-illness scenario, not to a bad week at work.

Rare Causes: Excess Acid From Tumors

A small number of ulcers are caused by a condition called Zollinger-Ellison syndrome. In this condition, small tumors called gastrinomas form in the pancreas or upper intestine and pump out excessive amounts of a hormone that tells the stomach to produce acid. The result is far more acid than the stomach lining can handle, leading to severe and recurring ulcers.

Doctors consider this diagnosis when a patient has ulcers that keep coming back despite treatment, especially if there’s no evidence of H. pylori infection and no history of NSAID use. Symptoms include persistent abdominal pain between the navel and mid-chest, chronic diarrhea (sometimes the only symptom), heartburn, nausea, and unexplained weight loss. Zollinger-Ellison syndrome is rare, but it’s important to identify because standard ulcer treatments won’t resolve it.

Spicy Food Does Not Cause Ulcers

This is one of the most persistent misconceptions about stomach ulcers. Multiple studies show that spicy foods do not cause ulcers. Capsaicin, the compound that makes peppers hot, actually inhibits acid production in the stomach. It has even been studied as a potential protective agent for people who take NSAIDs regularly. Spicy food can trigger abdominal discomfort in some people, particularly those who already have an ulcer or an inflamed stomach lining, but irritation and causation are not the same thing.

How Ulcers Are Diagnosed

If your doctor suspects an ulcer, the first step is usually testing for H. pylori. The two most common non-invasive options are a breath test and a stool test. For the breath test, you breathe into a container, swallow a pill or liquid containing a specific substance, then breathe into the container again a few minutes later. If H. pylori is present, the bacteria break down the substance and produce a telltale change in your breath sample. Stool tests look for proteins or genetic material from the bacteria directly.

To see the ulcer itself, doctors use an upper endoscopy, threading a thin, flexible tube with a camera down the throat to examine the stomach lining. This also allows them to take a small tissue sample if needed. For suspected Zollinger-Ellison syndrome, blood tests measuring the acid-stimulating hormone gastrin and direct measurements of stomach acid levels help confirm the diagnosis, often followed by imaging to locate the tumors.

How H. pylori Ulcers Are Treated

When H. pylori is the cause, treatment means killing the bacteria with antibiotics while reducing stomach acid to let the ulcer heal. The current recommended approach, based on 2024 guidelines from the American College of Gastroenterology, is a 14-day course combining four medications: an acid-reducing drug taken twice daily, two different antibiotics, and a bismuth compound (the active ingredient in Pepto-Bismol) taken four times daily. This combination is called bismuth quadruple therapy.

An older regimen that paired a single antibiotic called clarithromycin with an acid reducer is no longer recommended as a first choice because bacterial resistance has made it unreliable. If the standard four-drug approach isn’t an option, alternative regimens using different antibiotic combinations are available. For NSAID-caused ulcers, the primary treatment is stopping the offending drug and taking an acid-reducing medication for several weeks to allow the lining to heal. If you need to continue taking NSAIDs for another condition, your doctor may add a protective medication to reduce stomach damage going forward.