A peptic ulcer is an open sore in the stomach lining (a stomach or gastric ulcer) or in the duodenum, where the small intestine begins (a duodenal ulcer). Most are caused by a common stomach infection called Helicobacter pylori (H. pylori) or by pain relievers such as ibuprofen, naproxen and aspirin. With the right treatment, most ulcers heal within a couple of months. Ulcers can bleed, so black stools or vomiting blood need emergency care.
Key points
- Most ulcers cause a burning ache high in the belly. Some cause no pain at all.
- H. pylori infection and anti-inflammatory pain relievers (NSAIDs) cause most ulcers. Stress and spicy food don’t cause them.
- A breath or stool test checks for H. pylori. Some people also need a camera exam of the stomach.
- Acid-lowering medicine heals the ulcer. If you have H. pylori, a course of antibiotics clears it and keeps the ulcer from coming back.
- Call 911 if you vomit blood, pass black or bloody stools, or have sudden severe belly pain.
What causes peptic ulcers
The stomach makes strong acid to digest food. A layer of mucus normally protects its lining. An ulcer forms when something weakens that protection and acid eats into the lining.
- H. pylori. These spiral-shaped bacteria live in the stomach lining of many people worldwide, often picked up in childhood. Most never have symptoms, but in some the infection inflames the lining and leads to ulcers.
- NSAIDs. Aspirin, ibuprofen, naproxen and similar drugs reduce the stomach’s natural defenses. The risk is higher with daily use, higher doses, age over 60, past ulcers, or taking them with steroids or blood thinners.
- Less common causes include a rare tumor that makes the stomach produce too much acid (Zollinger-Ellison syndrome), and severe illness in people in intensive care.
Smoking and heavy drinking slow healing and make ulcers more likely to return.
Peptic ulcer symptoms
- Burning, gnawing or aching pain between the breastbone and the belly button
- Pain that comes on when the stomach is empty or at night, and may ease for a while after eating or taking an antacid
- Bloating, burping or feeling full quickly
- Nausea
- Poor appetite or weight loss
Older adults and people who take NSAIDs often have little or no pain. Bleeding may be the first sign.
Warning signs of complications
- Bleeding. Black, sticky stools, vomit that is red or looks like coffee grounds, feeling faint, or unusual tiredness from low blood count (anemia).
- A hole through the wall (perforation). Sudden, severe belly pain that spreads and gets worse with movement.
- Blockage. Swelling or scarring near the stomach outlet can cause repeated vomiting and feeling full after a few bites.
How it’s diagnosed
Testing for H. pylori
- Breath test. You drink a special liquid, then breathe into a bag. The test picks up a substance the bacteria release.
- Stool test. A small sample is checked for bits of the bacteria.
- Biopsy taken during an endoscopy.
Acid-lowering medicines called proton pump inhibitors (PPIs), bismuth (Pepto-Bismol) and antibiotics can hide the infection. Your doctor may ask you to stop them for a few weeks before a breath or stool test.
Upper endoscopy
A doctor passes a thin, flexible tube with a camera through your mouth to look at the stomach and duodenum while you are sedated. It is recommended if you are over 60, have warning signs such as bleeding, weight loss, trouble swallowing or vomiting, or if symptoms don’t improve with treatment. Stomach ulcers are often biopsied to make sure they aren’t cancer, and a repeat endoscopy may check that they have healed.
Treatment
Healing the ulcer
A PPI such as omeprazole, esomeprazole, lansoprazole or pantoprazole lowers acid so the ulcer can heal. It is usually taken for 4 to 8 weeks. Famotidine is an older, milder option.
Clearing H. pylori
If you have the infection, you’ll take a combination of medicines for about 14 days. Common plans include:
- A PPI with bismuth and two antibiotics (metronidazole and tetracycline)
- Vonoprazan, a newer acid blocker, with amoxicillin, sometimes plus a second antibiotic
Your doctor will choose based on what you’ve taken before and on antibiotic resistance where you live. Finish every dose, even if you feel better. Side effects can include a metallic taste, nausea, diarrhea and dark stools from bismuth. About 4 weeks after treatment ends, a breath or stool test should confirm that the infection is gone.
Stopping or protecting against NSAIDs
Stop NSAIDs if you can. Acetaminophen (Tylenol) is usually a safer choice for pain. If you need aspirin for your heart or another NSAID long term, don’t stop on your own. Your doctor may add a PPI to protect your stomach.
Treating complications
A bleeding ulcer is usually treated during an endoscopy, using clips, heat or injected medicine to seal the vessel, along with PPIs through a vein. Some people need a blood transfusion. Surgery is now rarely needed, mainly for a perforation or bleeding that can’t be stopped another way.
If you were in the hospital for a bleeding ulcer, you’ll usually go home on a PPI, with a plan to test for H. pylori and a list of pain relievers to avoid. Go back right away if you have black stools, vomit blood or feel dizzy or faint.
Lowering your risk
- Use NSAIDs at the lowest dose for the shortest time, and only when you need them.
- Ask about testing for H. pylori if you will take NSAIDs or aspirin long term, or have had an ulcer before.
- Don’t smoke, and limit alcohol.
- Wash your hands well after the toilet and before meals.
No special diet is needed. Skip any foods that seem to make your symptoms worse.
When to see a doctor
- Upper belly pain or indigestion that keeps coming back
- Symptoms that come back after treatment
- Weight loss without trying, or trouble swallowing
Call 911 or go to an emergency department if you vomit blood or material that looks like coffee grounds, pass black, tarry or bloody stools, feel faint, or have sudden, severe belly pain.
Common questions about peptic ulcers
How long does a peptic ulcer take to heal?
With medicine, most duodenal ulcers heal in about 4 weeks and stomach ulcers in about 8 weeks. Pain often eases within a few days of starting a PPI. Large ulcers, smoking and ongoing NSAID use slow healing, and some people need a repeat endoscopy to confirm a stomach ulcer has healed.
Can a stomach ulcer heal on its own?
Sometimes, but it often comes back. If H. pylori isn’t cleared or you keep taking NSAIDs, the ulcer is likely to return and may bleed. Treating the cause with antibiotics or by stopping the pain reliever is what keeps an ulcer from coming back.
Can a stomach ulcer kill you?
Rarely, but it can. A bleeding ulcer or a hole through the stomach wall can become life-threatening within hours, and there is no set timeline. Most ulcers never get that far, and fast treatment works well, so call 911 for vomiting blood, black stools or sudden severe belly pain.
What is the difference between a stomach ulcer and a duodenal ulcer?
They are both peptic ulcers, in different places. Duodenal ulcers are more common, and their pain often eases after eating. Stomach ulcer pain may get worse with food. Stomach ulcers are usually checked with a biopsy to rule out cancer, which is rare in duodenal ulcers.
Questions to ask your doctor
- Do I have H. pylori, and how will we know it’s gone?
- Do I need an endoscopy?
- Which pain relievers are safe for me?
- How long should I take acid-lowering medicine?
- What signs of bleeding should I watch for?
Learn more
- Peptic ulcers (stomach or duodenal ulcers) (National Institute of Diabetes and Digestive and Kidney Diseases)
This guide is general information and doesn’t replace advice from your own doctor. Last updated October 2026.




