Brought to you by the American Gastroenterological Association

H. pylori (Helicobacter pylori): Testing, treatment, and protecting your stomach

Learn about H. pylori, a common stomach infection that can cause ulcers and increase the risk of stomach cancer. Find out how it is diagnosed, treated, and monitored after therapy.

What is H. pylori?​

Helicobacter pylori (H. pylori) is a bacterium that can live in the lining of your stomach. People typically get the infection early in life as babies or toddlers. Many people have H. pylori and do not know it because they may not have symptoms.

H. pylori causes stomach inflammation (gastritis). In some people, H. pylori can cause problems such as:

  • Peptic ulcers (sores in the stomach or small intestine).
  • Indigestion or stomach discomfort.
  • Low iron levels and possibly anemia (low red blood cell count)
  • A very small increased risk of stomach cancer.
  • A rare type of lymphoma that affects the stomach lining.

What are the symptoms of H. pylori?

Many people with H. pylori infection have no symptoms.

When symptoms occur, they may include:

  • Burning or aching pain in the upper abdomen.
  • Bloating.
  • Frequent burping.
  • Reflux.
  • Feeling full quickly when eating.
  • Nausea.
  • Indigestion.
  • Unexplained weight loss.
  • Loss of appetite.

If an ulcer develops, symptoms may include:

  • Sharp or burning stomach pain.
  • Bleeding, causing black or tar-like stools.
  • Vomiting blood or material that looks like coffee grounds, another sign of gastrointestinal bleeding.

Seek medical attention right away if you have signs of bleeding, severe pain, or trouble swallowing.

H pylori stomach illustration

What causes H. pylori?

H. pylori spreads from person to person, although experts do not fully understand all the ways it is transmitted. It may spread through:

  • Close contact with infected people.
  • Contaminated food or water.
  • Poor hand hygiene.

Having H. pylori does not mean you did anything wrong. It is the most common chronic bacterial infection worldwide.

Who should be tested?

Your healthcare provider may recommend testing if you:

  • Have symptoms of an ulcer.
  • Have indigestion or upper abdominal discomfort that does not go away.
  • Have a history of ulcers.
  • Have certain stomach conditions found during endoscopy.
  • Have precancerous changes in the stomach lining (for example, gastric intestinal metaplasia).
  • Have iron deficiency anemia.
  • Have a family history or other risk factors for stomach cancer.
  • Have a family member diagnosed with H. pylori.

How is H. pylori diagnosed?

Several tests can detect H. pylori. Your healthcare provider will determine which test is best for you.

You drink a special liquid and breathe into a collection bag. This test looks for signs of H. pylori in your stomach.

A stool sample is checked for evidence of H. pylori infection.

Your gastroenterologist may take small tissue samples (biopsies) from your stomach during an endoscopy to test for H. pylori. Learn more.

How is H. pylori treated?

H. pylori is treated with medications that work together to kill the bacteria and help heal the stomach lining. It is very important to take the medications as directed by your healthcare provider.

Treatment usually includes:

  • One or more antibiotics.
  • A strong acid-reducing medicine, such as a proton pump inhibitor (PPI).
  • Sometimes bismuth-containing medicines.

Treatment plans involve taking several medicines multiple times a day for two weeks. Taking every dose as prescribed is important for success.

Tips for success

  • Take all medicines exactly as prescribed.
  • Do not stop treatment early, even if you feel better.
  • Ask your healthcare provider about possible side effects.
  • Let your provider know if you miss doses or have trouble taking the medicines.

Why do I need another test after treatment?

Many people are surprised to learn that treatment should be followed by another test. AGA guidance emphasizes that it is important to confirm that H. pylori is gone after treatment. Testing is performed at least four weeks after treatment is completed.

This follow-up testing is important because:

  • Symptoms alone cannot tell whether the infection is gone.
  • Some H. pylori strains are resistant to antibiotics.
  • Persistent infection can continue to damage the stomach lining and keep you at risk for ulcers and even stomach cancer.

What happens if treatment does not work?

Sometimes H. pylori remains in the stomach after treatment. This doesn’t mean you did anything wrong.

This may happen because:

  • The bacteria are resistant to certain antibiotics.
  • Medicines were difficult to take as prescribed.
  • The infection was particularly difficult to treat.

If treatment fails, your healthcare provider may recommend a different combination of medications.

Can H. pylori lead to stomach cancer?

Most people with H. pylori will never develop stomach cancer.

However, H. pylori is the strongest known risk factor for stomach cancer, which is one reason healthcare providers recommend treating the infection when it is found. Successful treatment lowers the risk of future stomach cancer and helps prevent ulcers.

Living with H. pylori

While receiving treatment:

  • Take medicines exactly as prescribed.
  • Wash your hands regularly.
  • Eat a balanced diet with fruits, vegetables, and whole grains.
  • Stay in touch with your healthcare team if side effects occur.
  • Let adult first-degree family members and household members know, since they may need to be tested too.
  • Smoking.
  • Excess alcohol.
  • Overuse of nonsteroidal anti-inflammatory drugs (NSAIDs) such as ibuprofen or naproxen, unless directed by your healthcare provider.

These steps can help protect your stomach and support healing.

Questions to ask your healthcare provider

  • Do I need testing for H. pylori?
  • Which test is right for me?
  • What treatment do you recommend?
  • What side effects should I expect?
  • When should I be retested?
  • What happens if treatment does not work?
  • Do I have any risk factors for stomach cancer?
  • Should my family members be tested?

Empowering you with information from an AGA Clinical Practice Update (Shah S. et al., 2021)

Reviewed by

Picture of Shailja Shah, MD, MPH 

Shailja Shah, MD, MPH 

Professor of Medicine, Division of Gastroenterology, University of California, San Diego
Staff Physician, GI Section, VA San Diego Healthcare System
Cancer Control Program, Moores Cancer Center

Picture of Steven Moss, MD

Steven Moss, MD

Professor of Medicine, Brown University
Providence, RI

September 2026

AGA  GI Patient Center
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.