Most stomach ulcers are caused by a bacterial infection or by regular use of common pain relievers like ibuprofen and aspirin. About 10% of people will develop a peptic ulcer at some point in their lives, and in nearly every case, the cause traces back to one of these two factors rather than stress or spicy food.
A peptic ulcer is an open sore that forms in the lining of your stomach or the upper part of your small intestine (the duodenum). Your stomach lining has a built-in defense system: a thick layer of mucus that shields the tissue from the acid your stomach produces to digest food. Ulcers develop when something compromises that defense, letting acid eat into the tissue underneath.
H. Pylori: The Most Common Cause
A corkscrew-shaped bacterium called Helicobacter pylori is responsible for the majority of peptic ulcers. You can pick up H. pylori through contaminated food, water, or close contact with someone who carries it. Many people are infected during childhood and carry the bacteria for decades without symptoms. Only a fraction of carriers ever develop an ulcer, but when they do, the mechanism is straightforward.
H. pylori survives in the harsh environment of the stomach by producing an enzyme that generates ammonia, which neutralizes the acid in its immediate surroundings. That ammonia is also toxic to the cells lining your stomach. At the same time, the bacteria release substances that break down the protective mucus layer and dissolve the fatty coating on the surface of your stomach cells. Once that barrier is weakened, your own stomach acid seeps through and damages the exposed tissue, gradually creating a sore.
Testing for H. pylori is simple. A breath test, where you swallow a special solution and then breathe into a collection bag, catches the infection about 94% of the time. A stool sample test is another option, though it’s slightly less sensitive at around 77%. If H. pylori is found, a course of antibiotics combined with acid-reducing medication clears the infection and allows the ulcer to heal.
Pain Relievers That Damage the Stomach Lining
Nonsteroidal anti-inflammatory drugs, commonly called NSAIDs, are the second major cause of ulcers. This group includes ibuprofen (Advil, Motrin), naproxen (Aleve), and aspirin. These medications work by blocking an enzyme that produces hormone-like compounds called prostaglandins, which play a key role in pain and inflammation. The problem is that prostaglandins also regulate nearly every aspect of your stomach’s defense system: mucus production, blood flow to the stomach lining, and the rate at which damaged cells are replaced.
When you take an NSAID occasionally, your stomach can usually handle it. But regular use, especially daily use over weeks or months, steadily strips away these protections. With less mucus and reduced blood flow, your stomach lining becomes vulnerable to its own acid, pepsin (a digestive enzyme), and even the NSAID itself. The risk is highest for people over 60, those taking high doses, and anyone combining NSAIDs with blood thinners or corticosteroids.
If you need long-term pain relief and have a history of stomach problems, your doctor may recommend switching to a different type of pain reliever or adding a medication that helps protect the stomach lining.
What About Stress and Spicy Food?
For decades, people believed that stress and spicy food were the primary drivers of ulcers. The medical understanding has shifted considerably since then. Most experts now view stress as something that does not cause stomach ulcers on its own, though it qualifies as an accomplice. Your body’s stress response increases stomach acid production, and people under chronic stress tend to reach for more NSAIDs, drink more alcohol, and smoke more, all of which raise ulcer risk or worsen existing damage.
Spicy foods get an even cleaner pass. Multiple studies show that capsaicin, the compound that makes peppers hot, actually inhibits acid production in the stomach. Researchers have even explored capsaicin as a potential protective agent for people who take NSAIDs regularly. Spicy food can trigger abdominal discomfort if you already have an ulcer or a sensitive stomach, but it does not create one.
Less Common Causes
A small number of ulcers stem from causes beyond H. pylori and NSAIDs. One notable example is Zollinger-Ellison syndrome, a rare condition where tumors called gastrinomas form in the pancreas or duodenum. These tumors release massive amounts of a hormone called gastrin, which signals the stomach to produce far more acid than normal. The result is severe, recurring ulcers that resist standard treatment. Doctors typically suspect this condition when a patient develops stubborn ulcers without testing positive for H. pylori or having a history of NSAID use.
Smoking is another independent risk factor. It increases acid production, slows the healing of existing ulcers, and raises the chance of recurrence after treatment. Heavy alcohol use can erode the stomach lining directly and amplifies the damage from other risk factors.
Recognizing an Ulcer
The most common symptom is a burning or gnawing pain between your navel and breastbone. It often shows up when your stomach is empty, sometimes waking you at night, and temporarily improves after eating or taking an antacid. Other signs include bloating, nausea, feeling full quickly, and loss of appetite. Some ulcers, particularly those caused by NSAIDs, develop with little or no pain at all, which means they can go unnoticed until a complication arises.
When Ulcers Become Dangerous
Most ulcers heal with treatment, but untreated or severe ulcers can lead to serious complications. Bleeding is the most common one. You might notice dark, tarry stools or vomit that looks like coffee grounds, both signs of internal bleeding that need immediate attention. A perforated ulcer, where the sore burns completely through the stomach or intestinal wall, causes sudden, sharp abdominal pain and a rigid, tender abdomen. This is a surgical emergency. A third complication is obstruction, where swelling or scarring from a chronic ulcer blocks food from passing out of the stomach, leading to persistent vomiting and weight loss.
The global death rate from peptic ulcer disease has dropped significantly over the past three decades, falling from about 7 per 100,000 people in 1990 to under 3 per 100,000 in 2021, largely thanks to effective treatments for H. pylori and better acid-suppressing medications. Still, recognizing warning signs early makes a significant difference. Sudden severe abdominal pain, bloody or black stools, vomiting blood, or signs of shock like fainting and excessive sweating all warrant emergency care.

