If you have persistent stomach pain, bloating, or heartburn, your doctor may suspect Helicobacter pylori — a common bacterial infection that can lead to ulcers and, in rare cases, stomach cancer. The most accurate test for H. pylori is an endoscopic biopsy with culture or histology, but for most people who do not need an endoscopy, the urea breath test is the most accurate non-invasive option. The choice depends on your symptoms, whether you have already taken antibiotics, and what your doctor is trying to determine.
What Is H. pylori and Why Does Testing Matter?
H. pylori is a spiral-shaped bacterium that lives in the lining of the stomach. It is one of the most common bacterial infections in humans — some estimates suggest it affects roughly half of the world’s population. Most infected people never develop symptoms. But in some, the bacteria cause chronic gastritis, peptic ulcers, and in rare cases, gastric cancer or MALT lymphoma.
Testing matters because the symptoms of H. pylori infection — burning stomach pain, bloating, nausea, loss of appetite — overlap heavily with other digestive conditions like gastroesophageal reflux disease (GERD), functional dyspepsia, and gallstone disease. Without a specific test, treatment is guesswork.
There is also a public health angle. H. pylori is classified as a Group 1 carcinogen by the World Health Organization. Eradicating the infection in people who have had ulcers or certain other conditions reduces the risk of complications. But not everyone who tests positive needs treatment. Current guidelines generally recommend testing and treating only when there is a clear clinical reason, such as an active ulcer, a history of ulcers, or certain precancerous changes found on endoscopy.
What Are the Main Types of H. pylori Tests?
H. pylori testing falls into two broad categories: invasive and non-invasive. Invasive tests require an endoscopy — a tube with a camera passed through the mouth into the stomach. Non-invasive tests do not.
Non-invasive tests include:
- Urea breath test — you drink a solution containing labeled urea. If H. pylori is present, its urease enzyme breaks down the urea, releasing labeled carbon dioxide that you exhale. A breath sample detects it.
- Stool antigen test — detects H. pylori proteins in a stool sample.
- Blood antibody test — detects antibodies against H. pylori in the blood.
Invasive tests include:
- Rapid urease test — a small biopsy sample is placed in a solution that changes color if urease is present.
- Histology — a biopsy sample is stained and examined under a microscope.
- Culture — a biopsy sample is placed on a medium that allows H. pylori to grow, which also enables antibiotic susceptibility testing.
- PCR (polymerase chain reaction) — detects H. pylori DNA in a biopsy sample.
Each test has strengths and weaknesses. Accuracy depends on the situation, not just the test itself.
What Is the Most Accurate Test for H. pylori?
The most accurate test overall is an endoscopic biopsy with histology or culture. This is considered the reference standard in many clinical settings. When a gastroenterologist takes multiple biopsy samples from the stomach lining and sends them for pathological examination, the diagnostic accuracy is very high — provided the samples are taken from the right locations and the patient has not recently taken certain medications.
However, biopsy is only appropriate when you already need an endoscopy for another reason — such as investigating unexplained weight loss, difficulty swallowing, gastrointestinal bleeding, or persistent vomiting. Endoscopy is not a first-line test for H. pylori alone because it is invasive, requires sedation, and costs significantly more.
For people who do not need an endoscopy, the urea breath test is the most accurate non-invasive option. It has high sensitivity and specificity — typically above 90 percent in studies. The stool antigen test is also highly accurate and is a reasonable alternative when breath testing is unavailable.
The blood antibody test is the least accurate of the three non-invasive options. It cannot distinguish between a current infection and a past one, because antibodies can remain in the blood for years after the bacteria are gone. For this reason, major gastroenterology guidelines recommend against using blood antibody tests for routine diagnosis.
Why the Urea Breath Test Is Often the Best First Choice
The urea breath test works by exploiting a unique feature of H. pylori: its ability to produce the enzyme urease. Urease breaks down urea into ammonia and carbon dioxide. In the test, you swallow a capsule or drink a solution containing urea labeled with a non-radioactive carbon isotope — either carbon-13 or carbon-14. If H. pylori is in your stomach, it breaks down the urea, and the labeled carbon dioxide is absorbed into your bloodstream and exhaled. A special analyzer detects it in your breath.
This test is accurate, quick, and completely non-invasive. It takes about 15 minutes. It is also the preferred test to confirm that treatment has worked — known as a test of cure — because it detects active infection rather than past exposure.
There are important preparation steps. You must fast for at least one hour before the test. You also need to stop certain medications beforehand:
- Antibiotics and bismuth preparations (like Pepto-Bismol) — stop for at least four weeks
- Proton pump inhibitors (like omeprazole, esomeprazole, lansoprazole) — stop for at least two weeks
These medications suppress H. pylori activity or reduce its numbers, which can cause a false negative result. If you take a PPI for severe reflux, stopping it even briefly may cause symptoms to flare. Discuss this with your doctor before the test.
Stool Antigen Test: A Reliable Alternative
The stool antigen test detects H. pylori proteins in a stool sample. It is less expensive than the breath test and does not require specialized equipment beyond a laboratory that performs the analysis. Accuracy is comparable to the urea breath test in most studies.
Like the breath test, the stool antigen test detects active infection. It can be used for initial diagnosis and for confirming eradication after treatment. The same medication restrictions apply: you must be off antibiotics and bismuth for four weeks and off PPIs for two weeks before providing a sample.
Some people find providing a stool sample unpleasant, but the test itself is simple and painless. Many doctors offer it as an alternative when a breath test is not available locally or when cost is a concern.
When Endoscopy and Biopsy Are Necessary
Endoscopy with biopsy is not the first test most people need, but it is the gold standard in specific situations. A gastroenterologist can see the stomach lining directly, identify ulcers or inflammation, and take targeted biopsy samples.
Biopsy is particularly valuable when:
- You have symptoms that warrant looking directly at the stomach — such as bleeding, anemia, difficulty swallowing, or unintentional weight loss
- You are over a certain age with new-onset digestive symptoms — guidelines in many countries suggest endoscopy to rule out cancer
- You have had unsuccessful treatment and need antibiotic susceptibility testing
- Your doctor suspects complications like gastric cancer or MALT lymphoma
During endoscopy, the doctor typically takes multiple biopsies from the antrum and the body of the stomach. H. pylori distribution in the stomach is patchy, so sampling from multiple sites improves accuracy. Histology allows the pathologist to see the bacteria directly and also assess the degree of inflammation, atrophy, or intestinal metaplasia — precancerous changes that are important to document.
Culture is the only test that provides antibiotic susceptibility data. This matters when first-line treatment fails, because H. pylori resistance to clarithromycin — a common first-line antibiotic — has risen significantly in many regions. Culture-guided therapy can improve eradication rates in difficult cases.
Why Blood Antibody Tests Are Not Recommended
Blood antibody tests measure IgG antibodies against H. pylori. They are cheap and convenient, but they have a fundamental limitation: they cannot tell you whether the infection is current or historical.
Once you are infected, your immune system produces antibodies that can remain detectable for years — even after the bacteria are successfully eradicated. A positive blood test may simply reflect an old infection that has already cleared. A negative blood test is more informative, but even that can be false in early infection before antibodies develop.
For this reason, international guidelines — including those from the American College of Gastroenterology and the Maastricht consensus — recommend against using serology for routine diagnosis. Some doctors still use it in low-prevalence settings where a negative result is reassuring, but it should not guide treatment decisions without confirmation from a breath test or stool antigen test.
What Can Cause False Results?
No test is perfect. Understanding what causes false results helps you prepare properly and interpret results correctly.
False negatives are the bigger concern. They occur when H. pylori is present but the test fails to detect it. The most common causes:
- Recent use of PPIs, antibiotics, or bismuth compounds
- Bleeding in the stomach, which can dilute bacterial numbers
- Patchy bacterial distribution in the stomach — relevant only for biopsy sampling
- Testing too soon after treatment — guidelines recommend waiting at least four weeks after completing antibiotics
False positives are less common but can occur. The stool antigen test can occasionally cross-react with other bacteria. The urea breath test rarely gives false positives. Blood antibody tests are the exception — they frequently give false positives in people who have cleared the infection.
If your test result does not match your symptoms, your doctor may recommend repeating the test or using a different testing method.
How to Choose the Right Test
Your doctor will consider several factors when choosing a test:
- Symptoms — if you have alarm symptoms like bleeding or weight loss, endoscopy is the right choice regardless of H. pylori testing
- Previous treatment — if you have already taken antibiotics for H. pylori, a breath test or stool antigen test is needed to confirm eradication
- Medication use — if you cannot stop PPIs safely, some tests become unreliable
- Local availability — breath testing requires specialized equipment; stool antigen testing only needs a standard lab
- Cost — non-invasive tests are substantially cheaper than endoscopy
For most people with dyspepsia or suspected H. pylori, the urea breath test is the best balance of accuracy, cost, and convenience. The stool antigen test is a close second. Endoscopy is reserved for those who need it for other reasons or who have complicated disease.
Frequently Asked Questions
Which H. pylori test is the most accurate?
Endoscopic biopsy with histology or culture is the most accurate test overall. Among non-invasive tests, the urea breath test has the highest accuracy.
Can a blood test detect H. pylori?
Yes, but it only detects antibodies, which cannot distinguish between a current and past infection. Major guidelines recommend against using blood tests for routine diagnosis.
How long do I need to stop PPIs before an H. pylori test?
You should stop proton pump inhibitors at least two weeks before a urea breath test or stool antigen test. Antibiotics and bismuth compounds should be stopped four weeks before.
Is the stool antigen test as good as the breath test?
Yes, the stool antigen test has comparable accuracy to the urea breath test for both initial diagnosis and confirming eradication. It is a reliable alternative when breath testing is unavailable.

