A gastric ulcer is an open sore that forms in the lining of the stomach, penetrating deep enough to reach the tissue layers beneath the surface. Unlike a shallow erosion that only affects the stomach’s thin inner lining, a true ulcer extends into the deeper layers of the stomach wall, which is why it causes persistent pain and can lead to serious complications if left untreated. Most gastric ulcers are caused by a bacterial infection or regular use of common pain relievers, and both causes are highly treatable once identified.
How the Stomach Normally Protects Itself
Your stomach produces hydrochloric acid strong enough to break down food, yet the organ doesn’t digest itself under normal conditions. That’s because the stomach lining has a built-in defense system. Cells in the lining secrete a thick layer of mucus, and within that mucus, bicarbonate creates a pH gradient: highly acidic on the stomach side, nearly neutral right at the cell surface. Chemical messengers called prostaglandins also play a key role, helping maintain blood flow to the lining and supporting the constant repair of surface cells.
A gastric ulcer develops when something disrupts this balance, allowing acid to eat through the mucus barrier and damage the underlying tissue. The two most common disruptors account for the vast majority of cases.
The Two Main Causes
H. pylori Infection
Helicobacter pylori is a spiral-shaped bacterium that colonizes the stomach lining. It survives in the harsh acidic environment by producing an enzyme that breaks down urea (a natural compound in the stomach) into ammonia and carbon dioxide. The ammonia neutralizes the acid immediately surrounding the bacterium, creating a livable pocket. Over time, the infection triggers chronic inflammation that weakens the protective mucus layer and leaves patches of the stomach wall exposed to acid.
Many people carry H. pylori for years without symptoms. But in a subset of carriers, the ongoing inflammation eventually progresses to an ulcer. The infection spreads through contaminated food, water, or close person-to-person contact, and it’s more common in areas with crowded living conditions.
Pain Relievers (NSAIDs)
Nonsteroidal anti-inflammatory drugs, including ibuprofen, naproxen, and aspirin, are the other major cause. These medications work by blocking enzymes involved in inflammation, but they also block the same enzymes responsible for producing prostaglandins in the stomach lining. With fewer prostaglandins, the stomach secretes less bicarbonate, blood flow to the lining drops, and the mucus barrier thins. The result is a stomach wall that’s far more vulnerable to acid damage.
Occasional use of NSAIDs rarely causes problems for most people. The risk climbs with daily or long-term use, higher doses, older age, and taking NSAIDs alongside blood thinners or corticosteroids.
What a Gastric Ulcer Feels Like
The most common symptom is a burning or gnawing pain in the upper abdomen, often between the breastbone and the navel. The pain may worsen after eating (unlike duodenal ulcers, which tend to hurt on an empty stomach). Some people feel nauseous, bloated, or full after small meals. Others lose their appetite and gradually lose weight without trying.
Milder ulcers can be surprisingly quiet. Some people have no symptoms at all until a complication develops. That’s one reason ulcers are sometimes discovered only when a person seeks care for something else, like unexplained anemia.
How Gastric Ulcers Are Diagnosed
For patients under 55 with no alarming symptoms, doctors often start with a noninvasive test for H. pylori. The urea breath test is the most accurate option: you swallow a small amount of labeled urea, and if H. pylori is present, its enzyme breaks the urea down, producing labeled carbon dioxide that shows up in your breath. This test has a sensitivity around 92 to 94%, meaning it catches the infection in the vast majority of cases. A stool antigen test is another option, though slightly less sensitive at roughly 83%.
An upper endoscopy, where a thin flexible camera is passed through the mouth into the stomach, is recommended for anyone 55 or older, or anyone with alarm symptoms: unexplained weight loss, difficulty swallowing, vomiting, signs of bleeding (like dark or bloody stools), iron deficiency anemia, or a family history of gastrointestinal cancer. During endoscopy, the doctor takes small tissue samples from the ulcer’s edges. This biopsy step is important because gastric ulcers, unlike ulcers in the first part of the small intestine, carry a small risk of being cancerous or pre-cancerous.
Treatment and Healing Time
Treatment depends on the cause but almost always involves an acid-suppressing medication. Proton pump inhibitors (PPIs) dramatically reduce the amount of acid the stomach produces, giving the ulcer a chance to heal. A typical course runs four to eight weeks.
If H. pylori is present, killing the infection is essential. The current recommended first-line approach is a 14-day course combining a PPI with bismuth and two antibiotics. This regimen has a high success rate, though your doctor may verify that the infection is gone with a follow-up breath or stool test after treatment ends. Alternative combinations exist for people who can’t tolerate the standard regimen or have antibiotic resistance.
If NSAIDs caused the ulcer, stopping the medication (or switching to an alternative pain reliever) is the most important step. The ulcer typically heals with a course of acid-suppressing medication once the offending drug is removed. For people who must continue taking NSAIDs for a chronic condition, a doctor may prescribe a PPI to take alongside the pain reliever as ongoing protection.
Complications to Be Aware Of
Roughly 10 to 20% of people with peptic ulcers develop a complication. The three most serious are bleeding, perforation, and obstruction.
- Bleeding happens when the ulcer erodes into a blood vessel. Signs include vomiting material that looks like coffee grounds, or black, tarry stools. Slow bleeding may show up only as fatigue and anemia over time.
- Perforation means the ulcer has eaten entirely through the stomach wall, allowing stomach contents to leak into the abdominal cavity. This causes sudden, severe abdominal pain and requires emergency surgery.
- Gastric outlet obstruction occurs when swelling or scarring from a chronic ulcer blocks the passage between the stomach and the small intestine, leading to persistent vomiting and inability to keep food down.
All three complications are medical emergencies. The good news is that with proper treatment, most ulcers heal completely before reaching this stage.
Diet and Lifestyle: What Actually Matters
There’s a longstanding belief that spicy foods cause ulcers or that drinking milk helps heal them. Neither is supported by evidence. The National Institute of Diabetes and Digestive and Kidney Diseases states plainly that diet and nutrition have not been found to play an important role in causing, preventing, or treating peptic ulcers, and doctors do not recommend a special diet for ulcer patients.
That said, some people notice that certain foods or drinks (alcohol, coffee, acidic foods) worsen their symptoms. Avoiding personal triggers while the ulcer heals is reasonable, but it’s the medication, not dietary changes, that does the actual healing. Smoking is one lifestyle factor that genuinely matters: it slows ulcer healing and increases the risk of recurrence.
When Ulcers Keep Coming Back
Most gastric ulcers heal and don’t return once the underlying cause is addressed. Recurrent or unusually severe ulcers, especially those not linked to H. pylori or NSAIDs, may point to a rare condition called Zollinger-Ellison syndrome. In this condition, a small tumor (usually in the pancreas or upper intestine) produces excessive amounts of a hormone called gastrin, which drives the stomach to secrete far more acid than normal. Clues include ulcers that keep returning despite treatment, chronic diarrhea alongside ulcer symptoms, or a personal or family history of certain endocrine tumors. A blood test measuring fasting gastrin levels can help confirm or rule it out.