H. pyloristomach ulcerdigestive healthconditions

H. pylori Test: The Bacterium Behind Most Stomach Ulcers

BetterHealth Africa Editorial Team 8 min read
H. pylori explained: the bacterium behind most stomach ulcers, and how it is tested.

Stomach pain that keeps coming back, especially on an empty stomach, is often blamed on food, stress or ulcers in a vague sense. Very often, the real cause is a specific, treatable bacterium called Helicobacter pylori, or H. pylori for short. It is one of the most common chronic infections in the world, it is behind the large majority of stomach and duodenal ulcers, and unlike a lot of digestive complaints, it can be tested for directly and treated.

What is H. pylori

H. pylori is a spiral-shaped bacterium that lives in the mucus lining of the stomach and is the leading identifiable cause of stomach and duodenal ulcers worldwide.

It survives the stomach's acidic environment by burrowing into the protective mucus layer and neutralising the acid immediately around it. Once settled in, it can stay for years or decades without treatment, gradually irritating and inflaming the stomach lining. That inflammation, called gastritis, is the starting point for most of what H. pylori causes: ulcers, indigestion, and in a minority of cases, more serious complications further down the line.

What causes H. pylori infection, and is it contagious

H. pylori spreads mainly through close person-to-person contact and contaminated food or water, and it is commonly cited as very high in prevalence across much of sub-Saharan Africa, often acquired in childhood.

The main routes of transmission are oral-to-oral contact (such as through saliva) and faecal-to-oral contact, typically from water or food contaminated by an infected person's stool. Crowded households, shared eating and drinking practices, and limited access to clean water and sanitation all raise the chance of transmission, which is part of why infection is so widespread in many parts of Africa and other low- and middle-income regions. Most people who carry H. pylori picked it up in early childhood, often from a family member, and many are never formally diagnosed because they never have symptoms severe enough to prompt testing.

H. pylori symptoms

Most people with H. pylori have no symptoms at all, and when symptoms do appear they are largely the same regardless of sex: upper abdominal pain, bloating, nausea, and discomfort that is often worse on an empty stomach.

  • Burning or gnawing pain in the upper abdomen, often between meals or at night when the stomach is empty
  • Bloating and excessive burping
  • Nausea, and sometimes vomiting
  • Loss of appetite or feeling full quickly after small meals
  • Reduced appetite and mild, gradual weight loss in some cases (rapid or significant weight loss is not routine and needs urgent review, covered below)

This is worth stating plainly because "symptoms of H. pylori in females" is a common search: the infection itself does not behave differently by sex. What can differ between individuals is how heavy menstrual blood loss or pregnancy-related iron and B12 demands interact with the anaemia that long-standing H. pylori gastritis can contribute to, which is covered below. The infection and its core digestive symptoms are not sex-specific.

Symptoms alone cannot confirm H. pylori

Indigestion, bloating and stomach pain have many causes besides H. pylori, including other forms of gastritis, acid reflux and, less often, other digestive conditions. A positive test is what confirms the infection, not symptoms on their own.

How H. pylori affects vitamin B12 levels

Chronic H. pylori gastritis can reduce vitamin B12 absorption over time, because long-standing inflammation lowers stomach acid and intrinsic factor production, both of which the body needs to release and absorb B12 from food.

Stomach acid is needed to separate vitamin B12 from the protein it is bound to in food, and intrinsic factor, a protein made by the stomach lining, is needed to carry B12 through the small intestine so it can be absorbed. Years of untreated H. pylori gastritis can damage the cells that produce both, which is one of several reasons some people with long-standing infection develop low B12 alongside iron-deficiency anaemia. Treating the infection does not always reverse this fully if the stomach lining has already changed, which is one more reason earlier testing and treatment are worth pursuing rather than living with vague digestive symptoms for years.

Vitamin B12 and folate testing: what low B12 looks like and how it's diagnosed

How H. pylori is tested

Four main tests can detect H. pylori: a stool antigen test, a urea breath test, a blood antibody test, and biopsy taken during an endoscopy, and only the first two plus biopsy can confirm an active, current infection. Your doctor reads any of these results alongside your symptoms and history, not in isolation.

  • Stool antigen test: checks a stool sample for H. pylori proteins. It confirms active, current infection, does not require a needle, and is also used to confirm the infection has cleared after treatment.
  • Urea breath test: you drink a labelled solution and breathe into a collection device. Bacteria present in the stomach break the solution down in a way that shows up in your breath. It confirms active infection and is considered one of the most accurate non-invasive options.
  • Blood antibody test: checks for antibodies your immune system made in response to H. pylori. It cannot confirm active infection, because antibodies often stay detectable for months or years after the bacteria have already been cleared by treatment. A positive antibody result on its own does not tell your doctor whether you are currently infected.
  • Endoscopy with biopsy: a thin camera is passed into the stomach and a tissue sample is taken and tested directly. It confirms active infection and also lets a doctor see and assess any ulcers directly, but it is more invasive and is generally reserved for people with alarm symptoms or where a closer look at the stomach lining is needed.
Four ways to test for H. pylori: stool antigen test, urea breath test, blood antibody test, and endoscopy biopsy, and which ones confirm an active infection.
Stool antigen, breath testing and biopsy confirm an active infection. Blood antibody testing only shows past exposure.

A practical note on the stool antigen and breath tests: acid-suppressing medicines and, to a lesser extent, antibiotics and bismuth-containing products can suppress H. pylori enough to cause a false negative. Most labs recommend stopping acid-suppressing medication for around two weeks, and antibiotics for a longer period, before testing. Confirm the exact preparation window with whoever is doing your test.

Stool tests explained: what a stool antigen test checks for and how to prepare

Is H. pylori dangerous? The cancer question, in context

H. pylori is classified as a Group 1 (definite) carcinogen for stomach cancer by the WHO's International Agency for Research on Cancer, a classification based on the strength of the association across large populations, and the large majority of people infected with H. pylori never develop stomach cancer.

That classification is worth reading alongside a reassuring fact: most infections cause no complications at all, or at worst contribute to an ulcer that responds well to treatment. Stomach cancer develops in a small minority of people with H. pylori, usually after decades of untreated infection and often alongside other risk factors such as smoking, a diet very high in salted or preserved foods, or a family history of stomach cancer. The classification describes population-level risk, not a forecast for any one person.

Searches for "h pylori cancer symptoms" usually want to know what a warning sign looks like versus an ordinary infection. Certain symptoms deserve prompt medical attention rather than routine testing at home, because they can point to a bleeding ulcer or, less commonly, a more serious complication:

  • Vomiting blood, or vomit that looks like coffee grounds
  • Black, tarry stools, or visible blood in the stool
  • Difficulty or pain swallowing food
  • Unexplained, ongoing weight loss
  • Persistent, severe abdominal pain that does not settle
  • A feeling of fullness after eating very little, especially if it is new and worsening

Any of the symptoms above needs urgent medical review

These are not routine H. pylori symptoms. If you or someone you know has vomiting blood, black stools, difficulty swallowing, or unexplained weight loss, seek medical care promptly rather than waiting to self-test.

H. pylori treatment

H. pylori is treated with a supervised multi-drug regimen combining antibiotics with acid-suppressing medication, prescribed and monitored by a doctor rather than self-managed.

Because a single antibiotic is rarely enough to clear the infection reliably, and antibiotic resistance is a growing concern with H. pylori worldwide, doctors typically combine two or more antibiotics with a medicine that reduces stomach acid, taken together for one to two weeks. The exact combination and duration depend on local resistance patterns, any drug allergies, and whether you have taken antibiotics for H. pylori before. This is not something to self-prescribe from what worked for a friend or family member; the right combination varies by individual and by setting.

Treatment does not always work on the first attempt, and reinfection, though less common in adults than in childhood exposure, is possible. For that reason, doctors usually recommend a follow-up stool antigen or breath test around four weeks after finishing treatment, once you are off acid-suppressing medication for the required window, to confirm the infection has cleared rather than assuming it has because symptoms improved.

What to do with your H. pylori result

  1. If you have recurring upper abdominal pain, bloating or indigestion, ask your doctor about H. pylori testing rather than only treating symptoms with antacids long-term.
  2. Choose a stool antigen test, breath test, or biopsy if you want to know whether you are currently infected; a blood antibody test alone will not answer that question.
  3. Follow the preparation instructions closely, particularly stopping acid-suppressing medication for the recommended window before a stool antigen or breath test.
  4. If you test positive, complete the full course of treatment your doctor prescribes, even after symptoms improve, and confirm eradication with a follow-up test rather than assuming it worked.
  5. Seek urgent care for vomiting blood, black stools, difficulty swallowing, or unexplained weight loss rather than waiting for a routine test.
  6. If you have had long-standing, untreated symptoms, ask your doctor whether it is worth checking a full blood count and vitamin B12 level alongside H. pylori testing.

See the digestive and infection panel BetterHealth Africa tests

View BetterHealth Africa test pricing

Frequently asked questions

What is H. pylori?+

H. pylori (Helicobacter pylori) is a spiral-shaped bacterium that lives in the mucus lining of the stomach. It is the leading identifiable cause of stomach and duodenal ulcers worldwide and one of the most common chronic bacterial infections in humans, often picked up in childhood and carried for years without symptoms.

Is H. pylori dangerous or contagious?+

H. pylori spreads through close contact and contaminated food or water, so yes, it is contagious, though not in the same way as an airborne illness. Most infections are not dangerous day to day; the bacterium is classified by the WHO's cancer research agency as a Group 1 (definite) carcinogen for stomach cancer, but the large majority of infected people never develop cancer. It is worth taking seriously enough to test for and treat, without treating a positive result as an emergency.

How is H. pylori tested?+

Four tests are used: a stool antigen test, a urea breath test, a blood antibody test, and biopsy during an endoscopy. The stool antigen test, breath test, and biopsy all confirm an active, current infection. A blood antibody test only shows that your immune system has encountered H. pylori at some point; it stays positive for a long time after treatment, so it cannot tell a past infection from a current one.

What are the symptoms of H. pylori infection?+

Most people with H. pylori have no symptoms at all. When symptoms occur, the most common are burning or gnawing upper abdominal pain (often worse on an empty stomach), bloating, nausea, excessive burping, and loss of appetite. These symptoms are the same regardless of sex. Vomiting blood, black stools, difficulty swallowing, or unexplained weight loss are not routine symptoms and need urgent medical review.

How is H. pylori treated?+

Doctors typically prescribe a combination of two or more antibiotics together with an acid-suppressing medication, taken for one to two weeks. The exact regimen depends on local antibiotic resistance patterns and your medical history, so it should be prescribed and supervised by a doctor rather than self-managed. A follow-up stool antigen or breath test, usually about four weeks after finishing treatment, confirms whether the infection has cleared.

Does H. pylori cause stomach cancer?+

H. pylori is classified as a definite (Group 1) cause of stomach cancer by the WHO's International Agency for Research on Cancer, based on strong population-level evidence. This does not mean an infected person is likely to develop cancer. Stomach cancer linked to H. pylori usually develops after decades of untreated infection and is uncommon; testing and treating the infection is a sensible precaution, not a reason for alarm.

Can H. pylori cause vitamin B12 deficiency?+

Yes, indirectly. Long-standing H. pylori gastritis can reduce stomach acid and intrinsic factor production, both needed to absorb vitamin B12 from food. This can contribute to low B12 levels over time, particularly in people who have carried an untreated infection for years. Testing B12 alongside H. pylori is worth discussing with your doctor if you have long-standing digestive symptoms or signs of anaemia.

This article is general health education, not medical advice. It is not a substitute for diagnosis or treatment by a qualified healthcare professional. H. pylori testing and treatment decisions depend on your individual history and symptoms. Always discuss your own results, and any alarm symptoms, with your doctor.