Peptic ulcer: the gnawing stomach pain with two fixable causes
Last updated September 3, 2026.
A peptic ulcer is an open sore in the lining of the stomach or the first stretch of the small intestine, causing a gnawing, burning pain in the upper middle abdomen. Two causes account for nearly all of them: the H. pylori bacterium and regular use of anti-inflammatory painkillers like ibuprofen and aspirin. Both are treatable, and most ulcers heal fully within weeks once the cause is addressed.
What does it feel like?
A burning or gnawing ache in the upper middle abdomen (below the breastbone), classically related to meals: stomach ulcers often hurt soon after eating, duodenal ulcers classically ease with food and wake you at night, though patterns vary. Companions: bloating, early fullness, heartburn, nausea, and sometimes vomiting. Some ulcers are silent until they bleed, which is why black stools and vomiting blood belong to nobody's watch-and-wait list.
Why does it happen?
The stomach protects itself from its own acid with a mucus lining, and ulcers form when that defense loses: H. pylori (a bacterium roughly half the world carries, mostly harmlessly, but in some it inflames and ulcerates the lining) and NSAIDs (ibuprofen, naproxen, aspirin, taken regularly: they strip the protective chemistry). Smoking, heavy alcohol, and stress worsen but do not primarily cause ulcers (the spicy-food-and-stress theory died with the H. pylori discovery). Zollinger-Ellison and other rare causes account for a small remainder.
How is it tested and treated?
- The H. pylori test: a stool antigen test, breath test, or blood test finds the bacterium; positive means eradication therapy: a one-to-two-week course of two antibiotics plus an acid-suppressing PPI, which cures the ulcer's cause in most cases.
- Stop the NSAIDs: if anti-inflammatories are the driver, they are stopped or swapped (with stomach protection if genuinely needed), and the ulcer heals on a PPI.
- Acid suppression: a PPI (omeprazole family) for four to eight weeks is the backbone, letting the crater heal; simple antacids for symptom gaps.
- Endoscopy when indicated: for alarm features, age over a threshold, failed treatment, or gastric ulcers (which get re-scoped to confirm healing).
- Confirm eradication: after H. pylori treatment, a retest (stool or breath, a few weeks after finishing) confirms the bug is gone.
When is it an emergency?
Ulcers bleed, and rarely perforate, and those are emergencies: vomiting blood or material like coffee grounds, black tarry stools, sudden severe abdominal pain (a rigid, board-like belly: possible perforation), fainting, dizziness, or a racing pulse with weakness (blood loss), and sharp pain spreading to the back with vomiting. Those go to emergency care now. The non-emergency but important flags: unintentional weight loss, persistent vomiting, difficulty swallowing, anemia symptoms, and upper-abdominal pain starting after age 55, all of which earn a prompt scope rather than a repeat prescription. Pymander's escalation routing is built and tested specifically for this class of decision; see the safety architecture working paper.
What a Pymander AI doctor consult looks like
Illustrative example, not a real member's messages.
Common questions
Is my ulcer caused by stress or spicy food?
No: that theory dominated for decades and was overturned by one of medicine's great stories: two Australians proved the H. pylori bacterium causes most ulcers (one drank a beaker of the bacteria to make the point; they won the Nobel Prize). The real cause list is short: H. pylori (the majority) and regular NSAID use (most of the rest). Stress, spice, and coffee can worsen symptoms of an existing ulcer but do not create the crater. The practical consequence is wonderful: ulcers are now usually cured, by eradicating a bacterium or stopping a pill, rather than managed for life with milk diets.
How do they test for H. pylori?
Three easy ways: the stool antigen test (a sample checked for bacterial proteins: the commonest, accurate, and cheap), the urea breath test (drink a tagged solution, breathe into a bag; the bacterium's enzyme reveals itself), and a blood antibody test (shows past or present infection, less able to prove active infection). One timing trap: PPIs and recent antibiotics can false-negative the stool and breath tests, so you may be asked to pause the acid medication for two weeks before testing. After eradication therapy, a retest a few weeks later confirms the kill, because failed eradication means the ulcer risk persists.
Why do I have to stop ibuprofen, and what can I take instead?
Because NSAIDs (ibuprofen, naproxen, aspirin) block the prostaglandins that maintain the stomach's protective mucus layer, and daily use strips that defense until acid burns through, which is exactly the pattern in your story. Paracetamol is the safe swap (no stomach-lining effect) for most pain. If you genuinely need anti-inflammatory action long-term (some arthritis), the options are the lowest effective dose with a PPI alongside, or a COX-2-selective agent, both a GP conversation. And a specific warning: restarting daily NSAIDs after an NSAID ulcer without stomach protection is how people get their second ulcer, or their first bleed.
What is the treatment actually like?
Two strands, both tolerable: acid suppression with a PPI (omeprazole or similar) once or twice daily for four to eight weeks, which relieves the pain within days and lets the crater heal; and, if H. pylori is positive, eradication therapy: a one-to-two-week course combining the PPI with two antibiotics (the exact mix depends on allergies and local resistance), which has a real pill burden and can cause taste disturbance and loose stools, but cures the underlying cause in the large majority. Then: the stool or breath retest to confirm, NSAIDs left behind, smoking stopped (it delays healing and drives recurrence), and most people are done with ulcers.
Can an ulcer come back?
It depends which cause it was: a successfully eradicated H. pylori infection rarely returns (a few percent per year in most countries), so that ulcer is essentially cured; an NSAID ulcer returns exactly as reliably as the NSAID habit does, unless protected. The recurrence multipliers: smoking (the big one), heavy alcohol, and unfinished eradication courses. If ulcer pain returns months after treatment, the move is retesting (H. pylori reinfection or failed eradication) rather than just repeating the PPI. And any ulcer pain with alarm features (weight loss, vomiting, black stools, anemia) skips the retest queue and goes straight to the scope.
What are the alarm features that mean I need a camera test?
The list that changes the pathway from treat-and-test to scope-first: unintentional weight loss, difficulty swallowing, persistent vomiting, vomiting blood or black tarry stools, anemia (or its symptoms: exhaustion, breathlessness, pallor), a palpable mass or enlarged glands, pain starting after age 55, a family history of stomach cancer, and ulcers that do not heal or recur despite correct treatment. The scope (gastroscopy) directly sees the ulcer, biopsies it (gastric ulcers especially, to exclude cancer), and often treats bleeding in the same session. The combination of new upper-abdominal pain plus any of those features is not a watch-and-wait situation.
