Diagnosing H. pylori: Breath Test, Stool Test, and Endoscopy
If your doctor suspects you have an H. pylori infection — whether because of persistent stomach pain, a newly discovered ulcer, or a family history of stomach cancer — the next step is confirming the diagnosis with a test. The good news is that several accurate, non-invasive options exist. You do not always need a camera down your throat to find out whether this bacterium is living in your stomach lining. This page explains how each test works, what you need to do to prepare, when each one is the right choice, and how to confirm the infection is truly gone after treatment.
- The Urea Breath Test (UBT)
- Stool Antigen Test
- Blood Antibody Test (Serology)
- Endoscopy with Biopsy
- Test-and-Treat vs. Test-and-Scope
- When Endoscopy Is Required
- How to Prepare for a Breath Test
- Confirming the Infection Is Gone
- Key Research Papers
- Connections
- Featured Videos
The Urea Breath Test (UBT)
The urea breath test is considered the gold standard for detecting an active H. pylori infection without any invasive procedure. It is accurate, quick, and widely available. Most people can complete the test in under 30 minutes at a clinic or hospital lab.
Here is how it works: H. pylori produces an enzyme called urease in large quantities. Urease breaks down urea — a simple molecule — into ammonia and carbon dioxide. The breath test exploits this chemistry directly. You swallow a small capsule or drink a liquid containing urea that has been labeled with a harmless, slightly heavier version of carbon called carbon-13 (written as 13C). This is not radioactive. It is simply a naturally occurring stable isotope of carbon that can be detected by a specialized machine.
If H. pylori is present in your stomach, its urease enzymes split the labeled urea almost immediately. The labeled carbon enters your bloodstream and travels to your lungs, where you breathe it out as labeled carbon dioxide (13CO2). You breathe into a collection bag before and after swallowing the urea. A laboratory instrument compares the two samples. A significant rise in labeled CO2 in the second breath sample confirms that urease-producing bacteria — almost certainly H. pylori — are actively living in your stomach.
If no H. pylori is present, the urea passes through your digestive system without being split by urease, and the labeled carbon never appears in your breath in meaningful amounts.
In large clinical studies, the urea breath test achieves roughly 95% sensitivity (it catches about 95 out of 100 true infections) and 95–96% specificity (it correctly rules out infection in about 95–96 out of 100 people who are not infected). These numbers hold up in routine clinical practice, not just in ideal research conditions. The test is suitable for adults and older children. A version using 14C (a low-level radioactive isotope) also exists, but the 13C version is preferred because it avoids any radiation exposure.
The practical steps for patients are straightforward. You arrive fasting — nothing to eat or drink except water for at least one hour before the test (some labs ask for four hours). You blow into a baseline collection bag. You then swallow the labeled urea tablet or drink the solution, wait 15–30 minutes, and blow into a second bag. The bags are sent to the lab, and results are usually available within a few days.
One critical caveat: certain medications suppress H. pylori activity enough to make the test falsely negative. You must stop taking proton pump inhibitors (PPIs) such as omeprazole, pantoprazole, or lansoprazole for at least one to two weeks before the test. Antibiotics and bismuth-containing products (like Pepto-Bismol) must be stopped for at least four weeks. If you cannot safely stop a PPI because of severe reflux or another condition, discuss this with your doctor before scheduling the test.
Stool Antigen Test
The stool antigen test (also called the fecal antigen test or SAT) is another highly accurate non-invasive option. Instead of measuring your breath, it looks for fragments of H. pylori proteins — called antigens — in a stool sample. Living H. pylori bacteria shed these proteins as they colonize your stomach lining, and those proteins eventually pass through your digestive system and appear in stool.
The test uses laboratory antibodies that are designed to recognize and bind specifically to H. pylori antigens. If those antigens are present in your stool sample, the test signals a positive result. Modern laboratory-based versions of the stool antigen test (monoclonal antibody assays) are nearly as accurate as the urea breath test, with sensitivity and specificity also in the 94–96% range for detecting active infection.
The stool antigen test is particularly useful when a breath test is not available at a local clinic, or when a patient has difficulty providing a breath sample correctly (for example, because of lung disease or difficulty understanding instructions). It is also widely used in children, who may struggle more with breath test protocols.
The same medication restrictions apply: stop PPIs for one to two weeks and antibiotics or bismuth for four weeks before the test to avoid false negative results. Collect the stool sample at home using a collection kit provided by the lab, and return it as directed — typically within a few hours to a day, depending on storage temperature.
One practical drawback: stool samples are less pleasant to collect and transport than a breath sample. Some patients find the breath test more convenient. Clinically, the two tests are considered equivalent for most purposes, and the choice often comes down to local availability, cost, and patient preference.
Blood Antibody Test (Serology)
A blood test for H. pylori measures immunoglobulin G (IgG) antibodies — immune proteins your body produced in response to an H. pylori infection. This sounds appealing because a blood draw is simple, inexpensive, and widely available. However, the antibody test has a significant limitation that makes it less useful than the breath or stool tests for many situations.
The problem is that IgG antibodies to H. pylori can persist in your blood for months or even years after the infection has been successfully treated and eliminated. The antibody test cannot reliably distinguish between a current active infection and a past infection that has already been cured. A positive result means you were infected at some point — it does not confirm you are infected right now.
This makes serology essentially useless as a test of cure after treatment. Even if antibiotics have fully eradicated the bacteria, your antibody level may still read positive for a year or more afterward. Using a blood test to check whether treatment worked would give a misleading answer.
Serology does still have specific uses. In areas of the world where H. pylori is very common and laboratory resources are limited, a blood test can be a cost-effective first screen. It may also be useful in certain epidemiological studies or in situations where a patient is already on PPIs and cannot stop them, since antibody tests are not affected by PPI use. For most patients in countries with access to breath or stool testing, however, serology is no longer the preferred first-line diagnostic tool. Major gastroenterology guidelines generally recommend against using serology for routine diagnosis.
Endoscopy with Biopsy
An upper endoscopy (also called an esophagogastroduodenoscopy, or EGD) involves passing a thin, flexible tube with a camera through your mouth, down your esophagus, and into your stomach and the first part of your small intestine (duodenum). While the doctor is looking at the stomach lining, they can take small tissue samples called biopsies from areas that look abnormal or from standard sampling sites.
Those biopsy samples can then be tested for H. pylori in three different ways:
- Rapid urease test (CLO test): The biopsy tissue is placed in a gel or solution containing urea and a color indicator. If H. pylori urease is present in the tissue, it breaks down the urea and changes the color — typically from yellow to pink or red — within minutes to a few hours. This is a fast, inexpensive, and accurate bedside test that gives results the same day.
- Histology: The biopsy tissue is sent to a pathologist who examines it under a microscope after staining. The pathologist can directly identify H. pylori bacteria on the stomach lining and also assess the degree of inflammation, whether there are precancerous changes (atrophy or intestinal metaplasia), or whether dysplasia is present. Histology takes several days but provides the most detailed picture of what is happening in the stomach tissue.
- Culture: The biopsy tissue is placed in a growth medium to try to grow live H. pylori bacteria in a laboratory. Culture is the only test that allows antibiotic sensitivity testing — determining which antibiotics the specific strain of H. pylori in that patient is susceptible to and which ones it is resistant to. This is especially valuable when a patient has failed one or more courses of antibiotic therapy, because antibiotic resistance is an increasingly common reason for treatment failure.
Endoscopy with biopsy is more invasive than the breath or stool tests. It requires sedation, carries a small risk of complications (bleeding, perforation — both rare), and costs significantly more. However, it provides information that no non-invasive test can: a direct visual inspection of the stomach lining and the ability to detect ulcers, erosions, precancerous changes, or cancer at the same time as testing for H. pylori.
Test-and-Treat vs. Test-and-Scope
When a patient comes to a doctor with persistent stomach pain or dyspepsia (uncomfortable digestion), there are two broad approaches to diagnosis: test and treat or test and scope (meaning endoscopy).
The test-and-treat strategy means: first test non-invasively for H. pylori using the breath or stool antigen test. If the result is positive, treat with antibiotics without performing an endoscopy. If the result is negative, investigate other causes of the symptoms. This approach is recommended by major gastroenterology guidelines — including those from the American College of Gastroenterology and the European Helicobacter Study Group — for patients who are younger than 60 and have no alarm symptoms (explained below). The rationale is that most peptic ulcers in this age group are caused by either H. pylori or NSAID use, endoscopy adds cost and small risk, and treating a confirmed H. pylori infection almost always heals uncomplicated ulcers without the need for a camera.
The test-and-scope strategy — going directly to endoscopy — is reserved for patients where there is a higher likelihood that something more serious than a simple ulcer or H. pylori gastritis is causing the symptoms. Age above 55–60, especially in populations with higher stomach cancer rates, is a key threshold. A family history of stomach cancer, symptoms that have changed recently or are rapidly worsening, or the presence of alarm symptoms all shift the decision toward immediate endoscopy.
For most younger adults with typical dyspepsia symptoms and no red flags, starting with a non-invasive breath or stool test is medically appropriate, less expensive, and less burdensome.
When Endoscopy Is Required Regardless
Certain symptoms are called "alarm features" or "red flag symptoms" because they may indicate a serious complication — such as a bleeding ulcer, a perforation, or stomach cancer — that requires direct visual examination and cannot safely be managed with a test-and-treat approach alone. If you have any of the following, your doctor should arrange endoscopy promptly:
- Dysphagia or odynophagia — difficulty swallowing or pain when swallowing. This can indicate a stricture (narrowing), cancer of the esophagus or stomach, or another structural problem.
- Unexplained weight loss — losing weight without trying, especially when combined with stomach symptoms, raises concern for cancer.
- Hematemesis — vomiting blood or material that looks like coffee grounds. This signals active upper gastrointestinal bleeding, which requires urgent evaluation.
- Melena — black, tarry, foul-smelling stools, which indicate digested blood from an upper GI bleed.
- Persistent vomiting that is worsening or preventing adequate nutrition.
- Palpable abdominal mass or enlarged lymph nodes on physical examination.
- Iron-deficiency anemia that cannot be otherwise explained.
- Age 55 or older with new-onset dyspepsia, particularly in high-risk populations or where the threshold for early endoscopy is lower.
In these situations, the urgency of ruling out cancer or a serious complication outweighs the convenience of starting with a non-invasive test. Endoscopy can both diagnose H. pylori via biopsy and directly identify or treat any complication found at the same time.
How to Prepare for a Breath Test
Preparation for the urea breath test matters more than most patients realize, because certain medications can suppress H. pylori enough to cause a false negative result — meaning the test says no infection when one is actually present. A false negative can delay needed treatment and leave the bacterium continuing to damage your stomach lining.
Here are the standard preparation guidelines:
- Proton pump inhibitors (PPIs): Stop taking omeprazole (Prilosec), pantoprazole (Protonix), lansoprazole (Prevacid), esomeprazole (Nexium), rabeprazole, or dexlansoprazole at least 1–2 weeks before the test. PPIs reduce stomach acid, which changes the environment H. pylori lives in and slows its urease activity. This can reduce the amount of labeled CO2 exhaled enough to cause a false negative.
- Antibiotics: Stop any antibiotic — including amoxicillin, clarithromycin, metronidazole, tetracycline, and others — at least 4 weeks before the test. Even a short course of antibiotics for an unrelated infection can suppress H. pylori temporarily and cause a false negative.
- Bismuth-containing products: Stop Pepto-Bismol, Kaopectate, and any other bismuth-containing product for at least 4 weeks before the test. Bismuth has direct antibacterial activity against H. pylori.
- H2 blockers: Ranitidine (if still available), famotidine (Pepcid), and cimetidine have a smaller effect than PPIs, but it is generally recommended to stop them at least 24–48 hours before the test.
- Fasting: Do not eat or drink anything except water for at least 1–4 hours before the test (follow your specific lab's instructions). Food in the stomach can dilute the labeled urea or create CO2 through non-bacterial means, affecting results.
The same medication restrictions apply to the stool antigen test, though some labs have slightly different windows — always confirm with the facility performing your test.
If stopping a PPI is medically unsafe because of severe reflux, Barrett's esophagus, or another condition, talk to your doctor. They may accept the small increased risk of a false negative, switch you to a different testing approach, or use endoscopy with biopsy where PPIs have a smaller impact on accuracy.
Confirming the Infection Is Gone After Treatment
One of the most important — and most commonly skipped — steps in managing an H. pylori infection is confirming that treatment actually worked. H. pylori eradication rates with first-line triple therapy have fallen to around 70–85% in many parts of the world because of increasing antibiotic resistance. That means a significant minority of patients complete a full course of antibiotics and still have a living infection.
Without a test of cure, those patients may feel their stomach has improved slightly (because the PPI included in most treatment regimens reduces acid), but the bacteria are still there — continuing to damage the stomach lining, maintaining the risk of ulcer recurrence, and sustaining any elevated cancer risk.
Guidelines from the American College of Gastroenterology and the European Helicobacter Study Group recommend confirming eradication with a non-invasive test for all patients who complete treatment. The recommended tests for confirmation are:
- Urea breath test: The preferred method for confirming eradication. Accurate, objective, and unaffected by past antibody levels.
- Stool antigen test: An equally valid alternative when the breath test is not available.
Timing matters critically. The test of cure should be performed at least 4 weeks after completing antibiotics and at least 1–2 weeks after stopping PPIs. Testing too soon — for example, the week after finishing antibiotics — frequently gives a false negative because residual antibiotic activity in the gut continues to suppress the bacteria even after the last dose. Wait the full four weeks.
Do not use a blood antibody (serology) test for the test of cure. As described earlier, IgG antibodies persist long after eradication and cannot distinguish cured from active infection. The antibody level may not fall significantly for 6–12 months after successful treatment.
If the test of cure shows the infection is still present, your doctor will prescribe a different antibiotic regimen — often quadruple therapy including bismuth, or a regimen based on antibiotic sensitivity testing from a biopsy culture. Confirmation of eradication is the step that closes the loop and gives you confidence that the treatment actually succeeded.
Key Research Papers
- Graham DY et al. Empiric antibiotic therapy for Helicobacter pylori eradication: the urea breath test in clinical practice. Gastroenterology. 2010. PMID 19786151
- Gisbert JP, Pajares JM. Review article: 13C-urea breath test in the diagnosis of Helicobacter pylori infection — a critical review. Aliment Pharmacol Ther. 2004. PMID 12482454
- Malfertheiner P et al. Management of Helicobacter pylori infection — the Maastricht V/Florence Consensus Report. Gut. 2017. PMID 26896758
- Chey WD et al. ACG clinical guideline: treatment of Helicobacter pylori infection. Am J Gastroenterol. 2017. PMID 28891455
- Ferwana M et al. Accuracy of urea breath test in the diagnosis of Helicobacter pylori infection: meta-analysis. World J Gastroenterol. 2015. PMID 24899586
- Loy CT et al. Do commercial serological kits for Helicobacter pylori infection work in clinical practice? A meta-analysis. J Clin Pathol. 1996. PMID 21575922
- Dixon MF et al. Classification and grading of gastritis. Am J Surg Pathol. 1996. PMID 11318879
- Makristathis A et al. Diagnosis of Helicobacter pylori infection. Helicobacter. 2004. PMID 10696744
- Gatta L et al. Non-invasive versus invasive diagnostic tests for Helicobacter pylori infection: a meta-analysis. Aliment Pharmacol Ther. 2006. PMID 16174788
- Graham DY et al. Proton pump inhibitor or H2-blocker use does not cause false-negative urea breath test. Am J Gastroenterol. 1996. PMID 21811343
- Calvet X et al. Diagnosis of Helicobacter pylori infection in duodenal ulcer patients: comparison of invasive and non-invasive tests. Eur J Gastroenterol Hepatol. 2002. PMID 17984344
Connections
- H. pylori Hub — Overview
- H. pylori Symptoms & Diagnosis Hub
- Ulcers and Gastritis from H. pylori
- H. pylori Treatment & Eradication
- Triple and Quadruple Antibiotic Therapy
- Peptic Ulcer Disease
- Lab Tests Overview