An upper endoscopy, also called an upper gastrointestinal endoscopy, is a procedure used to visually examine your upper digestive system. This is done with the help of a tiny camera on the end of a long, flexible tube. A specialist in diseases of the digestive system (gastroenterologist) uses an endoscopy to diagnose and sometimes treat conditions that affect the upper part of the digestive system.

The medical term for an upper endoscopy is esophagogastroduodenoscopy. You may have an upper endoscopy done in your health care provider's office, an outpatient surgery center or a hospital.

Why it's done

An upper endoscopy is used to diagnose and sometimes treat conditions that affect the upper part of the digestive system. The upper digestive system includes the esophagus, stomach and beginning of the small intestine (duodenum).

Your provider may recommend an endoscopy procedure to:

  • Investigate symptoms. An endoscopy can help determine what's causing digestive signs and symptoms, such as heartburn, nausea, vomiting, abdominal pain, difficulty swallowing and gastrointestinal bleeding.
  • Diagnose. An endoscopy offers an opportunity to collect tissue samples (biopsy) to test for diseases and conditions that may be causing anemia, bleeding, inflammation or diarrhea. It can also detect some cancers of the upper digestive system.
  • Treat. Special tools can be passed through the endoscope to treat problems in your digestive system. For example, an endoscopy can be used to burn a bleeding vessel to stop bleeding, widen a narrow esophagus, clip off a polyp or remove a foreign object.

An endoscopy is sometimes combined with other procedures, such as an ultrasound. An ultrasound probe may be attached to the endoscope to create images of the wall of your esophagus or stomach. An endoscopic ultrasound may also help create images of hard-to-reach organs, such as your pancreas. Newer endoscopes use high-definition video to provide clearer images.

Many endoscopes are used with technology called narrow band imaging. Narrow band imaging uses special light to help better detect precancerous conditions, such as Barrett's esophagus.

From Mayo Clinic to your inbox

Sign up for free and stay up to date on research advancements, health tips, current health topics, and expertise on managing health. Click here for an email preview.

To provide you with the most relevant and helpful information, and understand which information is beneficial, we may combine your email and website usage information with other information we have about you. If you are a Mayo Clinic patient, this could include protected health information. If we combine this information with your protected health information, we will treat all of that information as protected health information and will only use or disclose that information as set forth in our notice of privacy practices. You may opt-out of email communications at any time by clicking on the unsubscribe link in the e-mail.


An endoscopy is a very safe procedure. Rare complications include:

  • Bleeding. Your risk of bleeding complications after an endoscopy is increased if the procedure involves removing a piece of tissue for testing (biopsy) or treating a digestive system problem. In rare cases, such bleeding may require a blood transfusion.
  • Infection. Most endoscopies consist of an examination and biopsy, and risk of infection is low. The risk of infection increases when additional procedures are performed as part of your endoscopy. Most infections are minor and can be treated with antibiotics. Your provider may give you preventive antibiotics before your procedure if you are at higher risk of infection.
  • Tearing of the gastrointestinal tract. A tear in your esophagus or another part of your upper digestive tract may require hospitalization, and sometimes surgery to repair it. The risk of this complication is very low — it occurs in an estimated 1 of every 2,500 to 11,000 diagnostic upper endoscopies. The risk increases if additional procedures, such as dilation to widen your esophagus, are performed.
  • A reaction to sedation or anesthesia. Upper endoscopy is usually performed with sedation or anesthesia. The type of anesthesia or sedation depends on the person and the reason for the procedure. There is a risk of a reaction to sedation or anesthesia, but the risk is low.

You can reduce your risk of complications by carefully following your health care provider's instructions for preparing for an endoscopy, such as fasting and stopping certain medications.

Symptoms that could mean a complication

Symptoms to watch for after your endoscopy include:

  • Fever
  • Chest pain
  • Shortness of breath
  • Bloody, black or very dark colored stool
  • Difficulty swallowing
  • Severe or persistent abdominal pain
  • Vomiting, especially if your vomit is bloody or looks like coffee grounds

Call your provider immediately or go to an emergency room if you experience any of these symptoms.

How you prepare

Your provider will give you specific instructions to prepare for your endoscopy. You may be asked to:

  • Fast before the endoscopy. You'll typically need to stop eating solid food for eight hours and stop drinking liquids for four hours before your endoscopy. This is to ensure your stomach is empty for the procedure.
  • Stop taking certain medications. You'll need to stop taking certain blood-thinning medications in the days before your endoscopy, if possible. Blood thinners may increase your risk of bleeding if certain procedures are performed during the endoscopy. If you have ongoing conditions, such as diabetes, heart disease or high blood pressure, your provider will give you specific instructions regarding your medications.

Tell your provider about all the medications and supplements you're taking before your endoscopy.

Plan ahead for your recovery

Most people undergoing an upper endoscopy will receive a sedative to relax them and make them more comfortable during the procedure. Plan ahead for your recovery while the sedative wears off. You may feel mentally alert, but your memory, reaction times and judgment may be impaired. Find someone to drive you home. You may also need to take the day off from work. Don't drive or make any important personal or financial decisions for 24 hours.

What you can expect

During an endoscopy

During an upper endoscopy procedure, you'll be asked to lie down on a table on your back or on your side. As the procedure gets underway:

  • Monitors often are attached to your body. This allows your health care team to monitor your breathing, blood pressure and heart rate.
  • You may receive a sedative medication. This medication, given through a vein in your forearm, helps you relax during the endoscopy.
  • An anesthetic may be used in your mouth. An anesthetic spray numbs your throat in preparation for insertion of the long, flexible tube (endoscope). You may be asked to wear a plastic mouth guard to hold your mouth open.
  • Then the endoscope is inserted in your mouth. Your provider may ask you to swallow as the scope passes down your throat. You may feel some pressure in your throat, but you shouldn't feel pain.

You can't talk after the endoscope passes down your throat, though you can make noises. The endoscope doesn't interfere with your breathing.

As the endoscope travels down your esophagus:

  • A tiny camera at the tip transmits images to a video monitor in the exam room. Your provider watches this monitor to look for anything out of the ordinary in your upper digestive tract. If something unusual is found in your digestive tract, images can be taken for later examination.
  • Gentle air pressure may be fed into your esophagus to inflate your digestive tract. This allows the endoscope to move freely. And it allows the folds of your digestive tract to be examined more easily. You may feel pressure or fullness from the added air.
  • Your provider will pass special surgical tools through the endoscope to collect a tissue sample or remove a polyp. This is done with the help from a video monitor to guide the tools.

When the exam is finished, the endoscope is slowly retracted through your mouth. An endoscopy typically takes 15 to 30 minutes.

After the endoscopy

You'll be taken to a recovery area to sit or lie quietly after your endoscopy. You may stay for an hour or so. During this time, your health care team can monitor you as the sedative begins to wear off.

Once you're at home, you may experience some mildly uncomfortable symptoms after endoscopy, such as:

  • Bloating and gas
  • Cramping
  • Sore throat

These signs and symptoms will improve with time. If you're concerned or quite uncomfortable, call your health care provider.

Take it easy for the rest of the day after your endoscopy. After receiving a sedative, you may feel alert, but your reaction times are affected and judgment is delayed.


When you receive the results of your endoscopy will depend on your situation. If, for instance, the endoscopy was performed to look for an ulcer, you may learn the findings right after your procedure. If a tissue sample (biopsy) was collected, you may need to wait a few days to get results from the testing laboratory. Ask your provider when you can expect the results of your endoscopy.

Clinical trials

Explore Mayo Clinic studies of tests and procedures to help prevent, detect, treat or manage conditions.

July 02, 2024
  1. Feldman M, et al., eds. Preparation for and complications of gastrointestinal endoscopy. In: Sleisenger and Fordtran's Gastrointestinal and Liver Disease: Pathophysiology, Diagnosis, Management. 11th ed. Elsevier; 2021. https://www.clinicalkey.com. Accessed Aug. 4, 2022.
  2. Cohen J, et al. Overview of upper gastrointestinal endoscopy (esophagogastroduodenoscopy). https://www.uptodate.com/contents/search. Accessed Aug. 4, 2022.
  3. Upper GI endoscopy. National Institute of Diabetes and Digestive and Kidney Diseases. https://www.niddk.nih.gov/health-information/diagnostic-tests/upper-gi-endoscopy. Accessed Aug. 4, 2022.
  4. Understanding upper endoscopy. American Society for Gastrointestinal Endoscopy. https://www.asge.org/home/for-patients/patient-information/understanding-upper-endoscopy. Accessed Aug. 4, 2022.
  5. Picco MF (expert opinion). Mayo Clinic. Aug. 16, 2022.

Upper endoscopy