Intravenous midazolam (mean dose of 6.3 mg) was given to 100 consecutive patients coming to endoscopy. All patients had an ear oximeter attached throughout the procedure to record continuously their levels of oxygen saturation. Eighty-five of the 100 patients had pre-endoscopy respiratory function tests measured, and 82 wore an induction plethysmograph vest to get a continuous qualitative estimate of respiratory rate and excursion throughout the procedure. Following intravenous midazolam a reduction in respiratory excursion was observed in 80% of patients. The initial baseline oxygen saturation of 95.4% fell 3.3% (P less than 0.0005) following intravenous midazolam to 92.1%. During the endoscopic procedure there was a further 3.1% decrease in oxygen saturation to 89.0% (P less than 0.0005) and in 7% the level fell to below 80%. Age, sex, dose of midazolam given and pre-endoscopy respiratory function tests failed to identify those patients at risk of hypoxia during the endoscopy.