Peptic ulcers are open sores that develop on the inner lining of the stomach or the upper portion of the small intestine, known as the duodenum. The vast majority are caused by infection with the bacterium Helicobacter pylori or by regular use of common painkillers like ibuprofen and aspirin. Despite decades of folk wisdom blaming spicy food and stress, those factors do not cause ulcers on their own, though they can make existing ones feel worse. Understanding the real causes matters because treatment is straightforward once the right culprit is identified, and ignoring an ulcer can lead to serious complications including internal bleeding or perforation of the stomach wall.
How the Stomach Normally Protects Itself
Your stomach produces hydrochloric acid strong enough to dissolve metal, yet the organ’s own lining survives day after day. It does this through a mucus-bicarbonate barrier: a continuous layer of thick mucus gel that clings to the surface of the stomach and duodenum, while bicarbonate secreted into that gel neutralizes acid right at the tissue surface. The result is a pH gradient, strongly acidic in the open space of the stomach but close to neutral where the cells actually sit.1PubMed. Gastroduodenal mucus bicarbonate barrier: protection against acid and pepsin That same mucus layer also acts as a physical shield against pepsin, the digestive enzyme that breaks down proteins and would happily digest the stomach lining if given direct access.
Under normal conditions, pepsin chews away at the outer surface of the mucus while fresh mucus is secreted from below, maintaining a steady balance. In people who develop peptic ulcers, this balance tips. Research has shown that peptic ulcer patients produce far more of a particular pepsin variant, called pepsin 1, which is two to six times more effective at degrading mucus than the predominant form.2PubMed. Pepsins and the mucus barrier in peptic ulcer disease This means the protective gel gets stripped faster than the body can replace it, leaving patches of exposed tissue vulnerable to acid damage.3Gut. Mucus degradation by pepsin: comparison of mucolytic activity of human pepsin 1 and pepsin 3: implications in peptic ulceration
It is worth noting that gastric and duodenal ulcers, while grouped under the “peptic ulcer” umbrella, have somewhat different underlying dynamics. Duodenal ulcers tend to occur in people who produce more acid than normal, while gastric (stomach) ulcers are associated with normal or even reduced acid output alongside widespread inflammation of the stomach lining.4PubMed Central. ABC of the upper gastrointestinal tract: Pathophysiology of duodenal and gastric ulcer and gastric cancer
The Two Big Causes
Helicobacter pylori Infection
H. pylori is a spiral-shaped bacterium uniquely adapted to survive in stomach acid. Roughly half the world’s population carries it, making it one of the most widespread infections on the planet.5PubMed. Helicobacter pylori: epidemiology and routes of transmission Infection rates are higher in developing regions, where more than 80% of people may be infected, compared with under 40% in wealthier, more urbanized areas.6PubMed Central. Helicobacter pylori, transmission routes and recurrence of infection: state of the art Most people pick up the bacterium during childhood, likely through oral-oral or fecal-oral routes, and carry it for life without knowing.
The overwhelming majority of infected people never develop symptoms. About 30% go on to develop problems ranging from gastritis to peptic ulcers to, in rare cases, stomach cancer.6PubMed Central. Helicobacter pylori, transmission routes and recurrence of infection: state of the art What separates the unlucky minority from everyone else comes down partly to which strain of the bacterium they carry. H. pylori deploys an arsenal of virulence factors, proteins that help it invade, colonize, and provoke ongoing inflammation in the stomach lining.7PubMed Central. Helicobacter pylori Virulence Factors-Mechanisms of Bacterial Pathogenicity in the Gastric Microenvironment Two of the most studied are CagA and VacA, which are linked to more aggressive disease and a higher risk of ulcers and cancer.8PubMed. Influence of Helicobacter pylori virulence factors CagA and VacA on pathogenesis of gastrointestinal disorders
Host genetics also play a role. People who carry gene variants that ramp up production of inflammatory signaling molecules (such as certain forms of interleukin-1β, interleukin-8, and tumor necrosis factor-α) tend to develop more severe stomach inflammation when infected, while people with the opposite genetic profile may barely react.9PubMed Central. Helicobacter pylori virulence genes and host genetic polymorphisms as risk factors for peptic ulcer disease In other words, both the bug’s toolkit and your own immune wiring determine whether an infection stays silent or digs an ulcer.
Painkillers and Anti-Inflammatory Drugs
Nonsteroidal anti-inflammatory drugs, or NSAIDs, are the second leading cause of peptic ulcers. This category includes everyday over-the-counter medicines like ibuprofen, naproxen, and aspirin. These drugs work by blocking an enzyme called cyclooxygenase, which is involved in producing the chemical signals that cause pain and inflammation. The problem is that the same enzyme also drives production of prostaglandins, molecules that help maintain the stomach’s protective mucus layer and blood flow to the lining.10PubMed Central. The pathophysiology of non-steroidal anti-inflammatory drug (NSAID)-induced mucosal injuries in stomach and small intestine Shut down those prostaglandins, and the stomach’s defenses weaken.
A single dose of ibuprofen for a headache is unlikely to cause an ulcer. The risk climbs with regular, prolonged use and is compounded by older age, a history of prior ulcers, concurrent use of blood thinners or corticosteroids, and simultaneous H. pylori infection. People who need daily NSAIDs for conditions like arthritis are the population most at risk.
Less Common Causes
After H. pylori and NSAIDs are ruled out, a smaller group of peptic ulcers remain. These are sometimes called idiopathic ulcers, meaning their cause is unclear. Studies from Asia have found that idiopathic ulcers once represented a tiny fraction of all cases but now account for roughly 10% to 30%, a rise driven in part by falling H. pylori infection rates in younger generations.11PubMed Central. Helicobacter pylori-negative, non-steroidal anti-inflammatory drug: negative idiopathic ulcers in Asia These ulcers tend to be more stubborn than the conventional types, often responding poorly to standard treatment and recurring more frequently.12PubMed. Management of peptic ulcer disease not related to Helicobacter pylori or NSAIDs Advanced age, serious underlying illness, and chronic psychological stress are considered potential contributors.
A rare but important cause is Zollinger-Ellison syndrome, in which a tumor called a gastrinoma produces excessive amounts of the hormone gastrin, driving the stomach to secrete far more acid than normal. People with this condition often present with severe reflux, recurrent ulcers, and chronic diarrhea.13PubMed Central. Gastrinoma and Zollinger Ellison syndrome: A roadmap for the management between new and old therapies Clinicians should suspect it when ulcers keep coming back despite adequate treatment, appear in unusual locations, or are accompanied by a family history of certain endocrine tumors.14PubMed. Zollinger-Ellison Syndrome
What Peptic Ulcers Feel Like
The hallmark symptom is a burning or gnawing pain in the upper abdomen, typically between the navel and the breastbone. For duodenal ulcers, the pain often arrives when the stomach is empty and eases temporarily after eating. For gastric ulcers, eating can actually worsen the pain. Many people describe the sensation as hunger pangs that nothing fully satisfies. The discomfort may wake you at night, since acid production rises while you sleep.
Beyond pain, peptic ulcers can cause bloating, nausea, early fullness during meals, and a general loss of appetite. Some ulcers produce no obvious symptoms at all, especially in older adults or people taking NSAIDs, whose pain perception may be blunted by the same drugs causing the ulcer. This is one reason NSAID-related ulcers are sometimes diagnosed only after a complication like bleeding occurs.
Warning signs that an ulcer has become dangerous include vomiting blood (which may look red or resemble dark coffee grounds), passing black or tarry stools (a sign of bleeding in the upper digestive tract), sudden sharp abdominal pain that does not let up, and feeling faint or light-headed. Any of these warrants emergency medical attention.
How Ulcers Are Diagnosed
Upper gastrointestinal endoscopy, in which a thin camera is passed through the mouth into the stomach, is the gold-standard way to confirm an ulcer. During the same procedure, the doctor can take tissue samples to test for H. pylori and to rule out stomach cancer, which can occasionally mimic an ulcer’s appearance.
Testing for H. pylori specifically can be done several ways. Histology (examining biopsied tissue under a microscope) and the rapid urease test, both performed during endoscopy, tend to be highly sensitive. A non-invasive alternative is the urea breath test, which has shown sensitivity around 97% and perfect specificity in comparative studies.15PubMed Central. Comparison of Four Tests for the Diagnosis of Helicobacter pylori Infection A stool antigen test is another non-invasive option, though its sensitivity tends to be somewhat lower. Your doctor will choose based on context: if endoscopy is already planned for another reason, biopsy-based tests make sense; if the goal is simply to confirm infection without an invasive procedure, the breath test is usually preferred.
For people under 60 with straightforward symptoms and no alarm signs like weight loss or bleeding, some guidelines allow a “test-and-treat” approach: test for H. pylori non-invasively and, if positive, treat without endoscopy. If symptoms persist after treatment or alarm features are present, endoscopy becomes necessary.
Treatment
Killing the Infection
When H. pylori is the cause, the goal is eradication. The classic approach has been triple therapy: a proton pump inhibitor (PPI) to suppress acid plus two antibiotics, typically clarithromycin combined with amoxicillin or metronidazole, taken for 14 days. This regimen worked well for years, but rising antibiotic resistance, particularly to clarithromycin, has steadily eroded its effectiveness.16PubMed Central. The challenge of Helicobacter pylori resistance to antibiotics: the comeback of bismuth-based quadruple therapy
Bismuth-based quadruple therapy has made a comeback as a response. This regimen uses a PPI plus bismuth, metronidazole, and tetracycline. A meta-analysis found that quadruple regimens containing both clarithromycin and metronidazole consistently eradicated more than 80% of infections regardless of resistance patterns, and that adding a gastric acid inhibitor to a bismuth-containing regimen cut the impact of metronidazole resistance roughly in half.17PubMed. Meta-analysis: the effect of antibiotic resistance status on the efficacy of triple and quadruple first-line therapies for Helicobacter pylori In practice, many gastroenterologists now choose between triple and quadruple therapy based on local resistance rates. In areas where clarithromycin resistance exceeds about 15%, guidelines generally recommend skipping clarithromycin-based triple therapy altogether.
Healing the Ulcer Itself
Regardless of the cause, acid suppression is the backbone of ulcer healing. PPIs such as omeprazole, pantoprazole, and lansoprazole are the standard first-line drugs. They dramatically reduce stomach acid output, giving the damaged tissue time to repair. Duodenal ulcers typically heal within four to six weeks; gastric ulcers take longer, often six to eight weeks.
A newer class of acid-suppressing drugs, potassium-competitive acid blockers (PCABs) like vonoprazan, has drawn interest because they suppress acid faster and more consistently than PPIs. Head-to-head comparisons, however, have found that healing rates for gastric and duodenal ulcers are similar between the two classes by the end of the standard treatment period.18PubMed Central. A comparison of efficacy and safety of potassium‐competitive acid blocker and proton pump inhibitor in gastric acid‐related diseases: A systematic review and meta‐analysis PCABs may still offer an advantage in H. pylori eradication regimens, where more reliable acid control can help antibiotics work better, but for straightforward ulcer healing, PPIs remain the workhorse.
When Surgery Is Needed
Surgery for peptic ulcers has become uncommon in the age of effective acid-suppressing drugs and antibiotic therapy, but it has not disappeared. The main indications are emergencies: a perforated ulcer (when the sore eats through the full thickness of the stomach or duodenal wall), uncontrollable bleeding that endoscopic treatment fails to stop, and gastric outlet obstruction from chronic scarring.19PubMed Central. The surgical management of complicated peptic ulcer disease: An EAST video presentation
For perforated ulcers, timely repair is critical. Both open and laparoscopic techniques are used, and the choice often depends on the size of the perforation and the patient’s overall condition.20Current Surgery Reports. Surgical Management of Perforated Peptic Ulcers Perforation carries a classic set of warning signs: sudden, severe abdominal pain, a rapid heartbeat, and a rigid abdomen. A chest X-ray showing air trapped under the diaphragm confirms the diagnosis in most cases, though about 15% of perforations are missed on upright X-ray alone.21PubMed Central. Perforated peptic ulcer – an update
Preventing Ulcers If You Need NSAIDs
For people who must take NSAIDs regularly, prevention revolves around reducing gastric damage while continuing pain relief. Taking a PPI alongside a standard NSAID has been shown to reduce ulcer recurrence to rates comparable to using a selective COX-2 inhibitor, which is a type of NSAID designed to spare the stomach lining somewhat.22PubMed Central. The use of proton pump inhibitors in treating and preventing NSAID-induced mucosal damage In very high-risk patients, such as those with a prior ulcer complication, combining a COX-2 inhibitor with a PPI has effectively eliminated recurrence in clinical trials.
A network meta-analysis comparing prevention strategies in high-risk patients found that PPI monotherapy remains the most evidence-based first-line approach, with a number needed to treat of about five to six compared with placebo. PCABs and COX-2 inhibitor-plus-PPI combinations showed comparable benefit but raise questions about long-term safety and cost.23PubMed. Comparing the efficacy and safety of medications to prevent nonsteroidal anti-inflammatory drug-induced ulcers in high-risk patients: A network meta-analysis PPIs carry their own profile of long-term concerns (bone density loss, kidney effects, possible micronutrient malabsorption), so the decision to co-prescribe one should involve weighing actual ulcer risk against these secondary considerations.24PubMed Central. Nonsteroidal Anti-Inflammatory Drug-Induced Peptic Ulcer Disease
Peptic Ulcers in Children
Peptic ulcers are uncommon in children but not unheard of. In pediatric cases, clinicians distinguish between primary ulcers, usually driven by H. pylori, and secondary ulcers, which arise from physiological stress due to serious illness such as sepsis, major burns, head trauma, or conditions like sickle cell disease.25Paediatrics and Child Health. Peptic ulcer disease in children Secondary ulcers tend to appear in younger children and carry a worse prognosis. Treatment for H. pylori-positive pediatric ulcers follows the same logic as in adults: a PPI plus two antibiotics, typically for two weeks.
Perforation, the most dangerous complication, has been systematically studied in children. A review of 239 pediatric cases found a median age of 11 years, with boys affected about three-quarters of the time and duodenal perforations outnumbering gastric ones roughly three to one. Most required surgery, and mortality was about 4%.26PubMed Central. Perforated peptic ulcers in children: a systematic review These numbers are a reminder that while peptic ulcers are overwhelmingly an adult disease, pediatric cases demand prompt recognition.
Artificial Intelligence in Ulcer Diagnosis
One of the more interesting recent developments is the use of AI-assisted image analysis during endoscopy. Distinguishing a benign ulcer from early gastric cancer on a screen is not always straightforward, and the consequences of getting it wrong are significant. An AI system tested for classifying gastric cancers versus gastric ulcers achieved overall accuracy over 95% at the lesion level, with sensitivity for correctly identifying ulcers above 93%.27PubMed. Artificial intelligence-based diagnostic system classifying gastric cancers and ulcers: comparison between the original and newly developed systems
A separate multicenter study focused on a different task: classifying bleeding ulcers by severity using the Forrest classification, a system that guides decisions about whether a bleeding ulcer needs immediate treatment or can be managed conservatively. The AI system’s accuracy reached about 91% in validation data and 92% in real-time video analysis, outperforming the average endoscopist in head-to-head comparison.28PubMed. Artificial intelligence-assisted system for the assessment of Forrest classification of peptic ulcer bleeding: a multicenter diagnostic study These tools are still working their way into routine practice, but they point toward a future where AI acts as a second pair of eyes during procedures, catching subtleties that a human operator working under time pressure might miss.
The Myths That Persist
The idea that stress and diet cause ulcers dies hard. For decades before H. pylori was identified in the early 1980s, the prevailing medical wisdom held that ulcers were a psychosomatic disease, the product of a high-pressure lifestyle and too much coffee. Patients were told to relax and eat bland food. Treatments focused on neutralizing acid or surgically removing parts of the stomach. The discovery that a treatable bacterial infection was behind most ulcers was initially met with fierce skepticism from the medical establishment, and the old narrative has lingered in popular understanding ever since.
Psychological stress does appear in the literature as a possible contributor to idiopathic ulcers, but its role is modest and poorly defined compared with the clearly established causes.12PubMed. Management of peptic ulcer disease not related to Helicobacter pylori or NSAIDs Similarly, alcohol and smoking are not direct causes in the way H. pylori and NSAIDs are, though smoking slows ulcer healing and raises the risk of complications, and heavy alcohol use can irritate an already damaged lining. Spicy food, meanwhile, has never been shown to cause ulcers. It may aggravate symptoms in someone who already has one, which is probably where the myth originated, but a bowl of chili will not bore a hole in a healthy stomach.
Another persistent misconception is that drinking milk soothes an ulcer. Milk does temporarily buffer stomach acid, which can briefly ease pain, but it also stimulates acid secretion, leaving you worse off a short while later. The medical recommendation for people with active ulcers is not a special diet but rather effective acid suppression and, where indicated, antibiotics.