Upper Gastrointestinal Endoscopy

Skip to the navigation

Test Overview

An upper gastrointestinal (UGI) endoscopy is a procedure that allows your doctor to look at the inside lining of your esophagus, your stomach, and the first part of your small intestine (duodenum). A thin, flexible viewing tool called an endoscope (scope) is used. The tip of the scope is inserted through your mouth and then gently moved down your throat into the esophagus, stomach, and duodenum (upper gastrointestinal tract).

This procedure is sometimes called esophagogastroduodenoscopy (EGD).

Using the scope, your doctor can look for ulcers, inflammation, tumors, infection, or bleeding. He or she can collect tissue samples (biopsy), remove polyps, and treat bleeding through the scope. Your doctor may find problems that do not show up on X-ray tests.

This test can sometimes prevent the need for exploratory surgery.

Why It Is Done

An upper gastrointestinal (UGI) endoscopy may be done to:

  • Find problems in the upper gastrointestinal (GI) tract. These problems can include:
  • Find the cause of vomiting blood.
  • Find the cause of symptoms, such as upper belly pain or bloating, trouble swallowing (dysphagia), vomiting, or unexplained weight loss.
  • Find the cause of an infection.
  • Check the healing of stomach ulcers.
  • Look at the inside of the stomach and upper small intestine (duodenum) after surgery.
  • Look for a blockage in the opening between the stomach and duodenum.

Endoscopy may also be done to:

  • Check for an injury to the esophagus in an emergency. (For example, this may be done if the person has swallowed poison.)
  • Collect tissue samples (biopsy) to be looked at in the lab.
  • Remove growths (polyps) from inside the esophagus, stomach, or small intestine.
  • Treat upper GI bleeding that may be causing anemia.
  • Remove foreign objects that have been swallowed.

How To Prepare

Before having an upper gastrointestinal endoscopy, tell your doctor if you:

  • Are allergic to any medicines, including anesthetics.
  • Are taking any medicines.
  • Have bleeding problems or take blood-thinning medicine, such as warfarin (Coumadin).
  • Have heart problems.
  • Are or might be pregnant.
  • Have diabetes and take insulin.
  • Have had surgery or radiation treatments to your esophagus, your stomach, or the upper part of your small intestine.

Do not eat or drink anything for 6 to 8 hours before the test. An empty stomach helps your doctor see your stomach clearly during the test. It also reduces your chances of vomiting. If you vomit, there is a small risk that the vomit could enter your lungs. (This is called aspiration.) If the test is done in an emergency, a tube may be inserted through your nose or mouth to empty your stomach.

You may be asked to sign a consent form that says you understand the risks of the test and agree to have it done.

Talk to your doctor about any concerns you have about the need for the test, its risks, how it will be done, or what the results will mean. To help you understand the importance of this test, fill out the medical test information form (What is a PDF document?).

You may be asked to stop taking aspirin products, nonsteroidal anti-inflammatory drugs (NSAIDs), and iron supplements 7 to 14 days before the test. If you take blood-thinning medicines regularly, talk with your doctor about how to manage your medicine.

Do not take sucralfate (Carafate) or antacids on the day of the test. These medicines can make it hard for your doctor to see your upper GI tract.

Before the test, you will put on a hospital gown. If you are wearing dentures, jewelry, contact lenses, or glasses, remove them. For your own comfort, empty your bladder before the test.

Arrange to have someone take you home after the test. You will be given a sedative before the test and will need a ride home.

How It Is Done

A gastrointestinal endoscopy may be done in a doctor's office, a clinic, or a hospital. An overnight stay in the hospital usually isn't needed. The test is most often done by a doctor who specializes in problems of the digestive system (gastroenterologist). The doctor may also have an assistant. Some family medicine doctors, internists, and surgeons are also trained to do this test.

Before the procedure, blood tests may be done to check for a low blood count or clotting problems. Your throat may be numbed with an anesthetic spray, gargle, or lozenge. This is to relax your gag reflex and make it easier to insert the endoscope into your throat.

During the test, you may get a pain medicine and a sedative through an intravenous (IV) line in your arm or hand. These medicines reduce pain and will make you feel relaxed and drowsy during the test. You may not remember much about the actual test.

You will be asked to lie on your left side with your head bent slightly forward. A mouth guard may be placed in your mouth to protect your teeth from the endoscope (scope). Then the lubricated tip of the scope will be guided into your mouth. Your doctor may gently press your tongue out of the way. You may be asked to swallow to help move the tube along. The scope is no thicker than many foods you swallow. It will not cause problems with breathing.

After the scope is in your esophagus, your head will be tilted upright. This makes it easier for the scope to slide down your esophagus. During the procedure, try not to swallow unless you are asked to. Someone may remove the saliva from your mouth with a suction device. Or you can allow the saliva to drain from the side of your mouth.

Your doctor will look through an eyepiece or watch a screen while he or she slowly moves the endoscope. The doctor will check the walls of your esophagus, stomach, and duodenum. Air or water may be injected through the scope to help clear a path for the scope or to clear its lens. Suction may be applied to remove air or secretions.

A camera attached to the scope takes pictures. The doctor may also insert tiny tools such as forceps, clips, and swabs through the scope to collect tissue samples (biopsy), remove growths, or stop bleeding.

To make it easier for your doctor to see different parts of your upper gastrointestinal (GI) tract, someone may change your position or apply gentle pressure to your belly. After the exam is done, the scope is slowly withdrawn.

After the test

The test usually takes 30 to 45 minutes. But it may take longer, depending upon what is found and what is done during the test.

After the test, you will be observed for 1 to 2 hours until the medicines wear off. If your throat was numbed before the test, you should not eat or drink until your throat is no longer numb and your gag reflex has returned to normal.

When you are fully recovered, you can go home. You will not be able to drive or operate machinery for 12 hours after the test. Your doctor will tell you when you can go back to your usual diet and activities. Do not drink alcohol for 12 to 24 hours after the test.

How It Feels

You may notice a brief, sharp pain when the intravenous (IV) needle is placed in a vein in your arm. The local anesthetic sprayed into your throat usually tastes slightly bitter. It will make your tongue and throat feel numb and swollen. Some people report that they feel as if they can't breathe at times because of the tube in their throat. But this is a false sensation caused by the anesthetic. There is always plenty of breathing space around the tube in your mouth and throat. Remember to relax and take slow, deep breaths.

During the test, you may feel very drowsy and relaxed from the sedative and pain medicines. You may have some gagging, nausea, bloating, or mild cramping in your belly as the tube is moved. If you have pain, alert your doctor with an agreed-upon signal or a tap on the arm. Even though you won't be able to talk during the procedure, you can still communicate.

The suction machine used to remove secretions may be noisy, but it does not cause pain. The removal of biopsy samples is also painless.

You will feel groggy after the test until the medicine wears off. This usually takes a few hours. Many people report that they remember very little of the test because of the sedative given before and during the test.

After the test, you may belch and feel bloated for a while. You may have a tickling, dry throat or mouth. You may feel a bit hoarse, and you may have a mild sore throat. These symptoms may last several days. Throat lozenges and warm saltwater gargles can help relieve the throat symptoms.

If your child is having this procedure, the same is also true. If your child has a sore throat and is age 4 or older, you can give him or her throat lozenges. Also, a child age 8 or older can gargle with warm salt water.

Do not drink alcohol after the test.


Complications are rare. There is a slight risk that your esophagus, stomach, or upper small intestine will get a small hole in it. If this happens, you may need to have surgery to fix it. There is also a slight chance of infection after an endoscopy.

Bleeding may also occur from the test or if a tissue sample (biopsy) is taken. But the bleeding usually stops on its own without treatment. If you vomit during the exam and some of the vomit enters your lungs, aspiration pneumonia is a possible risk. If it happens, it can be treated with antibiotics.

An irregular heartbeat may occur during the test. But it almost always goes away on its own without treatment.

The risk of problems is higher in people who have serious heart disease, older adults, and those who are frail or physically weakened. Talk to your doctor about your specific risks.

After the test

After the test, call 911 or other emergency services right away if you have:

After the test, call your doctor right away if you:

  • Feel short of breath or dizzy.
  • Have symptoms of infection, such as fever or chills.
  • Vomit blood, whether it is fresh and red or is old and looks like coffee grounds.


An upper gastrointestinal (UGI) endoscopy allows your doctor to look at the inside lining of your esophagus, your stomach, and the first part of your small intestine (duodenum). The doctor uses a thin, flexible viewing tool called an endoscope.

Your doctor may be able to talk to you about some of the findings right after your endoscopy. But the medicines you get to help relax you may impair your memory, so your doctor may wait until they fully wear off. It may take 2 to 4 days for some results. Tests for certain infections may take several weeks.

Upper gastrointestinal endoscopy findings

The esophagus, stomach, and upper small intestine (duodenum) look normal.


Inflammation or irritation is found in the esophagus, stomach, or small intestine.

Bleeding, an ulcer, a tumor, a tear, or dilated veins are found.

A hiatal hernia is found.

A too-narrow section (stricture) is found in the esophagus.

A foreign object is found in the esophagus, stomach, or small intestine.

A biopsy sample may be taken to:

  • Find out if tumors or ulcers contain cancer cells.
  • Identify a type of bacteria called H. pylori or a fungus such as candida that sometimes causes infectious esophagitis.

Many conditions can affect the results of this test. Your doctor will discuss your results with you in relation to your symptoms and past health.

What Affects the Test

You may not be able to have the test, or the results may not be helpful, if you just had another test that uses barium contrast material. An upper gastrointestinal endoscopy should not be done less than 2 days after you have a type of X-ray test called an upper gastrointestinal (GI) series so your doctor can see your stomach and small intestine.

What To Think About

  • An upper gastrointestinal (GI)endoscopy is the best way to examine your esophagus, stomach, and upper small intestine (duodenum). Your doctor can take a tissue sample to test for H. pylori infection, which is believed to be the main cause of stomach or duodenal ulcers. To learn more, see the topic Helicobacter Pylori Tests.
  • Cancer can be found or ruled out using endoscopy.
  • Endoscopy may be done after an upper GI series test finds a problem. To learn more, see the topic Upper Gastrointestinal Series.
  • Small children can safely have endoscopy.


Other Works Consulted

  • Chernecky CC, Berger BJ (2008). Laboratory Tests and Diagnostic Procedures, 5th ed. St. Louis: Saunders.
  • Fischbach FT, Dunning MB III, eds. (2009). Manual of Laboratory and Diagnostic Tests, 8th ed. Philadelphia: Lippincott Williams and Wilkins.
  • Pagana KD, Pagana TJ (2010). Mosby’s Manual of Diagnostic and Laboratory Tests, 4th ed. St. Louis: Mosby Elsevier.


ByHealthwise Staff
Primary Medical Reviewer E. Gregory Thompson, MD - Internal Medicine
Specialist Medical Reviewer Jerome B. Simon, MD, FRCPC, FACP - Gastroenterology

Current as ofNovember 14, 2014