To examine the role of sputum examination in the diagnosis of Pneumocystis carinii pneumonia in patients with the acquired immunodeficiency syndrome (AIDS), we conducted a prospective study of 30 patients with AIDS or suspected AIDS. Sputum was obtained just prior to bronchoscopy by spontaneous cough (20 patients) or by induction with a saline nebulizer (ten patients). Pneumocystis carinii was diagnosed by bronchoalveolar lavage in 13 of the 30 patients; two of these patients had P carinii organisms identified in sputum specimens (sensitivity of sputum, 15.3%; negative predictive value, 60.7%). A cost-analysis study demonstrated that sputum examination is not cost effective when the sensitivity is below 24%. We conclude that P carinii can be diagnosed from expectorated sputum in patients with AIDS, but, because of the test's low sensitivity, it cannot be recommended in the routine evaluation of patients with AIDS and pulmonary complaints.