How to Diagnose a Stomach Ulcer

How to Diagnose a Stomach Ulcer: Symptoms, Tests and Diagnosis

by

 

How to Diagnose a Stomach Ulcer: Tests, Endoscopy, Biopsy and H. pylori-various aspects-

Digestive health • Diagnosis and investigations | Updated: 23 November 2026

How to Diagnose a Stomach Ulcer: The Direct Answer

How to diagnose a stomach ulcer depends on the patient’s symptoms, age, medical history, risk factors and warning signs. The test that allows a doctor to directly identify a gastric ulcer is an upper gastrointestinal (GI) endoscopy, also called gastroscopy or oesophagogastroduodenoscopy (OGD/EGD). A thin flexible camera is passed through the mouth to examine the oesophagus, stomach and duodenum. The doctor can photograph an ulcer and take a small biopsy when needed. Doctors may also order a urea breath test or stool antigen test to detect active Helicobacter pylori (H. pylori) infection, one of the main causes of peptic ulcers. These tests identify the bacteria; they do not show an ulcer directly. Blood tests can identify anaemia or other complications, but a routine blood test cannot by itself confirm that a stomach ulcer is present.

How to Diagnose a Stomach Ulcer
How to Diagnose a Stomach Ulcer
In brief: Endoscopy directly visualizes a stomach ulcer. Breath or stool testing checks for active H. pylori infection. Blood tests help assess anaemia and complications. The right combination depends on the individual patient.

Not everyone with upper abdominal burning or indigestion needs immediate endoscopy. Some people can initially be assessed with non-invasive H. pylori testing and clinical follow-up. Others need early endoscopy because of bleeding, anaemia, persistent vomiting, weight loss, swallowing difficulty, older age at symptom onset or other risk factors. The decision should be made by a qualified healthcare professional.

Table of Contents

What Is a Stomach Ulcer?

A stomach ulcer, medically called a gastric ulcer, is an open sore in the protective lining of the stomach. A related ulcer can develop in the first part of the small intestine, called the duodenum; this is a duodenal ulcer. Both are included under the term peptic ulcer disease (PUD). The two major causes are infection with H. pylori and regular use of certain pain-relieving medicines called non-steroidal anti-inflammatory drugs (NSAIDs). Examples include ibuprofen, naproxen and diclofenac. Aspirin can also contribute to ulceration and bleeding. Patients should not stop prescribed aspirin or other medicines on their own; the prescriber must weigh the risks and benefits. Diagnosis matters because symptoms alone cannot reliably distinguish an ulcer from gastritis, reflux, functional dyspepsia, gallbladder disease or, less commonly, a serious condition such as stomach cancer.

Symptoms That May Suggest a Stomach Ulcer

Some people with an ulcer have no symptoms until a complication occurs. When symptoms are present, they may include:
  • Epigastric pain: burning, aching or gnawing discomfort in the upper middle abdomen, between the breastbone and navel.
  • Indigestion (dyspepsia): upper abdominal discomfort, fullness or bloating.
  • Nausea and sometimes vomiting.
  • Feeling full earlier than expected or uncomfortable after meals.
  • Reduced appetite or unexplained weight loss.
  • Symptoms that recur, persist or disturb sleep.
The timing of pain in relation to meals is sometimes described in textbooks, but it is not reliable enough to diagnose the location or presence of an ulcer. A person cannot confirm an ulcer by the character of pain alone.

Symptoms of a bleeding ulcer

Bleeding may cause haematemesis (vomiting red blood or material resembling coffee grounds), melaena (black, sticky, tar-like stools), weakness, dizziness, breathlessness or fainting. Slow, ongoing blood loss may cause iron-deficiency anaemia without obvious visible bleeding.

First Step: Medical History and Physical Examination

Before ordering tests, a doctor reviews the symptoms and looks for risk factors. This first assessment helps determine whether non-invasive testing is reasonable or whether an endoscopy should be arranged promptly.
How to Diagnose a Stomach Ulcer: Tests, Endoscopy, Biopsy and H. pylori
How to Diagnose a Stomach Ulcer: Tests, Endoscopy, Biopsy and H. pylori

Important questions the doctor may ask

  • Where is the pain, how long has it been present and is it getting worse?
  • Is there vomiting, black stool, blood in vomit, difficulty swallowing or unexplained weight loss?
  • Have there been previous ulcers or H. pylori infection?
  • Does the patient use NSAIDs, aspirin, steroids, anticoagulants or other medicines that may increase bleeding risk?
  • Is there a personal or family history of stomach cancer or other upper digestive disease?
  • Has there been previous treatment for H. pylori, and was eradication confirmed?

Physical examination

The clinician may check pulse, blood pressure, hydration, pallor and abdominal tenderness. A physical examination can identify clues to bleeding or another abdominal condition, but a normal examination does not rule out an ulcer.

Why medicine history is particularly important

NSAIDs can weaken the stomach’s protective mechanisms and cause ulcers or bleeding. The risk may be higher with older age, a previous ulcer, higher doses, multiple NSAIDs, anticoagulants, antiplatelet medicines or certain other combinations. Patients should bring a list or photographs of all prescription medicines, over-the-counter painkillers and supplements to the appointment.

Upper GI Endoscopy: The Direct Test for Diagnosing a Stomach Ulcer

Upper GI endoscopy is the principal test for directly examining the lining of the upper digestive tract. It is often the most informative investigation when a gastric ulcer needs to be confirmed, when warning signs are present, or when another important diagnosis must be excluded.

How is an endoscopy performed?

  1. The patient follows the hospital’s fasting instructions, usually avoiding food and drink for a specified period before the procedure.
  2. The endoscopy team checks medical history, medicines, allergies and any conditions that affect sedation.
  3. A throat-numbing spray and/or sedation may be offered, depending on the patient and local practice.
  4. The doctor gently passes a thin, flexible tube with a light and camera through the mouth into the oesophagus, stomach and duodenum.
  5. The lining is examined on a monitor. If necessary, photographs and small tissue samples are taken.
  6. The patient is monitored during recovery, particularly if sedation was used, and receives instructions about eating, medicines and transport home.

What can the endoscopist see?

Endoscopy can identify the presence, site, number and appearance of ulcers. It can also show inflammation, erosions, narrowing, active bleeding, a visible vessel or other abnormal tissue. The doctor may examine the oesophagus and duodenum as well, because symptoms attributed to a stomach ulcer may originate elsewhere.

Does endoscopy hurt?

Patients commonly describe gagging or pressure rather than sharp pain. Throat spray and sedation can make the procedure more comfortable. Experiences vary, and the endoscopy unit should explain the available options. Temporary bloating, belching or a mild sore throat can occur afterward.

How long does it take?

The camera examination itself is often relatively brief, but preparation, consent, sedation and recovery add time to the visit. The hospital should provide the patient’s exact instructions.
Can the patient drive after endoscopy?
If sedation has been given, the patient generally must not drive, operate machinery, drink alcohol or make important decisions for the period specified by the endoscopy team, often for 24 hours. A responsible adult may be required to accompany the patient home. Follow the unit’s written advice.

Why Is a Biopsy Taken During Endoscopy?

A biopsy is a tiny sample of tissue collected through the endoscope. It is sent to a laboratory where a pathologist examines it under a microscope. Taking a biopsy does not automatically mean that the doctor suspects cancer; samples are commonly taken to clarify the cause of an abnormal area.

Reasons for taking a gastric biopsy

  • To examine the tissue of a gastric ulcer and assess whether it has benign or suspicious features.
  • To look for H. pylori using histology or a rapid urease test on biopsy material.
  • To investigate inflammation, atrophy or intestinal metaplasia when clinically indicated.
  • To investigate an irregular, unusual or non-healing lesion.
Biopsy decisions depend on the ulcer’s appearance, location, patient risk factors and local clinical guidance. A gastric ulcer may need follow-up endoscopy after treatment to document healing and ensure that an important underlying condition has not been missed. The timing is individualized; some guidance recommends reassessment at around six to eight weeks, depending on the lesion and clinical circumstances.
Important difference: A duodenal ulcer and a gastric ulcer are not managed identically in every respect. Biopsy and repeat-endoscopy decisions are particularly important to consider for gastric ulcers because some stomach cancers can resemble benign ulcers.

H. pylori Tests: Urea Breath Test and Stool Antigen Test

H. pylori is a bacterium that can live in the stomach lining. It is a major cause of peptic ulcer disease. Finding the infection is important because treatment can eradicate the organism and reduce the risk of ulcer recurrence. However, a positive H. pylori result does not prove that a person currently has an ulcer; the ulcer itself is visualized by endoscopy when that investigation is indicated.

1. Urea breath test

The urea breath test is a non-invasive test for active H. pylori infection. The patient drinks or swallows a preparation containing specially labelled urea. If H. pylori is present, its enzyme urease breaks down the urea and produces labelled carbon dioxide. The patient breathes into a collection bag or tube, and the laboratory measures the labelled carbon dioxide. Advantages: It does not require an endoscope, is highly accurate when performed with the correct preparation, and can be used to confirm that treatment has successfully eradicated the infection.

Is the urea breath test painful?

No. It involves swallowing the test preparation and providing breath samples. Some centres use a baseline sample and a second sample after a waiting period. Follow the specific laboratory instructions.

2. Stool antigen test

The H. pylori stool antigen test detects proteins from the bacterium in a stool sample. The patient collects a small sample in a clean container supplied by the laboratory and returns it according to the instructions. Advantages: It is non-invasive, detects active infection and can be used for post-treatment confirmation of eradication when an appropriate validated test is used. For initial diagnosis, a laboratory-based stool antigen test and a urea breath test are generally preferred over antibody blood testing when a non-invasive test is appropriate.

3. Blood antibody test for H. pylori

A blood test can detect antibodies produced in response to H. pylori. However, antibodies may remain detectable after the infection has been cleared. Therefore, serology may not distinguish a current infection from a past infection and is not suitable for confirming eradication. Its usefulness depends on the assay and local validation; it is generally less helpful than breath or stool antigen testing for identifying active infection.
Test What it detects Does it show an ulcer? Typical role
Upper GI endoscopy Direct appearance of oesophagus, stomach and duodenum Yes Confirms and characterizes an ulcer; permits biopsy and some treatments.
Urea breath test Active H. pylori infection No Non-invasive diagnosis and confirmation of eradication.
Stool antigen test Active H. pylori infection No Non-invasive diagnosis and confirmation of eradication.
H. pylori antibody blood test Immune response to previous or current infection No Limited role; cannot reliably confirm active infection or cure.
Complete blood count Haemoglobin and blood-cell measures No May identify anaemia or clues to blood loss.

Other Tests Used During Stomach Ulcer Evaluation

Complete blood count (CBC)

A complete blood count measures haemoglobin, red blood cells, white blood cells and platelets. A low haemoglobin level may suggest blood loss or anaemia, including slow bleeding from an ulcer. A normal result does not rule out an ulcer, and a CBC cannot show the ulcer itself.

Iron studies

Ferritin and other iron studies may be requested if iron-deficiency anaemia is suspected. Iron deficiency can result from chronic gastrointestinal blood loss, but it has other possible causes and needs proper evaluation.

Stool occult blood testing

Some stool tests detect small amounts of blood that cannot be seen by the naked eye. A positive result does not identify the source, and a negative result does not reliably exclude an ulcer or intermittent bleeding. It should not replace urgent assessment when a patient has visible bleeding or other concerning symptoms.

Liver, pancreatic and other blood tests

Depending on the symptoms, a doctor may order liver function tests, pancreatic enzymes, kidney function or other investigations to look for alternative diagnoses or assess the patient’s overall condition. These tests are selected according to the clinical picture; they are not direct tests for a gastric ulcer.

Barium upper GI X-ray

A barium meal or upper GI series involves swallowing a contrast liquid while X-ray images are taken. It may show some structural abnormalities, but it does not allow the doctor to take a biopsy or treat bleeding. It is used much less often for ulcer diagnosis now that endoscopy is widely available.

How to Prepare for H. pylori Testing

Some medicines can reduce the number of H. pylori organisms or suppress the test signal, leading to a false-negative breath or stool test. Correct preparation is therefore important.

Medicines that may affect test accuracy

  • Proton pump inhibitors (PPIs): examples include omeprazole, pantoprazole, esomeprazole and lansoprazole. Many guidelines advise a two-week break before a breath or stool antigen test.
  • Antibiotics: generally need to have been stopped for at least four weeks before testing for active infection or confirming eradication.
  • Bismuth-containing medicines: can also interfere; a four-week interval is commonly advised.
Safety first: Do not stop a prescribed PPI, antibiotic, aspirin, blood thinner or any other medicine on your own. Ask the treating doctor or testing laboratory how to prepare safely. The correct plan depends on why the medicine was prescribed and the patient’s medical condition.

Confirming that H. pylori treatment worked

After treatment for H. pylori, patients should generally have a test of cure using a urea breath test, stool antigen test or an appropriate biopsy-based test. Current ACG guidance recommends testing at least four weeks after completing antibiotics and after withholding a PPI for two weeks, when clinically safe. Symptom improvement alone does not prove that the infection has been eradicated.

Who Needs an Endoscopy for Suspected Stomach Ulcer?

Endoscopy is not automatically required for every adult with occasional acidity or indigestion. Doctors consider age, symptom duration, local stomach-cancer risk, family history, medicine use and alarm features. Age thresholds in guidelines vary by country and clinical context, so there is no single age rule that applies to everyone.

Endoscopy may be considered early when there are warning features

  • Vomiting blood or black, tarry stools.
  • Iron-deficiency anaemia without a clear explanation.
  • Unintentional weight loss.
  • Persistent or recurrent vomiting.
  • Difficulty or pain when swallowing.
  • A palpable abdominal mass or other concerning examination finding.
  • New symptoms in a person whose age or risk factors increase concern for upper GI cancer.
  • Strong family history of upper gastrointestinal cancer or other significant risk factors.
  • Symptoms that persist despite appropriate initial management.
In people below the relevant age threshold and without alarm features, some guidelines support a non-invasive H. pylori test-and-treat approach or a time-limited acid-suppression trial. The clinician decides which approach is appropriate. The threshold for endoscopy may be lower in regions or individuals with higher gastric cancer risk.

Conditions That Can Be Mistaken for a Stomach Ulcer

Upper abdominal pain and burning are not specific to peptic ulcer disease. Other conditions can produce similar symptoms, which is one reason self-diagnosis is unreliable.
Condition How it may resemble an ulcer How a clinician investigates it
Gastritis Upper abdominal discomfort, nausea and indigestion. History, H. pylori testing and sometimes endoscopy with biopsy.
GERD Burning discomfort, sometimes mistaken for upper stomach pain. Symptom assessment; endoscopy or reflux testing in selected cases.
Functional dyspepsia Fullness, early satiety and upper abdominal discomfort without an ulcer explaining symptoms. Clinical assessment and selective testing to exclude other disease.
Gallstones or gallbladder disease Upper abdominal pain, nausea, sometimes after meals. Examination, liver tests and usually ultrasound when suspected.
Pancreatic disease Upper abdominal pain, sometimes radiating to the back. Blood tests and imaging according to clinical suspicion.
Heart-related disease Some cardiac problems can feel like indigestion or upper abdominal discomfort. Urgent assessment, ECG and cardiac tests when indicated.
Chest pressure, breathlessness, sweating, faintness or pain spreading to the arm, jaw or back should not automatically be attributed to acidity or an ulcer. Seek emergency assessment if a heart problem is possible.

What Happens After a Stomach Ulcer Is Diagnosed?

The next step is to identify the cause, assess complications and plan treatment. Management commonly includes acid suppression, treatment of H. pylori if present, and addressing ulcer-causing medicines where possible.

If H. pylori is positive

The doctor prescribes an appropriate combination of medicines to eradicate the infection. Antibiotic choice should take account of local resistance patterns, previous antibiotic exposure, allergies and current guidelines. Patients should complete the prescribed course and undergo a test of cure. Do not use leftover antibiotics or choose an eradication regimen without medical advice.

If NSAIDs may be responsible

The clinician reviews whether the NSAID can be stopped, reduced or replaced and whether acid-protective treatment is needed. If aspirin or an antiplatelet drug is being used to prevent a heart attack or stroke, stopping it without medical advice can be dangerous. The prescribing clinician should make that decision.

Why repeat endoscopy may be recommended

Follow-up may be advised for a gastric ulcer to confirm healing, reassess a lesion or review biopsy findings. Repeat endoscopy is not required for every uncomplicated duodenal ulcer. The decision depends on ulcer location, size, appearance, initial biopsy, symptoms and risk factors.

When to Seek Urgent Medical Care

Go to an emergency department immediately if you have any of the following:
  • Vomiting fresh red blood or material that looks like coffee grounds.
  • Black, sticky, tar-like stools, especially with weakness or dizziness.
  • Sudden, severe or rapidly worsening abdominal pain, particularly with a rigid or very tender abdomen.
  • Fainting, confusion, marked weakness, cold clammy skin, rapid pulse or collapse.
These can indicate significant bleeding, perforation or another emergency. Do not wait for a routine outpatient appointment or attempt to manage these symptoms at home.
Arrange prompt medical assessment for unexplained weight loss, persistent vomiting, difficulty swallowing, worsening symptoms or possible anaemia, even if there is no visible blood.

Stomach Ulcer Diagnosis: Step-by-Step Summary

Remember: a breath or stool test diagnoses active H. pylori infection, not the ulcer itself. Endoscopy is the test that lets the doctor see the ulcer directly.

Frequently Asked Questions

1. What is the most accurate test to diagnose a stomach ulcer?

Upper GI endoscopy is the direct test because the doctor can see the stomach lining, identify an ulcer and take a biopsy if needed. The best investigation for an individual depends on symptoms and risk factors.

2. Can a blood test detect a stomach ulcer?

No routine blood test confirms a stomach ulcer. A CBC may reveal anaemia from blood loss, while other blood tests may help assess complications or alternative diagnoses. Endoscopy is used to visualize an ulcer.

3. Can a stomach ulcer be diagnosed without endoscopy?

Sometimes doctors can initially manage a lower-risk patient using clinical assessment and non-invasive H. pylori testing. However, a breath or stool test detects the infection, not the ulcer. Endoscopy may still be required if symptoms persist, risk is higher or alarm features are present.

4. Which is better for H. pylori: a breath test or stool test?

Both the urea breath test and a validated stool antigen test are accurate non-invasive options for detecting active H. pylori infection. Availability, patient preference, laboratory quality and preparation requirements help determine which is used.

5. Can an ultrasound detect a stomach ulcer?

Routine abdominal ultrasound is not a reliable test for directly diagnosing a stomach ulcer because it does not adequately show the stomach’s inner lining. Ultrasound may be useful to investigate other causes of abdominal pain, such as gallstones.

6. Does every stomach ulcer require endoscopy?

No. Some patients without alarm features may initially undergo non-invasive H. pylori testing and medical management. Endoscopy is more likely to be needed when there are warning symptoms, higher cancer risk, persistent symptoms or uncertainty about the diagnosis.

7. Is biopsy necessary during every endoscopy for an ulcer?

Not in every case, but biopsies are commonly considered for gastric ulcers to examine tissue, test for H. pylori and exclude a malignant cause when appropriate. The decision depends on the ulcer’s appearance and the patient’s risk factors.

8. Can an H. pylori test be falsely negative?

Yes. PPIs, antibiotics and bismuth can reduce test sensitivity. A clinician may advise a medication washout before breath or stool testing, provided it is safe to do so.

9. How long after H. pylori treatment should I repeat the test?

For a test of cure, current guidance generally recommends waiting at least four weeks after antibiotics and being off PPIs for two weeks, if medically safe. Follow the treating clinician’s and laboratory’s instructions.

10. Can a stomach ulcer heal without treatment?

Some ulcers may improve, but untreated ulcers can bleed, perforate or cause narrowing. The cause must be addressed, especially H. pylori infection or NSAID exposure. Medical evaluation is important rather than waiting for symptoms to disappear.

11. Does a normal endoscopy rule out every cause of stomach pain?

No. A normal upper endoscopy makes an active visible ulcer less likely at the time of examination, but it does not rule out gallbladder, pancreatic, cardiac, functional or other causes. Further evaluation depends on the symptoms.

12. Can an ulcer be cancerous?

Most peptic ulcers are not cancer, but some stomach cancers can resemble an ulcer. This is one reason doctors may biopsy a gastric ulcer and recommend follow-up endoscopy in selected patients.

Conclusion

How to diagnose a stomach ulcer is an important question because symptoms such as acidity, burning and upper abdominal pain are not specific to ulcers. A careful medical history and examination help determine the next step. Upper GI endoscopy allows direct visualization of a gastric or duodenal ulcer and provides an opportunity to take biopsies. Urea breath and stool antigen tests identify active H. pylori infection, while blood tests help detect anaemia and assess the patient’s general condition. The most appropriate test is not the same for every patient. People with bleeding, sudden severe pain, fainting or other emergency symptoms need immediate care. Those with persistent symptoms, unexplained weight loss, anaemia or swallowing difficulty should seek prompt medical assessment. Accurate diagnosis identifies not only whether an ulcer is present, but also its cause and the safest plan to prevent recurrence and complications.

Medical Disclaimer and Review

This article is for general educational purposes and does not replace a consultation, examination or individualized medical advice. Do not start, stop or change prescription medicines, including aspirin, anticoagulants, NSAIDs or acid-suppressing drugs, without speaking to the prescribing clinician. Diagnostic pathways and endoscopy thresholds vary according to age, local cancer risk, medical history and current guidelines. Seek emergency care for signs of gastrointestinal bleeding, perforation or circulatory collapse.  

References and Further Reading

  1. National Institute of Diabetes and Digestive and Kidney Diseases (NIDDK): Diagnosis of Peptic Ulcers. Covers medical history, examination, H. pylori tests, endoscopy, biopsy and imaging.
  2. NIDDK: Upper GI Endoscopy. Explains indications, preparation, procedure and recovery.
  3. American College of Gastroenterology (ACG): 2024 Guideline Highlights—Treatment of H. pylori Infection. Includes who should be tested and how to confirm eradication.
  4. American Family Physician: Peptic Ulcer Disease and H. pylori Infection—Common Questions and Answers. Reviews non-invasive and endoscopic testing.
  5. National Institute for Health and Care Excellence (NICE): Gastro-oesophageal Reflux Disease and Dyspepsia in Adults. Includes H. pylori test preparation and referral recommendations.
  6. Society of Gastrointestinal Endoscopy of India: Understanding Upper Endoscopy. Patient information on endoscopy, biopsy and preparation.
  7. Mayo Clinic: H. pylori Infection—Diagnosis and Treatment. Explains breath, stool and endoscopic testing.
  8. MSD Manual Professional: H. pylori Infection. Discusses non-invasive testing, medication interference and biopsy-based methods.

Patient education video

For a visual explanation of what happens during endoscopy, watch this patient-education video from Apollo Hospitals Delhi: How is endoscopy performed? Procedure explained by a gastroenterologist.

The article prioritizes government health information, professional society guidance and recognized medical references. Medication washout periods and decisions about endoscopy should be individualized by the treating clinician.

 

📲 For Health-Related Articles & Videos

🔹 Facebook: https://www.facebook.com/positivemind.healthcare

ENT Consultation & Surgery

Dr. Sagar Rajkuwar (MS-ENT) Consultant ENT Specialist & Head-Neck Surgeon
Prabha ENT Clinic, Ambad, Nashik, Maharashtra, India

📱 7387590194 | 9892596635

🌐 www.entspecialistinnashik.com

 

Our Newsletters

Get our best recipes and tips in your inbox. Sign up now!

Categories

Recent Posts