What should you eat if you have H. pylori?
Written by the HpyloriTest.com editorial team. Updated on .
Key facts
- There's no special diet for H. pylori. Doctors don't advise a special diet, or avoiding particular foods or drinks, to prevent or treat ulcers (NIDDK).
- Food doesn't clear the bacteria. Antibiotics and an acid-reducing medicine do (MedlinePlus).
- You can check for H. pylori at home with a stool antigen test, with a result in 10 minutes.
Does diet cause H. pylori?
No. H. pylori is an infection. It may spread through saliva, vomit or stool, or through food and water that carry the bacteria (NIDDK).
What is worth eating?
Whatever you can eat comfortably. If your stomach is sore:
- eat smaller meals
- notice which foods set your symptoms off, and ease up on those
- keep eating a mix of foods
Some people find certain foods trigger indigestion, though foods aren't thought to cause it (NIDDK). A sample day is in our H. pylori meal plan.
What matters more than diet?
Knowing whether you have H. pylori. A stool antigen test shows an infection you have now. If it's positive, treatment is what clears it.
How to do the home test
- Catch a stool sample and dip the end of the sampling stick into it.
- Put the stick back in the tube, then stir and turn it for about 10 seconds.
- Squeeze 2 drops into the round sample hole on the test.
- Lay the test flat and read it at 10 minutes.
Our step-by-step instructions and video walk you through each stage.
Before you test
Ask your doctor before stopping a PPI such as Prilosec or Nexium. If they agree, stop it 2 weeks before you test. Test at least 4 weeks after your last dose of antibiotics or bismuth (Pepto-Bismol) (ACG), and never cut a course of antibiotics short.
What your result means
- C and T lines: H. pylori detected. Take your result to your doctor to talk about treatment.
- C line only: not detected.
- No C line: the test didn't work. Use a new test.
When to see a doctor instead
See a doctor right away, instead of testing at home, if you have:
- trouble swallowing
- weight loss you can't explain
- vomiting that keeps coming back
If you're vomiting blood or passing black, tarry stools, call 911.
Frequently asked questions
Are there foods to avoid?
None are banned. See foods to avoid with H. pylori.

Test at home today
One stool antigen test with everything you need. Your result in 10 minutes, delivered to your door in the US.
Sources
- NIDDK. Eating, diet and nutrition for peptic ulcers. Last reviewed September 2022. www.niddk.nih.gov/health-information/digestive-diseases/peptic-ulcers-stomach-ulcers/eating-diet-nutrition
- MedlinePlus, US National Library of Medicine. Helicobacter pylori infections. Last updated August 24, 2025. medlineplus.gov/helicobacterpyloriinfections.html
- National Institute of Diabetes and Digestive and Kidney Diseases (NIDDK). Symptoms and causes of peptic ulcers. Last reviewed September 2022. www.niddk.nih.gov/health-information/digestive-diseases/peptic-ulcers-stomach-ulcers/symptoms-causes
- NIDDK. Symptoms and causes of indigestion. Last reviewed March 2025. www.niddk.nih.gov/health-information/digestive-diseases/indigestion-dyspepsia/symptoms-causes
- Chey WD, et al. ACG Clinical Guideline: Treatment of Helicobacter pylori Infection. Am J Gastroenterol. 2024. Guideline highlights, American College of Gastroenterology. mediacdn.gi.org/giorgcdn/wp-content/uploads/2025/01/ACG-Hpylori-Guidelines-Highlights-2024-FINAL.pdf.pdf
- MedlinePlus Medical Encyclopedia. Gastrointestinal bleeding. Reviewed January 24, 2025. medlineplus.gov/ency/article/003133.htm
First published November 2026.