For decades, doctors believed stress and spicy food caused peptic ulcers. We now know the truth: two specific, treatable causes account for up to 90% of all peptic ulcers—H. pylori bacteria and NSAID medications. Understanding what causes ulcers is the first step to effective treatment and prevention.
This comprehensive guide explains exactly what causes peptic ulcers, how each cause damages your digestive lining, who’s at highest risk, and why identifying the cause matters for choosing the right treatment.
Key Takeaways:
- H. pylori causes 60-90% of ulcers: This bacteria weakens the protective mucus layer, allowing acid to damage the lining
- NSAIDs cause 20-30% of ulcers: Ibuprofen, aspirin, naproxen block protective prostaglandins
- Rare causes exist: Zollinger-Ellison syndrome, Crohn’s disease, viral infections, cancer
- Stress doesn’t cause most ulcers: Psychological stress may worsen symptoms but isn’t a primary cause
- Spicy food doesn’t cause ulcers: May irritate existing ulcers but doesn’t create them
- Identifying cause is critical: H. pylori needs antibiotics; NSAID ulcers need medication changes
The Basic Mechanism: How Ulcers Form
To understand ulcer causes, you first need to understand the delicate balance in your stomach and duodenum.
The Acid-Mucus Balance
Your Stomach’s Environment:
- Produces hydrochloric acid (pH 1.5-3.5)—strong enough to dissolve metal
- This acid is essential for:
- Breaking down food (especially proteins)
- Killing ingested bacteria and pathogens
- Activating digestive enzymes
Protection System:
- Specialized cells produce thick, alkaline mucus
- This mucus layer coats the entire stomach and duodenum
- Neutralizes acid at the tissue surface
- Creates a physical barrier between acid and lining
Ulcer Formation:
When the protective mucus layer becomes damaged or depleted, acid contacts the delicate lining underneath, causing inflammation, erosion, and eventually an open sore (ulcer).
Two Main Ways This Balance Disrupts
1. Aggressive Factors Increase
- Too much acid production
- Bacteria that damage the mucus layer
- Medications that impair protection
2. Defensive Factors Decrease
- Reduced mucus production
- Decreased blood flow to lining
- Impaired healing mechanisms
Cause #1: H. pylori Infection (60-90% of Ulcers)
Helicobacter pylori is a spiral-shaped bacterium that infects the stomach lining. It’s the single most common cause of peptic ulcers worldwide.
The Discovery That Won a Nobel Prize
Until 1982, doctors believed ulcers were caused by stress and spicy food. Then Australian researchers Barry Marshall and Robin Warren discovered H. pylori in stomach biopsies from ulcer patients.
Famous Experiment: Barry Marshall drank a culture of H. pylori, developed gastritis (proving causation), and cured himself with antibiotics. This revolutionary discovery won the Nobel Prize in Medicine in 2005.
How H. pylori Causes Ulcers
Step 1: Colonization
- Bacteria enter stomach (usually in childhood)
- Use flagella (tail-like structures) to swim through mucus layer
- Attach to stomach lining cells
Step 2: Survival in Acid
- Produce urease enzyme (breaks down urea into ammonia)
- Ammonia neutralizes stomach acid around the bacteria
- Creates a protective “cloud” allowing survival in harsh environment
Step 3: Mucus Layer Damage
- Bacterial enzymes (proteases, phospholipases) degrade mucus
- Toxins (VacA, CagA) damage epithelial cells
- Inflammation reduces mucus production
Step 4: Inflammation
- Immune system responds to infection
- Chronic inflammation (gastritis) develops
- Inflammatory cells release damaging substances
- Further weakens protective barrier
Step 5: Ulcer Formation
- With mucus layer compromised, acid contacts lining
- Tissue erosion begins
- Ulcer develops over days to weeks
H. pylori Statistics
| Statistic | Value |
|---|---|
| Global prevalence | ~50% of world population infected |
| US prevalence | 30-40% of adults (higher in older adults, immigrants) |
| Ulcer patients with H. pylori | 60-70% of gastric ulcers, 80-90% of duodenal ulcers |
| Infected people who develop ulcers | 10-15% |
| Transmission | Fecal-oral, oral-oral (contaminated food/water, close contact) |
| Acquisition age | Usually childhood (before age 10) |
Why Don’t All Infected People Get Ulcers?
Only 10-15% of H. pylori-infected people develop ulcers. Why?
Bacterial Factors:
- CagA-positive strains: More virulent, higher ulcer risk
- VacA genotypes: Some produce more damaging toxins
- Bacterial load: Higher numbers of bacteria increase risk
Host Factors:
- Genetic susceptibility: Some people’s immune systems respond more aggressively
- Acid production: People who naturally produce more acid at higher risk
- Blood type: Type O associated with higher duodenal ulcer risk
- IL-1β polymorphisms: Genetic variations in inflammatory response
Environmental Factors:
- Smoking: Doubles ulcer risk in H. pylori-infected people
- NSAID use: Synergistic effect (H. pylori + NSAIDs = much higher risk)
- Diet: Low fruit/vegetable intake may increase risk
- Stress: May worsen outcomes (though doesn’t directly cause)
Symptoms of H. pylori Infection
Many people have NO symptoms (asymptomatic colonization)
When symptoms occur:
- Burning or gnawing pain in upper abdomen
- Pain worse when stomach is empty (between meals, at night)
- Bloating
- Belching
- Nausea
- Loss of appetite
- Unintentional weight loss (less common)
Important: Symptoms alone can’t distinguish H. pylori from other causes. Testing is required.
Diagnosing H. pylori
Non-Invasive Tests:
| Test | How It Works | Accuracy | Best For |
|---|---|---|---|
| Urea breath test | Drink urea solution; blow into bag; detects labeled CO2 if bacteria present | 95-98% | Initial diagnosis, confirming eradication |
| Stool antigen test | Detects H. pylori protein in stool | 90-95% | Initial diagnosis, confirming eradication |
| Blood antibody test | Detects antibodies to H. pylori | 70-80% | NOT recommended (can’t distinguish active vs. past infection) |
Invasive Tests (during endoscopy):
| Test | How It Works | Accuracy |
|---|---|---|
| Rapid urease test | Biopsy tissue placed in urea medium; color change if positive | 90-95% |
| Histology | Biopsy examined under microscope for bacteria | 95-98% |
| Culture | Biopsy grown in lab; tests antibiotic sensitivity | 100% (but slow and technically difficult) |
Important: Stop the following before testing to avoid false negatives:
- PPIs (omeprazole, etc.): Stop 2 weeks before
- Antibiotics: Stop 4 weeks before
- Bismuth (Pepto-Bismol): Stop 4 weeks before
Cause #2: NSAIDs (20-30% of Ulcers)
Nonsteroidal anti-inflammatory drugs (NSAIDs) are the second most common cause of peptic ulcers.
Common NSAIDs
Over-the-Counter:
- Ibuprofen (Advil, Motrin)
- Naproxen (Aleve)
- Aspirin (Bayer, Ecotrin)
Prescription:
- Diclofenac (Voltaren)
- Indomethacin (Indocin)
- Meloxicam (Mobic)
- Celecoxib (Celebrex) - COX-2 selective
- Ketorolac (Toradol)
Note: Acetaminophen (Tylenol) is NOT an NSAID and does NOT cause ulcers.
How NSAIDs Cause Ulcers
Normal Protective Mechanism:
- Stomach lining cells produce prostaglandins (hormone-like substances)
- Prostaglandins stimulate:
- Mucus production
- Bicarbonate secretion (neutralizes acid)
- Blood flow to lining (aids healing)
- Cell renewal
NSAID Effect:
- NSAIDs block COX-1 enzyme (cyclooxygenase-1)
- COX-1 is needed to make protective prostaglandins
- With prostaglandins depleted:
- Mucus production decreases
- Blood flow reduces
- Healing is impaired
- Acid damages exposed lining
Direct Irritation:
- NSAIDs are weak acids
- In acidic stomach, they become non-ionized and can penetrate cells
- Once inside cells, they ionize and become trapped, causing direct damage
NSAID Ulcer Risk Factors
Not everyone who takes NSAIDs develops ulcers. Risk varies dramatically based on individual factors.
High Risk (10-30% annual ulcer risk):
- Previous ulcer disease
- Age >65
- High-dose NSAID use
- Multiple NSAIDs (e.g., aspirin + ibuprofen)
- Concurrent anticoagulant use (warfarin, Eliquis, etc.)
- Concurrent corticosteroid use
- Serious comorbidities (heart disease, diabetes, kidney disease)
Moderate Risk (3-10% annual ulcer risk):
- Age 50-65
- Moderate-dose NSAID use
- One additional risk factor
Low Risk (<3% annual ulcer risk):
- Age <50
- Low-dose, short-term use
- No additional risk factors
Duration and Dose Matter
Dose-Response Relationship:
- Higher doses = higher risk
- But even low-dose aspirin (81mg) increases risk 2-4x
Duration:
- Risk highest in first 3 months of use
- But ulcers can develop at any time
- Long-term users: 15-30% develop ulcers within 3-6 months
Route of Administration:
- Oral NSAIDs: Highest risk
- Injectable NSAIDs: Still cause ulcers (systemic effect)
- Topical NSAIDs: Lower risk, but not zero
Aspirin: A Special Case
Low-Dose Aspirin (81mg daily):
- Widely used for cardiovascular protection
- Doubles to quadruples ulcer risk even at low doses
- 30-50% of regular low-dose aspirin users have gastric erosions
- Risk increases with age and H. pylori co-infection
Key Point: Enteric-coated or buffered aspirin does NOT significantly reduce ulcer risk (coating dissolves in intestine, but systemic prostaglandin inhibition still occurs).
NSAID + H. pylori: Dangerous Combination
Having both risk factors multiplies your risk:
| Risk Factor | Relative Risk |
|---|---|
| Neither | 1x (baseline) |
| H. pylori alone | 3-5x |
| NSAID alone | 5-10x |
| Both H. pylori + NSAID | 20-50x |
Clinical Implication: All patients starting long-term NSAID therapy should be tested for H. pylori and treated if positive.
Rare Causes of Peptic Ulcers
While H. pylori and NSAIDs account for most ulcers, other causes exist—especially when neither is present.
Zollinger-Ellison Syndrome (Gastrinoma)
What It Is:
- Rare tumor (gastrinoma) that secretes gastrin hormone
- Gastrin stimulates excessive acid production
- Leads to severe, recurrent ulcers
Epidemiology:
- 1-3 cases per million people
- Can occur at any age (peak 35-50)
- 25% associated with MEN1 syndrome (genetic condition)
Clinical Features:
- Multiple ulcers (not just one)
- Ulcers in unusual locations (jejunum, not just stomach/duodenum)
- Ulcers resistant to standard treatment
- Severe symptoms
- Diarrhea (from acid inactivating pancreatic enzymes)
- Weight loss
Diagnosis:
- Fasting serum gastrin level >1000 pg/mL (normal <100)
- Gastric acid analysis (very high acid output)
- Imaging (CT, MRI, somatostatin receptor scan) to locate tumor
Treatment:
- High-dose PPIs (often lifelong)
- Surgical removal of tumor (if localized)
- Treatment of metastases (if malignant)
Crohn’s Disease
What It Is:
- Inflammatory bowel disease that can affect any part of GI tract
- Rarely involves stomach/duodenum (<5% of cases)
How It Causes Ulcers:
- Chronic inflammation damages lining
- Ulcers may be deep, penetrating
Diagnosis:
- Endoscopy with biopsy
- Other signs of Crohn’s (ileitis, colitis)
- Imaging showing characteristic findings
Treatment:
- Treat underlying Crohn’s disease
- Immunosuppressants, biologics
- PPIs for symptom control
Viral Infections
Cytomegalovirus (CMV):
- Usually in immunocompromised patients (HIV/AIDS, transplant recipients)
- Can cause large, deep ulcers
- Diagnosis: Biopsy with characteristic “owl’s eye” inclusions
- Treatment: Antiviral medications (ganciclovir, valganciclovir)
Herpes Simplex Virus (HSV):
- Rare cause of esophageal/gastric ulcers
- Immunocompromised patients
- Diagnosis: Biopsy with viral inclusions
- Treatment: Antiviral medications (acyclovir, valacyclovir)
Malignancy (Cancer)
Gastric Cancer:
- Can present as ulcerated lesion
- May mimic benign gastric ulcer
- All gastric ulcers require biopsy to rule out cancer
Lymphoma (MALT lymphoma):
- Associated with H. pylori infection
- Can present with ulcer-like symptoms
- Often resolves with H. pylori eradication alone
Diagnosis:
- Endoscopy with multiple biopsies
- Biopsy appearance distinguishes malignant from benign ulcers
Other Rare Causes
| Cause | Mechanism | Key Features |
|---|---|---|
| Bisphosphonates | Direct mucosal injury (alendronate, risedronate) | Esophageal ulcers more common; take upright with water |
| Potassium supplements | Direct irritation | Usually esophageal; take with food |
| Iron supplements | Direct irritation | Gastric ulcers; often with high doses |
| Mycophenolate | Immunosuppressant side effect | Transplant patients |
| Radiation therapy | Radiation gastritis | History of abdominal/chest radiation |
| Ischemia | Reduced blood flow | Elderly, vascular disease; medical emergency |
| Caustic ingestion | Chemical burn | Intentional or accidental ingestion of corrosive substances |
Factors That Don’t Cause Ulcers (Common Myths)
Despite widespread belief, these factors are NOT primary causes of peptic ulcers:
Psychological Stress
The Myth: Work stress, relationship problems, or anxiety cause ulcers.
The Reality:
- No evidence that psychological stress causes ulcers
- Stress may worsen symptoms in people who already have ulcers
- Stress may affect healing indirectly (poor sleep, unhealthy coping behaviors)
- Exception: Severe PHYSIOLOGICAL stress (see below)
Spicy Food
The Myth: Hot peppers and spicy cuisine cause ulcers.
The Reality:
- No evidence that spicy food causes ulcers
- Capsaicin (in chili peppers) may actually PROTECT against ulcers in some studies
- Spicy food may irritate EXISTING ulcers (makes symptoms worse)
- Cultural correlation (some high-spice cultures have high H. pylori rates) led to false assumption
Caffeine
The Myth: Coffee and caffeine cause ulcers.
The Reality:
- Caffeine stimulates acid production but doesn’t cause ulcers directly
- May worsen symptoms in people with existing ulcers
- Decaf coffee also stimulates acid
- Moderate consumption is generally safe
Alcohol
The Reality:
- Heavy alcohol use can irritate the stomach lining
- May increase risk of gastritis (inflammation)
- But NOT a major cause of peptic ulcers
- May worsen symptoms and delay healing
- Heavy drinkers often have other risk factors (smoking, NSAID use, poor nutrition)
Important Exception: Stress-Related Mucosal Injury
While everyday psychological stress doesn’t cause ulcers, severe physiological stress can cause a specific type of ulcer:
Stress Ulcers
What They Are:
- Acute erosions/ulcers from critical illness
- Occur in stomach and duodenum
- Develop rapidly (hours to days)
Who’s At Risk:
- Mechanical ventilation >48 hours (highest risk)
- Coagulopathy (bleeding disorder)
- Severe burns (Curling’s ulcers)
- Head trauma/surgery (Cushing’s ulcers)
- Sepsis
- Major surgery
- Multiple organ failure
- ICU patients (especially with multiple risk factors)
Mechanism:
- Reduced blood flow to stomach lining (splanchnic hypoperfusion)
- Impaired mucus production
- Increased acid (in some conditions like head trauma)
Prevention in ICU:
- PPIs or H2 blockers for high-risk patients
- Early enteral feeding
- Treat underlying illness
Key Point: These are different from typical peptic ulcers and require different management.
Risk Factors That Worsen Outcomes
These factors don’t directly cause ulcers but increase risk of complications or impair healing:
Smoking
Effects:
- Doubles ulcer risk in H. pylori-infected people
- Impairs ulcer healing
- Increases recurrence rate
- Increases complication risk (bleeding, perforation)
Mechanism:
- Reduces blood flow to lining
- Decreases mucus/bicarbonate production
- Increases acid secretion
- Impairs immune response to H. pylori
Good News: Quitting smoking improves healing rates to match non-smokers.
Genetics
Family History:
- First-degree relative with ulcer = 2-3x increased risk
- Blood type O associated with duodenal ulcers
- Genetic variations in inflammatory cytokines (IL-1β, TNF-α) affect risk
Age
Older Adults:
- More likely to take NSAIDs
- Higher prevalence of H. pylori (older generations)
- Reduced mucus production
- Slower healing
- More comorbidities
- Higher complication rates
Identifying Your Cause: A Clinical Approach
If you have an ulcer, identifying the cause guides treatment:
Step 1: Medication Review
- List all prescription and OTC medications
- Include supplements
- Note frequency and duration of NSAID use
Step 2: H. pylori Testing
- Urea breath test or stool antigen test (if not on PPI/antibiotics)
- Or biopsy during endoscopy
Step 3: Risk Factor Assessment
- Smoking status
- Alcohol use
- Family history
- Comorbidities
Step 4: Endoscopy (if indicated)
- Visualize ulcer
- Biopsy gastric ulcers (rule out cancer)
- Test for H. pylori
- Assess for other causes
Results Guide Treatment:
- H. pylori positive: Antibiotics + acid suppression
- NSAID-induced: Stop NSAID (if possible) + acid suppression
- Both: Antibiotics + stop NSAID + acid suppression
- Neither: Investigate rare causes, long-term acid suppression
Frequently Asked Questions
Can stress cause ulcers?
Everyday psychological stress (work, relationships, finances) does NOT cause peptic ulcers. However:
- Severe PHYSIOLOGICAL stress (critical illness, major burns, head trauma) CAN cause stress ulcers
- Stress may worsen symptoms in people who already have ulcers
- Stress may lead to behaviors that increase risk (smoking, drinking, NSAID use)
Can spicy food cause ulcers?
No. Spicy food does not cause ulcers. However:
- It may irritate existing ulcers and worsen symptoms
- Some people with ulcers find spicy foods trigger pain
- Capsaicin (in chili peppers) may actually have protective effects
If I have H. pylori, will I definitely get an ulcer?
No. Only 10-15% of people with H. pylori develop ulcers. Most infected people remain asymptomatic. Your risk depends on:
- Bacterial strain (CagA-positive more virulent)
- Your genetics and immune response
- Acid production level
- Other risk factors (smoking, NSAID use)
Can I get an ulcer if I don’t take NSAIDs and don’t have H. pylori?
Yes, but it’s uncommon. Possible causes include:
- Zollinger-Ellison syndrome (gastrinoma)
- Crohn’s disease
- Viral infections (CMV, HSV)
- Certain medications (bisphosphonates, potassium, iron)
- Cancer
- Ischemia
If neither H. pylori nor NSAIDs are present, further investigation is needed.
Is aspirin safer than other NSAIDs for ulcers?
No. Even low-dose aspirin (81mg) significantly increases ulcer risk:
- Doubles to quadruples risk
- Causes gastric erosions in 30-50% of regular users
- Enteric coating does NOT reduce risk
- Risk is higher if combined with other NSAIDs or H. pylori present
Can children get peptic ulcers?
Yes, but it’s less common than in adults. Causes in children include:
- H. pylori infection (most common)
- Severe illness/stress (stress ulcers)
- Certain medications
- Underlying conditions (Crohn’s disease, Zollinger-Ellison syndrome)
How long does it take for an NSAID to cause an ulcer?
Ulcers can develop:
- As early as a few days
- Most commonly within 3-6 months of regular use
- Risk is highest in the first 3 months
- But ulcers can develop at any time during use
Can probiotics prevent ulcers?
Probiotics may have a modest supportive role:
- Some strains may reduce H. pylori colonization
- May reduce side effects of H. pylori treatment
- May support gut barrier function
- But probiotics alone won’t prevent or cure ulcers
Conclusion
Peptic ulcers have specific, identifiable causes in the vast majority of cases. H. pylori bacteria and NSAID medications account for up to 90% of all ulcers—and both are preventable and treatable.
Understanding the cause matters because:
- H. pylori ulcers require antibiotics to eradicate the bacteria (prevents recurrence)
- NSAID ulcers require stopping or reducing the offending medication
- Rare causes need specialized testing and treatment
- Correct diagnosis prevents unnecessary long-term medication use
If you have ulcer symptoms, don’t assume it’s “just stress” or something you ate. See a healthcare provider for proper testing—especially for H. pylori. With the right diagnosis and treatment, most ulcers heal completely and don’t return.
Related Articles:
- Peptic Ulcer Symptoms: Recognizing the Warning Signs
- Peptic Ulcer Treatment: Medications, Diet, and Lifestyle
- H. pylori Infection: Complete Guide to Symptoms and Treatment
- NSAIDs and Digestive Health: Protecting Your Stomach
- Gastritis: Causes, Symptoms, and Treatment
Sources
- NIDDK - Peptic Ulcers (Stomach Ulcers) - National Institute of Diabetes and Digestive and Kidney Diseases - 2020 - https://www.niddk.nih.gov/health-information/digestive-diseases/peptic-ulcers-stomach-ulcers
- Mayo Clinic - Peptic Ulcer - 2025 - https://www.mayoclinic.org/diseases-conditions/peptic-ulcer/symptoms-causes/syc-20354223
- American College of Gastroenterology - ACG Clinical Guideline: Treatment of Helicobacter pylori Infection - 2024 - https://gi.org/topics/irritable-bowel-syndrome/journals-publications/ebgi/schoenfeld_sep2024/
- Chey WD, et al. - ACG Clinical Guideline: Diagnosis and Treatment of Helicobacter pylori Infection - American Journal of Gastroenterology - 2024 - https://journals.lww.com/ajg/Fulltext/2024/02000/ACG_Clinical_Guideline__Diagnosis_and_Treatment.12.aspx
- Lanza FL, et al. - Guidelines for prevention of NSAID-related ulcer complications - American Journal of Gastroenterology - 2023 - https://journals.lww.com/ajg/Fulltext/2023/03000/Guidelines_for_Prevention_of_NSAID_Related_Ulcer.15.aspx
- WHO - Helicobacter pylori fact sheet - World Health Organization - 2024 - https://www.who.int/news-room/fact-sheets/detail/helicobacter-pylori
- NHS - Stomach ulcer - Causes - 2023 - https://www.nhs.uk/conditions/stomach-ulcer/causes/
- UpToDate - Pathogenesis and clinical manifestations of NSAID-induced gastropathy - 2025 - https://www.uptodate.com/contents/pathogenesis-and-clinical-manifestations-of-nsaid-induced-gastropathy
- Marshall BJ, Warren JR - Unidentified curved bacilli in the stomach of patients with gastritis and peptic ulceration - The Lancet - 1984 - https://www.thelancet.com/journals/lancet/article/PIIS0140-6736(84)91816-6/fulltext
- World Gastroenterology Organisation - WGO Global Guideline: Helicobacter pylori - 2024 - https://www.worldgastroenterology.org/guidelines/helicobacter-pylori