An upper endoscopy can help doctors check whether upper-abdominal symptoms are related to gastritis (inflammation of the stomach lining) or a peptic ulcer (an open sore in the stomach or first part of the small intestine). A doctor passes a thin, flexible camera through the mouth to examine these areas and may take tissue samples. Doctors decide based on symptoms, age, history, and risk factors.
When is endoscopy recommended for suspected gastritis or an ulcer?
Doctors may recommend an upper gastrointestinal (GI) endoscopy when symptoms persist, keep returning, or require further investigation. The procedure can help identify inflammation, ulcers, bleeding, and other abnormalities that may not be explained by symptoms alone. According to the National Institute of Diabetes and Digestive and Kidney Diseases (NIDDK), endoscopy may be considered when indigestion occurs alongside concerning features such as difficulty swallowing, frequent vomiting, evidence of digestive tract bleeding, unexplained weight loss, or a family history of cancer.
Symptoms that may lead a healthcare professional to investigate the upper digestive tract include:
- Persistent or recurring pain, burning, or discomfort in the upper abdomen.
- Nausea or repeated vomiting.
- Feeling full sooner than expected when eating.
- Difficulty swallowing or pain when swallowing.
- Unexplained weight loss or anemia, which may result from blood loss.
- Possible signs of bleeding, such as black, tarry stools or blood in vomit.
These symptoms can have several causes. A doctor considers their duration, pattern, associated symptoms, medical history, medication use, and examination findings before deciding whether endoscopy is appropriate. People with uncomplicated indigestion may be able to start with other tests rather than having an endoscopy immediately.
What can an endoscopy reveal about gastritis or an ulcer?
An upper endoscopy, also called gastroscopy or esophagogastroduodenoscopy (EGD), allows a specialist to examine the lining of the esophagus, stomach, and duodenum, the first part of the small intestine. A tiny camera on a flexible tube sends images to a monitor, helping the doctor look for changes in the digestive tract lining.
The examination may reveal redness, irritation, erosions, ulcers, active or recent bleeding, or other abnormal areas. It can also help identify problems affecting the esophagus or duodenum that may contribute to symptoms. According to the NIDDK guidance on diagnosing gastritis and gastropathy, doctors may use endoscopy with tissue samples to diagnose stomach-lining inflammation or damage, investigate its cause, and assess complications.
Why might the doctor take a biopsy?
A biopsy involves collecting one or more tiny pieces of tissue through the endoscope. The samples are examined under a microscope to assess the stomach lining and look for changes that may not be clear from the camera images alone. Taking a biopsy does not automatically mean that the doctor suspects cancer; tissue samples are commonly collected to help establish a diagnosis or identify a possible cause.
Biopsy samples may also be tested for Helicobacter pylori (H. pylori), a bacterium associated with gastritis and peptic ulcers. The NIDDK guidance on diagnosing peptic ulcers explains that endoscopy can help confirm an ulcer and investigate its cause. Depending on the situation, doctors may also use a breath test or stool test to check for H. pylori.
Does everyone with suspected gastritis or an ulcer need endoscopy?
No. Endoscopy is an important diagnostic tool, but it is not necessary for every person with indigestion or upper-abdominal discomfort. A healthcare professional may recommend a noninvasive H. pylori test, a trial of acid-reducing medication, or further investigation depending on the clinical picture. Endoscopy becomes more relevant when symptoms continue despite initial evaluation or treatment, when findings suggest a complication, or when the possibility of another significant condition needs to be assessed.
How does age affect the decision?
Age is one factor in deciding when endoscopy is appropriate for persistent upper digestive symptoms. The joint American College of Gastroenterology and Canadian Association of Gastroenterology guideline on dyspepsia suggests endoscopy for people aged 60 years and older who present with dyspepsia, while recommending noninvasive H. pylori testing as an initial approach for many younger adults. The guideline allows earlier endoscopy when individual risk factors justify it. These recommendations apply to dyspepsia and are not universal age rules for every suspected ulcer; local guidance, family history, geographic background, and other clinical findings can change the decision.
How should you prepare for an upper endoscopy?
Before the procedure, the endoscopy team will explain how to prepare. Your stomach needs to be sufficiently empty for the doctor to see the lining clearly and to reduce the risk of complications. You will receive instructions about when to stop eating and drinking. Follow the instructions provided by your facility because the exact timing can vary.
Tell the team about all prescription medicines, over-the-counter medicines, vitamins, and supplements you take. Be sure to mention blood thinners, aspirin, diabetes medicines, iron supplements, medication allergies, and any important heart or lung conditions. Some medicines may need adjustment, but do not stop a prescribed medicine unless your healthcare professional tells you to do so.
The American Society for Gastrointestinal Endoscopy's patient guide to upper endoscopy explains that preparation and medication instructions should be discussed with the care team before the examination. If sedation is planned, arrange for someone to take you home and follow the facility's instructions about driving and other activities after the procedure.
What happens during the endoscopy?
An upper endoscopy is usually performed in a hospital or outpatient endoscopy unit. You will generally lie on your side while the team monitors your vital signs. Depending on the planned procedure and your needs, you may receive a sedative through a vein to help you relax and a local anesthetic spray to numb your throat.
The doctor gently guides the flexible endoscope through your mouth, down the esophagus, and into the stomach and duodenum. The camera displays the lining on a screen. You may feel pressure, fullness, or temporary discomfort as air is introduced to help the doctor see the lining. The tube does not normally block breathing. If needed, small instruments can be passed through the endoscope to collect tissue samples or treat certain problems, such as bleeding.
The examination itself often takes about 15 to 30 minutes, although preparation and recovery mean the full appointment takes longer. The medical team will monitor you as the effects of any sedative wear off.
What happens after the procedure, and when are results available?
After the examination, you will rest in a recovery area until the team considers it safe for you to leave. Temporary bloating, gas, or a mild sore throat may occur and usually improve with time. If you received sedation, your alertness may return before your judgment and reaction time are fully normal, so follow the discharge instructions and do not drive until it is safe under those instructions.
The doctor may discuss the initial findings with you once you are awake and comfortable. However, if biopsies were collected, the final interpretation may take additional time because a laboratory specialist must examine the samples. Ask when and how you will receive the results, who will explain them, and whether you need a follow-up appointment.
The results may help guide the next steps. For example, the doctor may recommend treatment for an ulcer, management of the cause of gastritis, or additional tests if the findings do not fully explain the symptoms. If H. pylori is identified, the care team can discuss appropriate treatment and whether follow-up testing is needed.
What are the risks of endoscopy?
Upper endoscopy is generally considered a safe procedure, and serious complications are uncommon. Possible risks include bleeding, a tear or perforation in the digestive tract, and a reaction to sedative medicines. The chance of complications may depend on the person's health and whether additional procedures, such as treatment of a bleeding ulcer, are performed.
According to Mayo Clinic's guide to upper endoscopy, patients should contact their healthcare professional promptly or seek emergency care if concerning symptoms occur after the procedure. These include severe or persistent abdominal pain, chest pain, difficulty swallowing, shortness of breath, fever, vomiting blood, or black or very dark stools.
When should you seek urgent medical attention?
Do not wait for a scheduled endoscopy if you have signs that may indicate significant digestive tract bleeding or another emergency. Vomiting blood or material that looks like coffee grounds, passing black and tarry stools, fainting, or experiencing sudden, severe abdominal pain warrants urgent medical assessment. Seek emergency care, particularly if bleeding is ongoing or you feel weak, dizzy, or short of breath.
For symptoms that are persistent, worsening, or interfering with eating and everyday activities, arrange a medical assessment even if there are no emergency warning signs. Timely evaluation helps determine whether endoscopy, noninvasive testing, or another approach is the most appropriate next step.