Gastritis is diagnosed through a combination of tests, not a single one. The specific tests your doctor orders depend on your symptoms, risk factors, and whether they suspect a bacterial infection, an autoimmune cause, or damage visible only under a microscope. Most people start with noninvasive tests like a breath test or stool sample, and only move to an endoscopy if those results are unclear or symptoms are severe.
H. Pylori Breath Test
The most common first step is testing for H. pylori, a bacterium responsible for the majority of gastritis cases. The urea breath test is quick, painless, and highly reliable. You swallow a small capsule or liquid containing a harmless tagged substance, then breathe into a collection bag about 15 minutes later. If H. pylori is present in your stomach, the bacteria break down the substance in a way that changes the composition of your breath. The test can identify almost all people who carry the infection.
Preparation matters. You need to stop taking proton pump inhibitors (common acid reducers like omeprazole or lansoprazole) at least two weeks before the test, because these drugs can suppress H. pylori enough to cause a false negative. Bismuth-containing medicines like Pepto-Bismol also need to be stopped for the same two-week window. If you’ve taken antibiotics for any reason, wait at least four weeks before testing. Skipping these steps is one of the most common reasons for inaccurate results.
H. Pylori Stool Test
A stool antigen test looks for H. pylori proteins directly in a stool sample. It’s a good alternative when a breath test isn’t available, and it follows the same medication restrictions: no PPIs or bismuth for two weeks, no antibiotics for four weeks.
You’ll typically get a container or collection kit with specific instructions. The general process involves catching a stool sample in a clean, dry container or on special paper placed over the toilet. The key is keeping the sample free of urine, toilet water, or toilet paper. Label the container with your name, collection date, and time, seal it tightly, and return it as directed. For infants or young children, providers may give instructions for using plastic wrap inside a clean diaper.
Blood Tests
Blood tests play a supporting role in gastritis diagnosis, particularly when your doctor suspects an autoimmune cause. There are two main scenarios where blood work helps.
For autoimmune gastritis, doctors look for specific antibodies your immune system produces when it mistakenly attacks your stomach lining. These include antibodies against the cells that produce stomach acid (parietal cells) and antibodies against a protein called intrinsic factor, which your stomach needs to absorb vitamin B12. The American Gastroenterological Association recommends checking both of these when biopsy results suggest autoimmune gastritis. Blood tests may also reveal low B12 levels or signs of anemia, which are downstream effects of the damage autoimmune gastritis causes.
For screening purposes, some doctors measure pepsinogen levels in your blood. Pepsinogen is a protein produced by your stomach lining, and when the lining thins out (a condition called atrophic gastritis), pepsinogen levels drop in a predictable way. The ratio between two types of pepsinogen can help flag people who may need further investigation with an endoscopy, though it’s used more commonly in countries with high rates of stomach cancer than in the United States.
Upper Endoscopy and Biopsy
An upper endoscopy is the most definitive test for gastritis. A thin, flexible tube with a tiny camera on the end is guided through your mouth, down your esophagus, and into your stomach. It lets your doctor see the stomach lining directly: areas of redness, swelling, erosion, or thinning that confirm gastritis and help classify its severity.
During the procedure, your doctor will likely take small tissue samples (biopsies) from different areas of your stomach. These tissue samples are sent to a pathology lab, where they’re examined under a microscope. Pathologists look for the type and extent of inflammation, the presence of H. pylori bacteria, signs of atrophy or thinning, and any precancerous changes. Lab results typically come back within two to five business days, with many labs targeting a two-day turnaround.
The endoscopy itself usually takes 15 to 30 minutes. You’ll receive sedation beforehand, so you won’t feel discomfort during the procedure. Plan for someone to drive you home afterward, and expect mild throat soreness or bloating for the rest of the day. Most people resume normal activities the next day.
When Endoscopy Is Needed vs. Noninvasive Tests
Not everyone with suspected gastritis needs an endoscopy. If you’re younger, have straightforward symptoms like upper belly discomfort or nausea, and test positive for H. pylori through a breath or stool test, treatment often starts without an endoscopy. Your doctor treats the infection and reassesses.
Endoscopy becomes more important when symptoms persist despite treatment, when you have warning signs like unexplained weight loss or difficulty swallowing, when you’re over 60, or when there’s concern about something beyond simple inflammation. It’s also the only way to diagnose autoimmune gastritis or atrophic gastritis with certainty, since these conditions require direct tissue examination.
Ruling Out Other Conditions
One challenge with gastritis testing is that the symptoms, particularly upper abdominal pain, bloating, nausea, and a feeling of fullness after eating, overlap significantly with a condition called functional dyspepsia. Functional dyspepsia causes the same discomfort but without visible inflammation or damage to the stomach lining. It’s actually the most common cause of these symptoms overall.
The distinction only becomes clear during an endoscopy. Functional dyspepsia is defined as at least one month of upper abdominal discomfort with no evidence of structural disease found on endoscopy. In other words, it’s a diagnosis of exclusion: if the scope shows a normal stomach lining and biopsies come back clean, the diagnosis shifts away from gastritis. Importantly, your symptoms aren’t less real in that scenario. The treatment approach simply changes.
What to Do Before Your Tests
The most actionable thing you can do is get the medication timing right. If you’re taking a proton pump inhibitor, you’ll need to stop it two weeks before any H. pylori test, whether breath, stool, or biopsy-based. If you’ve recently finished antibiotics, wait four weeks. Taking these medications too close to the test can mask an active infection and lead to a false negative, meaning you’d go untreated or need to repeat the test later.
If you’re scheduled for an endoscopy, you’ll be asked to fast for at least six to eight hours beforehand so your stomach is empty and the camera has a clear view. Your doctor’s office will give you specific instructions about which of your regular medications to take or skip on the morning of the procedure. If you take blood thinners, that conversation is especially important and should happen well before your appointment date.

