Endoscopy plays a pivotal role in the management of patients with the acquired immunodeficiency syndrome (AIDS), because tissue documentation of opportunistic processes is often necessary to establish a definitive diagnosis. With progression of immunodeficiency, endoscopy becomes more important because the predisposition to opportunistic disorders of the gastrointestinal tract is greatly increased. The yield of upper endoscopy in human immunodeficiency virus (HIV)-infected patients is dependent upon the indication for the procedure, including the clinical presentation and the stage of immunodeficiency. Indications for which endoscopy has a high yield include AIDS with esophageal symptoms refractory to empirical antifungal therapy, small bowel biopsy for chronic severe diarrhea and upper gastrointestinal bleeding. Although processes can be identified, a diagnosis is less likely in patients who present with nausea and vomiting or nonspecific abdominal pain. By tailoring the use of endoscopy to the presenting symptoms and CD4 lymphocyte count, the diagnostic benefit can be increased.