University of California San Francisco

    Upper (GI) Endoscopy

    Upper GI endoscopy is a procedure in which a doctor uses an endoscope—a long, flexible tube with a camera—to see the lining of your upper GI tract. A gastroenterologist, surgeon, or other trained health care provider performs the procedure, most often while you receive light sedation. Your doctor may also call the procedure an EGD or esophagogastroduodenoscopy.

    Why do doctors use upper GI endoscopy?

    Upper GI endoscopy can help find the cause of unexplained symptoms, such as

    • persistent heartburn
    • bleeding
    • nausea and vomiting
    • pain
    • problems swallowing
    • unexplained weight loss

    Upper GI endoscopy can also find the cause of abnormal lab tests, such as

    • anemia
    • ​nutritional deficiencies

    Upper GI endoscopy can identify many different diseases

    During upper GI endoscopy, a doctor obtains biopsies by passing an instrument through the endoscope to obtain a small piece of tissue. Biopsies are needed to diagnose conditions such as

    • cancer
    • celiac disease
    • gastritis

    Doctors also use upper GI endoscopy to

    • treat conditions such as bleeding ulcers
    • dilate strictures with a small balloon passed through the endoscope
    • remove objects, including food, that may be stuck in the upper GI tract

    How do I prepare for an upper GI endoscopy?

    Talk with your doctor

    You should talk with your doctor about medical conditions you have and all prescribed and over-the-counter medicines, vitamins, and supplements you take, including 

    • aspirin or medicines that contain aspirin
    • arthritis medicines
    • nonsteroidal anti-inflammatory drugs such as ibuprofen and naproxen
    • blood thinners
    • blood pressure medicines
    • diabetes medicines

    Arrange for a ride home

    For safety reasons, you can't drive for 24 hours after the procedure, as the sedatives used during the procedure need time to wear off. You will need to make plans for getting a ride home after the procedure. 

    Do not eat or drink before the procedure

    The doctor needs to examine the lining of your upper GI tract during the procedure. If food or drink is in your upper GI tract when you have the procedure, the doctor will not be able to see this lining clearly. To make sure your upper GI tract is clear, the doctor will most often advise you not to eat, drink, smoke, or chew gum during the 8 hours before the procedure. 

    How do doctors perform an upper GI endoscopy?

    A doctor performs an upper GI endoscopy in a hospital or an outpatient center. An intravenous (IV) needle will be placed in your arm to provide a sedative. Sedatives help you stay relaxed and comfortable during the procedure. In some cases, the procedure can be performed without sedation. You will be given a liquid anesthetic to gargle or spray anesthetic on the back of your throat. The anesthetic numbs your throat and calms the gag reflex. The health care staff will monitor your vital signsExternal NIH Link and keep you as comfortable as possible.

    You’ll be asked to lie on your side on an exam table. The doctor will carefully feed the endoscope down your esophagus and into your stomach and duodenum.A small camera mounted on the endoscope will send a video image to a monitor, allowing close examination of the lining of your upper GI tract. The endoscope pumps air into your stomach and duodenum, making them easier to see.

    During the upper GI endoscopy, the doctor may

    • perform a biopsy of tissue in your upper GI tract. You won’t feel the biopsy.
    • stop any bleeding.
    • perform other specialized procedures, such as dilating strictures.

    ​​​The procedure most often takes between 15 and 30 minutes. The endoscope does not interfere with your breathing, and many people fall asleep during the procedure.

    What should I expect from an upper GI endoscopy?

    After an upper GI endoscopy, you can expect the following: 

    • to stay at the hospital or outpatient center for 1 to 2 hours after the procedure so the sedative can wear off​
    • bloating or nausea for a short time after the procedure
    • a sore throat for 1 to 2 days to go back to your normal diet once your swallowing has returned to normal
    • to rest at home for the remainder of the day

    Following the procedure, you—or a friend or family member who is with you if you’re still groggy—will receive instructions on how to care for yourself following the procedure. You should follow all instructions.

    Some results from an upper GI endoscopy are available right away after the procedure. After the sedative has worn off, the doctor will share these results with you or, if you choose, with your friend or family member. A pathologist will examine the biopsy tissue to help confirm a diagnosis. Biopsy results take a few days or longer to come back.​

    What are the risks of an upper GI endoscopy?

    The risks of an upper GI endoscopy include 

    • bleeding from the site where the doctor took the biopsy or removed a polyp
    • perforation in the lining of your upper GI tract
    • an abnormal reaction to the sedative, including respiratory or cardiac problems

    Bleeding and perforation are more common in endoscopies used for treatment rather than testing. Bleeding caused by the procedure often stops without treatment. Research has shown that serious complications occur in one out of every 1,000 upper GI endoscopies.1 A doctor may need to perform surgery to treat some complications. A doctor can treat an abnormal reaction to a sedative with medicines or IV fluids during or after the procedure.

    Seek Care Right Away

    If you have any of the following symptoms after an upper GI endoscopy, seek medical care right away: 

    • chest pain
    • problems breathing
    • problems swallowing or throat pain that gets worse
    • vomiting—particularly if your vomit is bloody or looks like coffee grounds
    • pain in your abdomen that gets worse
    • bloody or black, tar-colored stool
    • fever​

    1Yusuf TE, Bhutani MS. Esophagogastroduodenoscopy. Medscape website. http://emedicine.medscape.com/article/1851864-overview#a17 . Updated June 3, 2013. Accessed July 8, 2014.​


    This content is provided as a service of the National Institute of Diabetes and Digestive and Kidney Diseases (NIDDK), part of the National Institutes of Health. The NIDDK translates and disseminates research findings through its clearinghouses and education programs to increase knowledge and understanding about health and disease among patients, health professionals, and the public. Content produced by the NIDDK is carefully reviewed by NIDDK scientists and other experts.

    This information is not copyrighted. The NIDDK encourages people to share this content freely.


    ​​​​November 2014​​​