Background: Pulse oximetry, used to monitor oxygen saturation during endoscopy, does not directly measure hypoventilation. Study goals were to determine whether transcutaneous carbon dioxide (PtcCO2) monitoring during endoscopic retrograde cholangiopancreatography (ERCP) prevents severe hypoventilation and to assess the accuracy of clinical observation and pulse oximetry in detecting hypoventilation. Methods: All patients received intensive clinical and electronic monitoring including pulse oximetry. Supplemental oxygen was administered for pulse oximetry < 90%. Patients were randomized to a treatment arm (group 1) where PtcCO2 monitoring guided sedation or a control arm (group 2) where PtcCO2 was recorded but unavailable for guiding sedation. Results: Group 1 had significantly fewer episodes of severe carbon dioxide retention (rise in PtcCO2 ≥40 mm Hg above baseline) than group 2 (0 of 199 versus 5 of 196, respectively, p = 0.03), as well a shorter mean duration of procedure discomfort (8.3% of procedure duration rated as 'uncomfortable' versus 11.5%, p = 0.04). Correlations between clinical observation and objective measures of ventilation were poor: level of sedation versus PtcCO2 (R = 0.3) or pulse oximetry (R = 0.06); slowest respiratory rate versus PtcCO2 (R = 0.4) or pulse oximetry (R = - 0.4). PtcCO2 rises of greater than 20 mm Hg occurred without oxygen desaturation in 10.7% of patients receiving supplemental oxygen. Conclusions: Carbon dioxide retention during ERCP is not reliably detected by clinical observation or by pulse oximetry in patients receiving supplemental oxygen. The addition of PtcCO2 monitoring prevents severe carbon dioxide retention more effectively than intensive clinical monitoring and pulse oximetry alone. The clinical relevancy of this observation needs to be determined in an appropriately designed outcome study.