Helicobacter pylori (H. pylori) is a common stomach infection and one of the main causes of gastritis and stomach ulcers, and it’s often checked for when you have ongoing indigestion. Testing for it is simple, but getting the preparation right matters, or the test can give a false “all clear”. This guide explains the tests, how to prepare, what treatment involves, and what happens if it doesn’t work first time.
Key points
- The usual tests are a breath test or a stool (poo) test. Both are simple and painless.
- Stop acid-reducing tablets such as omeprazole for 2 weeks before the test.
- Don’t have the test within 4 weeks of taking antibiotics for any reason.
- If you test positive, you’ll usually be offered a 7-day course of two antibiotics plus an acid-reducing tablet.
- A blood test isn’t used to check whether treatment has worked, because antibodies stay positive for a long time.
What is H. pylori?
H. pylori is a bacterium that lives in the lining of the stomach. It’s usually picked up in childhood and can stay for life without treatment. Many people never have symptoms, but in some it causes inflammation (gastritis), stomach or duodenal ulcers, and indigestion.[3]
Long-term infection is also the main risk factor for stomach cancer, although only a very small proportion of people with H. pylori ever develop it. Treating the infection lowers that risk.[3]
Why you might be tested
- ongoing indigestion (dyspepsia) or upper tummy pain[1,2]
- a stomach or duodenal ulcer, now or in the past[2]
- before long-term anti-inflammatory painkillers or aspirin, in some cases[3]
- sometimes as part of investigating iron deficiency anaemia or low B12[3,4]
Testing isn’t recommended for reflux alone, because treating H. pylori doesn’t improve reflux symptoms. See our guide to acid reflux.[2]
The tests
| Test | What happens | Good to know |
|---|---|---|
| Urea breath test | You breathe into a tube, drink a special solution, then breathe into a second tube after a short wait | Very accurate. Usually done at the GP surgery, pharmacy or hospital |
| Stool antigen test | You collect a small poo sample at home and return it | Simple and accurate. Ask for the collection kit and instructions |
| Blood test (antibodies) | A blood sample checks for antibodies to H. pylori | Used less often. It can stay positive after successful treatment, so it can’t confirm the infection has cleared |
| Biopsy at gastroscopy | Small samples taken during a gastroscopy | Used if you’re having a gastroscopy anyway |
NICE recommends a breath test or stool test, and a blood test only if it has been checked to work well locally.[1]
How to prepare
Before a breath or stool test
- Stop acid-reducing tablets (PPIs) such as omeprazole, lansoprazole or esomeprazole for 2 weeks before.[1] Ask your GP or pharmacist what to take instead. An antacid such as Gaviscon is usually fine to use.
- No antibiotics for 4 weeks before, for any infection.[1]
- For a breath test, you’ll usually be asked not to eat for a few hours beforehand. Follow the instructions you’re given.
These medicines suppress the infection without clearing it, so testing too soon can give a false negative.[1,3]
The two-week rule
I perform gastroscopies, and I take biopsies to check for H. pylori as part of that work. I also prescribe, so I see the whole path from test to treatment.
If H. pylori keeps coming back, or hasn’t cleared after first, second and third-line treatment, we can take biopsies during a gastroscopy and send them to a specialist centre, which tests which antibiotics will work. This means we can choose the right treatment for you. The test takes a little longer, so we recommend sedation if you’re able to have it. The same preparation applies: no PPI for at least 2 weeks and no antibiotics for 4 weeks beforehand, or the result can be affected.
The most common problem I come across with breath and stool tests is people still taking omeprazole when they do the test. It’s an easy mistake to make, and it can give you a false all clear. Two weeks of using antacids instead is worth it to get a result you can trust.
If you do need treatment, the best thing you can do is take every dose for the full week. The course is short, but missing doses is one of the main reasons it doesn’t work.
Ben JohnsonAdvanced Clinical Practitioner, Gastroenterology
If you test positive
Treatment is called eradication therapy: a 7-day course of two antibiotics plus a PPI, usually taken twice a day. NICE recommends a PPI with amoxicillin and either clarithromycin or metronidazole. Different antibiotics are used if you’re allergic to penicillin, or if you’ve had clarithromycin, metronidazole or a quinolone antibiotic for any infection in the past year.[2]
- Take every dose for the full 7 days, even if you feel better.
- Side effects such as a metallic taste, loose stools or feeling sick are common and usually mild.
- If you’re allergic to penicillin, tell your doctor.
- Avoid alcohol if you’re prescribed metronidazole.
If it doesn’t work
Antibiotic resistance is becoming more common, so the first course doesn’t always clear the infection.[3] If symptoms continue, your GP may offer a second course using a different combination of antibiotics. If that doesn’t work either, NICE advises seeking specialist advice. You may be offered a gastroscopy, where biopsies can be tested to see which antibiotics will work.[2]
Do I need a repeat test?
Not always. A repeat test isn’t routinely needed after treatment for indigestion, but it is recommended if you had an ulcer, or if your symptoms continue after a second course.[2] If you’re retested, it’s done at least 4 weeks after finishing the antibiotics, with the same 2-week break from PPIs, and using a breath or stool test, not a blood test.[1,3]
Frequently asked questions
How do you catch H. pylori?
It’s usually picked up in childhood, probably from close contact within families. Many people carry it for years without symptoms.
Can my family catch it from me?
Adults rarely pass it on. Family members don’t need testing unless they have symptoms.
Can I buy a test online?
Home kits are available, but a breath or stool test arranged by your GP or pharmacy is more reliable, and means treatment can be prescribed if needed. Blood test kits aren’t recommended.
Will treatment cure my indigestion?
If H. pylori was the cause, it often helps. Some people still have symptoms afterwards, because indigestion has many causes. See our guide to gastritis.
References
- NICE. Dyspepsia and gastro-oesophageal reflux disease in adults (QS96), quality statement 3: testing conditions for Helicobacter pylori. https://www.nice.org.uk/guidance/QS96/chapter/quality-statement-3-testing-conditions-for-helicobacter-pylori
- NICE. Gastro-oesophageal reflux disease and dyspepsia in adults: investigation and management (CG184). https://www.nice.org.uk/guidance/cg184
- Malfertheiner P, Megraud F, Rokkas T, et al. Management of Helicobacter pylori infection: the Maastricht VI/Florence consensus report. Gut 2022;71:1724–1762. https://gut.bmj.com/content/71/9/1724
- Snook J, et al. British Society of Gastroenterology guidelines for the management of iron deficiency anaemia in adults. Gut 2021;70:2030–2051. https://gut.bmj.com/content/70/11/2030