Helicobacter pylori—usually written as H. pylori—is a bacterium that can live in the stomach lining. Many people carry it without knowing, but it can cause gastritis and is an important cause of stomach and duodenal ulcers.
Several tests can detect the infection. The urea breath test and stool antigen test are the main non-invasive options. A biopsy can also be tested for H. pylori, but obtaining one requires a gastroscopy and is normally reserved for people who need the stomach examined for another clinical reason.
The tests are all useful, but they are not interchangeable in every situation. Medication, recent treatment and poor preparation can suppress the bacteria and produce a false-negative result. Choosing the right test—and taking it at the right time—is therefore as important as the laboratory method itself.
This guide provides general information. Follow the instructions from your GP, hospital or testing provider and do not stop prescribed medication without checking that it is safe to do so.
What is H. pylori and why is it tested?
H. pylori is adapted to survive in the acidic environment of the stomach. It can remain there for many years unless it is treated, although most infected people never develop a serious problem.
In some people, the infection causes ongoing inflammation of the stomach lining. It is strongly associated with peptic ulcers and can increase the long-term risk of certain forms of stomach cancer. It is also associated with a rare type of lymphoma affecting the stomach called gastric MALT lymphoma.
A clinician may consider testing when someone has persistent or recurring indigestion, upper abdominal discomfort, a confirmed or suspected ulcer, or a history that makes H. pylori clinically relevant.
The symptoms are not specific. Indigestion, nausea, bloating and upper abdominal pain can have many causes, including acid reflux, medication, functional dyspepsia and gallbladder disease. A positive test does not prove that every symptom is being caused by the infection.
Our guide to stomach ulcers, H. pylori and treatment explains how the bacterium damages the protective stomach lining and why eradication can help prevent ulcer recurrence.
Breath test, stool test or biopsy: a quick comparison
| Test | What it detects | Main advantages | Main limitations |
|---|---|---|---|
| Urea breath test | Urease activity from an active infection | Accurate, non-invasive and useful before or after treatment | Usually requires fasting and an in-person or carefully managed postal test |
| Stool antigen test | H. pylori antigens in a stool sample | Accurate, convenient and suitable for confirming eradication | Requires collecting a stool sample; home rapid tests may be less dependable |
| Biopsy-based testing | Bacteria, urease activity or tissue changes in stomach samples | Allows the stomach to be examined and other disease to be assessed | Invasive, more expensive and not needed solely for routine testing |
For many adults without warning signs, a breath or stool test is sufficient. A biopsy is not automatically a “better” test simply because it is more invasive.
The best choice depends on why testing is being performed. Someone with uncomplicated indigestion needs a different approach from a person with bleeding, unexplained weight loss, anaemia or a stomach ulcer seen during gastroscopy.
How does the urea breath test work?
H. pylori produces an enzyme called urease. This enzyme breaks down urea into other substances, including carbon dioxide.
For the breath test, you first provide a baseline sample by breathing into a collection tube or bag. You then swallow a drink or tablet containing urea labelled with a harmless carbon marker. If active H. pylori bacteria are present, they break down the urea and labelled carbon dioxide can be detected in a later breath sample.
Most UK services use carbon-13, a stable, non-radioactive isotope. The procedure is generally called the carbon-13 urea breath test or 13C-UBT. Carbon-14 tests use a very small amount of radiation but are less commonly used in routine UK practice.
The test itself is painless. The appointment may take around 20 to 40 minutes, depending on the protocol and the interval required between samples.
Some services ask patients to attend a clinic, while others provide a kit that can be completed at home and returned to a laboratory. Careful timing and labelling are essential for postal kits.
How accurate is the H. pylori breath test?
When properly performed and not affected by medication, the urea breath test is highly accurate for detecting an active infection. It is often regarded as one of the strongest non-invasive testing options.
It can be used for an initial diagnosis and to check whether treatment has successfully eradicated the bacteria. Unlike an antibody blood test, it should become negative when there is no longer an active infection.
Its accuracy depends heavily on preparation. Proton pump inhibitors, antibiotics and bismuth can temporarily suppress H. pylori. The remaining bacterial activity may be too low for the breath test to detect, producing a negative result even though the infection has not truly cleared.
The breath test can also be less convenient when a patient cannot follow the fasting instructions or has difficulty providing an adequate breath sample. These problems are uncommon in most adults but may influence the choice for a young child or someone with significant respiratory difficulties.
A positive result is usually reliable. When a negative result does not fit the clinical picture, a clinician should check whether the test was performed after the correct medication washout period.
How does the H. pylori stool antigen test work?
The stool antigen test looks for parts of the H. pylori bacterium in a small sample of faeces. It therefore detects evidence of a current infection rather than a past immune response.
The patient collects a small amount using the container and sampling tool supplied by the GP surgery, hospital or laboratory. The sample is returned according to the instructions, which may include storage and time limits.
A laboratory-based monoclonal stool antigen test is generally the preferred form. These tests use antibodies designed to recognise H. pylori antigens and can provide good accuracy when performed at the correct time.
Stool testing is particularly practical in primary care because it does not require a specialist appointment or endoscopy. It is also useful for children and people who cannot complete a breath test.
Some people understandably dislike handling a stool sample, but only a small quantity is normally required. The collection should not be taken from toilet water or mixed with urine unless the laboratory’s instructions specifically allow this.
How accurate is the stool antigen test?
A good laboratory stool antigen test is also highly accurate for active H. pylori infection. In routine care, it is a reasonable alternative to the urea breath test for both initial diagnosis and post-treatment testing.
As with breath testing, medication can cause false negatives. A negative stool result is less reassuring if the sample was collected while taking a PPI or soon after antibiotics.
Not every product sold online is equivalent to a laboratory test. Some home kits use a rapid lateral-flow method and provide a visual result within minutes. Their convenience is appealing, but their accuracy and quality control can vary.
A home test may also leave the user without an appropriate review of symptoms or a treatment plan. Buying antibiotics online after a self-test is unsafe because treatment choice depends on allergy history, previous antibiotic exposure and local resistance patterns.
If you want private testing, choose a service that uses an accredited laboratory, identifies the method and provides a clear route for clinical follow-up. Avoid assuming that a positive strip from an unverified marketplace kit is a complete diagnosis.
How is H. pylori detected through a biopsy?
A biopsy is a tiny sample of tissue taken from the stomach lining during a gastroscopy. A flexible camera is passed through the mouth, down the oesophagus and into the stomach and first part of the small bowel.
The endoscopist can inspect the lining for inflammation, ulcers, bleeding and other abnormalities. Several biopsy methods may then be used to look for H. pylori.
A rapid urease test places tissue in a material that changes colour when urease activity is present. Histology allows a pathologist to examine the tissue under a microscope for bacteria, inflammation, atrophy, intestinal metaplasia and other changes.
In selected cases, tissue may be used for culture or molecular testing. This can help investigate antibiotic resistance, particularly when eradication treatment has repeatedly failed. These methods are not available in every laboratory.
The value of biopsy is not simply that it tests for the bacterium. It allows the clinician to examine the stomach and investigate other potential causes at the same time. Our guide to gastroscopy and what it can show explains the procedure, sedation and recovery in more detail.
Is a biopsy more accurate than a breath or stool test?
Not necessarily. Biopsy tests can provide valuable additional information, but they can still miss an infection.
H. pylori may be distributed unevenly across the stomach lining. If bacteria are sparse or absent in the small area sampled, the biopsy can be negative even though infection exists elsewhere.
Taking samples from more than one appropriate stomach site improves detection. The result can also depend on which biopsy method is used and the experience of the laboratory.
PPIs, antibiotics, bismuth and recent gastrointestinal bleeding may reduce the sensitivity of biopsy-based testing. It is therefore incorrect to assume that endoscopy completely removes the need for medication preparation.
A biopsy is usually chosen because gastroscopy itself is clinically indicated—not because every patient with possible H. pylori needs the most invasive test. For uncomplicated dyspepsia, a well-performed breath or stool test is normally more proportionate.
Which medicines must be stopped before testing?
NICE advises that a urea breath test or stool antigen test should generally not be performed within two weeks of taking a proton pump inhibitor or within four weeks of antibiotics.
Common PPIs include:
- omeprazole;
- lansoprazole;
- esomeprazole;
- pantoprazole;
- rabeprazole.
Bismuth-containing medication can also suppress the bacteria and is commonly avoided for at least four weeks before testing. Instructions for H2-receptor antagonists, antacids and other acid treatments vary between laboratories.
Do not simply stop a prescribed drug because you have read a general washout interval. Speak to the clinician or testing service, particularly if you have a known ulcer, previous bleeding or severe symptoms.
The clinician may recommend a temporary alternative for symptom relief while the PPI is withheld. The exact plan should reflect your medical history and the laboratory’s requirements.
If a test was performed without the correct washout and is positive, the result may still be meaningful. The greater concern is usually a false-negative result caused by bacterial suppression.
How should you prepare for each test?
Preparation differs between laboratories, so the instructions supplied with your appointment or kit take priority.
For a urea breath test, many services ask patients not to eat or drink for approximately six hours. You may be allowed a small amount of plain water, but this should be confirmed. Smoking, chewing gum and exercise may also be restricted shortly before the test.
The testing team should know about recent PPIs, antibiotics and bismuth. They may also ask about pregnancy, although the commonly used carbon-13 test does not involve ionising radiation.
For a stool antigen test, collect the sample in the container provided without contaminating it with urine or toilet water. Follow instructions about refrigeration and how quickly the specimen must reach the laboratory.
Gastroscopy requires an empty stomach. Patients are commonly asked not to eat for at least six hours and may have separate instructions about clear fluids. If sedation is used, arrangements may be needed for someone to take you home and remain with you afterwards.
Always tell the endoscopy service about anticoagulants, antiplatelet medication, diabetes treatment, allergies and other relevant medicines. Do not stop blood-thinning medication unless the clinical team has specifically instructed you to do so.
Which test is best after H. pylori treatment?
A urea breath test or laboratory stool antigen test is usually used to confirm that the infection has cleared. Both detect active infection and can become negative after successful treatment.
Testing must not be done too soon. Current UK guidance generally advises waiting at least four weeks after completing antibiotics, with some services preferring a longer interval. PPIs should usually be stopped for two weeks beforehand.
A biopsy is not normally needed solely to confirm eradication. It may be performed when a repeat gastroscopy is required to assess a gastric ulcer, investigate persistent warning symptoms or monitor another condition.
An antibody blood test should not be used as a test of cure. Antibodies may remain positive for months or years after the bacteria have been eradicated.
Symptoms alone cannot reliably show whether treatment worked. Indigestion can continue after eradication, while an infection can persist even if symptoms improve.
Whether every person needs confirmation testing can depend on the original diagnosis and local pathway. It is particularly important after an ulcer, complicated disease or previous treatment failure. Follow the plan provided by the treating clinician.
What do positive, negative and unclear results mean?
A positive breath, stool antigen or reliable biopsy result indicates that H. pylori has been detected. A clinician will usually discuss eradication treatment using a PPI and a combination of antibiotics.
A negative result means the test did not detect active infection. It does not explain the symptoms, and it is not completely conclusive when preparation was poor, treatment was recent or clinical suspicion remains high.
Sometimes results are described as borderline, equivocal or indeterminate. The next step may be to repeat the same test after correct preparation or use another method.
Discordant results—for example, a negative biopsy and positive stool test—require careful review. Possible explanations include patchy infection, medication effects, differences in timing or a false result.
Do not repeat several commercial tests without medical guidance. This can generate more confusion, particularly when each method has been used under different conditions.
If H. pylori is not found, the clinician may consider other causes of symptoms. Our guides to acid reflux and GORD and common causes of abdominal pain provide a broader overview.
When is gastroscopy needed instead of simple testing?
Breath and stool tests detect infection but cannot look for an ulcer, tumour, inflammation or another structural problem. Gastroscopy may therefore be more appropriate when symptoms or clinical findings require the upper digestive tract to be examined directly.
Seek prompt medical assessment if you have vomiting blood, black tar-like stools, difficulty swallowing, persistent vomiting, unexplained weight loss, significant anaemia or severe worsening abdominal pain.
Age, medication use, family history and the pattern and duration of symptoms can also influence the decision to refer. The clinician may arrange blood tests or other investigations before deciding whether gastroscopy is necessary.
Iron-deficiency anaemia can have several causes, including gastrointestinal blood loss. If this has been found on a blood test, see our guide to iron, ferritin and anaemia results.
Call 999 for vomiting a significant amount of blood, fainting, severe weakness, confusion or other signs of major bleeding. A planned H. pylori test is not an appropriate response to an emergency.
Frequently asked questions
Which is more accurate: an H. pylori breath or stool test?
Both can be highly accurate when a validated method is used and medication has been withheld for the correct period. The breath test is often considered a leading non-invasive option, but a good laboratory stool antigen test is a practical and reliable alternative.
Can a stool test detect an active H. pylori infection?
Yes. A stool antigen test looks for material from the bacterium and can detect a current infection. It can also be used after treatment to check whether eradication was successful.
Can I test for H. pylori while taking omeprazole?
Omeprazole and other PPIs can suppress the bacteria and cause a false-negative breath, stool or biopsy result. A two-week PPI washout is commonly required, but you should confirm this with the clinician before stopping prescribed treatment.
How long after antibiotics should I have the test?
Wait at least four weeks after finishing antibiotics unless your clinician gives different instructions. Testing earlier may produce a false-negative result because the bacteria remain temporarily suppressed.
Do I need to fast for an H. pylori stool test?
Fasting is not usually required for stool antigen testing. Medication washout, sample collection, storage and transport instructions are more important.
Do I need to fast for a urea breath test?
Usually, yes. Many UK services require no food or drink for around six hours, although protocols vary. Follow the instructions supplied by the testing provider.
Can a blood test diagnose H. pylori?
An antibody blood test can show previous exposure, but it may remain positive after the infection has cleared. It is used less often in the UK and cannot reliably confirm successful treatment.
Can H. pylori be missed on a biopsy?
Yes. Infection can be patchy, and PPIs, antibiotics, bismuth or recent bleeding can reduce detection. Sampling from appropriate areas and using more than one biopsy method may improve accuracy.
Is biopsy the gold-standard H. pylori test?
Biopsy testing is valuable when gastroscopy is already needed, but it is not automatically superior for routine diagnosis. A correctly performed urea breath or laboratory stool antigen test can be highly accurate without an invasive procedure.
Should everyone be retested after treatment?
Clinical pathways differ, but confirmation is especially important after peptic ulcer disease, complicated infection, persistent symptoms or previous treatment failure. A breath or stool antigen test is normally used, not an antibody blood test.
Can I buy an H. pylori test online?
Private laboratory breath and stool tests are available. Check the laboratory’s accreditation, the test method, preparation instructions and route for medical follow-up. Be cautious with unverified rapid home kits and do not obtain antibiotics without a proper clinical assessment.