Gastrointestinal Endoscopy Procedure

  • Medical Author: Luigi Santacroce, MD
  • Coauthor: Tommaso Losacco, MD
  • Medical Editor: Scott H Plantz, MD, FAAEM
  • Medical Editor: Francisco Talavera, PharmD, PhD
  • Medical Editor: Ron Fuerst, MD

Facts You Should Know About Gastrointestinal Endoscopy

Endoscopy Procedure
The endoscope not only allows diagnosis of gastrointestinal (GI) disease but treatment as well.

With the procedure known as gastrointestinal endoscopy, a doctor is able to see the inside lining of your digestive tract. This examination is performed using an endoscope-a flexible fiber-optic tube with a tiny TV camera at the end. The camera is connected to either an eyepiece for direct viewing or a video screen that displays the images on a color TV. The endoscope not only allows diagnosis of gastrointestinal (GI) disease but treatment as well.

  • Current endoscopes are derived from a primitive system created in 1806-a tiny tube with a mirror and a wax candle. Although crude, this early instrument allowed the first view into a living body.
  • The GI endoscopy procedure may be performed in either an outpatient or inpatient setting. Through the endoscope, a doctor can evaluate several problems, such as ulcers or muscle spasms. These concerns are not always seen on other imaging tests.
  • Endoscopy has several names, depending on which portion of your digestive tract your doctor seeks to inspect.
    • Upper GI endoscopy (EGD): This procedure enables the examination of the esophagus, stomach and the upper small bowel called duodenum.
    • Colonoscopy: This procedure enables the doctor to see ulcers, the inflamed mucous lining of your intestine, abnormal growths and bleeding in your colon, or large bowel.
    • Enteroscopy: Enteroscopy is a recent diagnostic tool that allows a doctor to see your small bowel. The procedure may be used in the following ways:
      • To diagnose and treat hidden GI bleeding
      • To detect the cause for malabsorption
      • To confirm the problems of the small bowel seen on an X-ray
      • During surgery, to locate and remove sores with little damage to healthy tissue
  • Doctors do have other diagnostic tests besides GI endoscopy, including echography to study the upper abdomen and a barium enema and other X-ray exams that outline the digestive tract. Doctors can study the stomach juices, stools, and blood to learn about GI functions. But none of these tests offers a direct view of the mucous lining of the digestive tract.
  • Endoscopy has little value for people with the following conditions:
    • Severe coronary artery disease and acute or recent heart attack
    • Uncontrolled high or low blood pressure
    • Shock
    • Massive upper GI bleeding
    • Acute peritonitis (inflammation of certain tissues in your abdomen)
    • Injuries of the cervical spine
    • Perforation of organs of the upper GI tract
    • A history of respiratory distress
    • Severe coagulopathy, a disease in which you continue bleeding because of inadequate clotting in your blood
    • Recent upper GI tract surgery
    • Long-standing and stable inflammatory bowel diseases (except monitoring for cancers)
    • Chronic irritable bowel syndrome
    • Acute and self-limiting diarrhea
    • Bloody or tarry stools with a clear source of the bleeding
    • Pregnancy in second or third trimester
    • History of severe chronic obstructive pulmonary disease
    • Recent colon surgery or past surgery of your abdomen or pelvis resulting in internal adhesions
    • Acute diverticulitis
    • Tear in a blood vessel in your abdomen
    • Sudden colon inflammation
    • Acute inflammation of the sac that lines your abdomen
    • Uncorrectable coagulopathy, a disease in which you continue bleeding due to inadequate clotting factors in your blood
    • Massive gastrointestinal bleeding

What Are the Risks of Gastrointestinal Endoscopy?

Upper GI endoscopy (EGD): Although rare, bleeding and puncture of your esophagus or stomach walls are possible during EGD. Other complications include the following:

  • Severe irregular heartbeat
  • Pulmonary aspiration - When material, either particulate (food, foreign body) or fluid (gastric contents, blood, or saliva), enters from your throat into your windpipe
  • Infections and fever that wax and wain
  • Respiratory depression, a decrease in the rate or depth of breathing, in people with severe lung diseases or liver cirrhosis
  • The reaction of the vagus nerve system to the sedatives
  • Lower GI endoscopy (colonoscopy, sigmoidoscopy, enteroscopy): Although uncommon, possible complications of colonoscopy and sigmoidoscopy include the following:
  • Local pain
  • Dehydration (due to excess of laxatives and enemas for bowel preparation)
  • Cardiac arrhythmias
  • Bleeding and infection in the bowel, usually after a biopsy or removal of a polyp.
  • Perforation or hole in the bowel wall
  • The explosion of combustible gases in the colon (certain gases are produced within the bowel) during removal of polyps
  • Respiratory depression usually due to oversedation in people with chronic lung disease

How Do You Prepare for a Gastrointestinal Endoscopy?

Prior to all endoscopic procedures:

  • The doctor will explain to the patient the procedure, including the possibility of biopsy and risks such as the need to remove polyps or other surgical procedures.
  • The doctor will ask the patient to sign a consent form agreeing to the procedure. At the same time, he or she must inform the endoscopy team of any medications, reactions, or allergies to previous procedures or tests.
  • Wear clothing that is easily removed.
  • Remove all dentures and eyeglasses prior to beginning an upper endoscopy. For colonoscopy, dentures can be left in.
  • Stop taking any medications, such as aspirin and sucralfate (Carafate), used to treat ulcers, that could cause false readings on tests.
  • People who have had cardiac valve replacement or blood vessel graft should receive antibiotics to prevent infection.
  • Do not eat or drink anything for 8-10 hours before your examination to allow a valid examination of the upper GI tract and to lower the risk of vomiting.


  • You may be given a topical anesthetic before the test to numb your throat to prevent gagging.

Colonoscopy or sigmoidoscopy

  • Your rectum and colon should be cleaned of all fecal matter. Even a small amount of feces can reduce the reliability of the test.
  • You will change your diet prior to the test-no fibers or foods with small seeds for 5-6 days before the examination. You will drink liquids such as tea, fruit juices, and clear broth on the day prior.
  • You may be given laxatives 12-15 hours before the test. You will be asked to drink up to 4 liters (about 4 qt) of a special cleansing solution to clean out the colon. Several medications are available for bowel cleansing, including polyethylene glycol 3350 or polyethylene glycol-electrolyte solution (PEG or PEG-ELS). Brand names include (GoLYTELY, NuLYTELY, and MiraLAX:). Other laxatives to cleanse the bowel, such as magnesium citrate (Citroma) or senna (X-Prep), may also be prescribed, though polyethylene glycol (Miralax) is currently the most frequently used in colonoscopy and sigmoidoscopy preparation.
  • Smaller, low-volume preps such as SUPREP and PREPOPICK are also available.
  • You may be given 1 or 2 little enemas 2-3 hours before the flexible sigmoidoscopy procedure.
  • The doctor may perform a rectal examination to detect narrowings, polyps or abnormal growth, or hidden bleeding from your lower intestine.
  • Sodium phosphate is the only preparation available in a pill form (OsmoPrep). However, there are many patients that should not have this type of preparation due to the potential for kidney damage.  For patients with heart failure, end-stage liver disease, renal insufficiency, inflammatory bowel disease, diarrhea of unknown cause, electrolyte abnormalities, those taking diuretics or nonsteroidal anti-inflammatories, and those over age 65, the pill is not recommended.

During the Endoscopy Procedure

Upper GI endoscopy

  • You will be placed on your left side and have a plastic mouthpiece placed between your teeth to keep your mouth open and make it easier to pass the tube.
  • Most endoscopies are done with conscious sedation - which means patients are asleep and do not feel anything.
  • The doctor lubricates the endoscope, passes it through the mouthpiece, then asks you to swallow it. The doctor guides the endoscope under direct visualization through your stomach into the small intestine.
  • Any saliva you have will be cleared using a small suction tube that is removed quickly and easily after the test.
  • The doctor inspects portions of the linings of your esophagus, stomach, and the upper portion of your small intestine and then reinspects them as the instrument is withdrawn.
  • If necessary, biopsies and removal of foreign bodies and polyps may be performed.
  • The procedure usually is completed within 10-15 minutes. Any surgical procedures will require several minutes.

Lower GI endoscopy (colonoscopy)

  • You will be placed on your left side with your hips back, flexed beyond your abdominal wall.
  • The doctor lubricates the endoscope and inserts it into your anus and advances it under direct vision.
  • The doctor will study your colon and rectum walls and reinspect them as the endoscope is withdrawn. If necessary, surgeries may be performed.
  • You may feel uneasiness and abdominal pain. The procedure usually takes 15-20 minutes. Any surgeries will require additional time, depending on the type.
  • Most colonoscopies are done with conscious sedation. Patients are asleep and should not feel anything. Office sigmoidoscopies are done on awake patients, but these are not done very often anymore. 

After the Endoscopy Procedure

  • If you have been sedated, you will be moved to a recovery area to wake up.
  • Once sedation has worn off before you are discharged from the medical center, you will be given instructions and told to call your doctor if complications develop.
  • You should have someone there to take you home. You should not drive a car or use other machinery or drink alcohol for at least a day. You may feel drowsy.
  • At home, it would be best to have a light meal and rest for the remainder of the day.

When to Seek Medical Care

If any of the following symptoms develop, you should call your doctor.

  • Any unexplained and chronic abdominal or chest pain, even heartburn
  • Vomiting or reflux
  • Swallowing difficulties or pain on swallowing
  • Bleeding in your esophagus
  • Nausea
  • Indigestion
  • Weight loss
  • Anemia
  • Any long-standing and unexplained changes in bowel habits
  • Abdominal pain
  • Diarrhea
  • Black or tarry stools or bleeding through your rectum

Gastrointestinal Tract Cancer and Digestive Endoscopy

Endoscopy is very important to detect early cancers developing from the mucous coverings in either the upper or lower tracts of the digestive tube. Colon cancers can develop if intestinal polyps are not removed. Polyps can grow until they become cancer.

Several studies report that growth of these polyps may take as long as 10 years. People who are at low risk for cancer, or even have no symptoms, should schedule a colonoscopy at age 50 years. Those who are high-risk should begin regular screening based on their physician's recommendation. The following conditions can put you at high risk for cancer.

  • HP (Helicobacter pylori) infections: H pylori bacteria are thought to cause gastric tumors. Patients positive for H. Pylori should be treated for the bacteria and retested after 4 weeks of completion of therapy to confirm eradication.
  • Inflammatory bowel diseases
  • Ulcerative colitis
  • Family or personal history of GI cancer or cancer in other organs
  • The family history of developing gland like polyps
  • People with gastroesophageal reflux disease or GERD, especially those who smoke and drink regularly and complain of chronic heartburn, are at high risk for a cancer of the esophagus-a dramatic and deadly disease.
  • Changes in the lining of your esophagus (Barrett's esophagus) may be detected early in a person with chronic heartburn by means of EGD. People with this condition should discuss how frequently to have screening with EGD's with their physicians.

Gastrointestinal Endoscospy Pictures

The whole system for GI endoscopy, including the fiberoptic scope with embedded camera, monitor, keyboard, video recorder, and photo printer system.
The whole system for GI endoscopy, including the fiberoptic scope with embedded camera, monitor, keyboard, video recorder, and photo printer system.

An endoscopic unit. The operator shows the probe.
An endoscopic unit. The operator shows the probe.

Large esophageal varices observed at EGDS.
Large esophageal varices observed at EGDS.

Medically reviewed by Venkatachala Mohan, MD; Board Certified Internal Medicine with subspecialty in Gastroenterology

"Upper endoscopy (Beyond the Basics)." UpToDate.

Losacco T. Endoscopic diagnosis of GI tract conditions. Academic Lesson. 2000.

Pansky JL. Upper and lower gastrointestinal endoscopy. In: Nyhus LM, et al, eds. Mastery of Surgery. Vol 1. 1997:246-254.

SAGES. Patient Information from Your Surgeon & SAGES: Upper Endoscopy. Society of American Gastrointestinal Endoscopic Surgeons. Accessed 1997.

SAGES. Patient Information from Your Surgeon & SAGES: Colonoscopy. Society of American Gastrointestinal Endoscopic Surgeons. Accessed 1997.

SAGES. Patient Information from Your Surgeon & SAGES: Flexible Sigmoidoscopy. Society of American Gastrointestinal Endoscopic Surgeons. Accessed 1997.