It is unclear whether acid-base balance disturbances during the perioperative period may impact Clostridium difficile infection (CDI), which is the third most common major infection following cardiac surgery. We hypothesized that perioperative acid-base abnormalities including lactate disturbances may predict the probability of incidence of CDI in patients after cardiac procedures. Of the 12,235 analyzed patients following cardiac surgery, 143 (1.2%) developed CDI. The control group included 200 consecutive patients without diarrhea, who underwent cardiac procedure within the same period of observation. Pre-, intra and post-operative levels of blood gases, as well as lactate and glucose concentrations were determined. Postoperatively, arterial blood was drawn four times: immediately after surgery and successively; 4, 8 and 12 h following the procedure. Baseline pH was lower and PaO2 was higher in CDI patients (p < 0.001 and p = 0.001, respectively). Additionally, these patients had greater base deficiency at each of the analyzed time points (p < 0.001, p = 0.004, p = 0.012, p = 0.001, p = 0.016 and p = 0.001, respectively). Severe hyperlactatemia was also more common in CDI patients; during the cardiac procedure, 4 h and 12 h after surgery (p = 0.027, p = 0.004 and p = 0.001, respectively). Multivariate logistic regression analysis revealed that independent risk factors for CDI following cardiac surgery were as follows: intraoperative severe hyperlactatemia (OR 2.387, 95% CI 1.155-4.933, p = 0.019), decreased lactate clearance between values immediately and 12 h after procedure (OR 0.996, 95% CI 0.994-0.999, p = 0.013), increased age (OR 1.045, 95% CI 1.020-1.070, p < 0.001), emergent surgery (OR 2.755, 95% CI 1.565-4.848, p < 0.001) and use of antibiotics other than periprocedural prophylaxis (OR 2.778, 95% CI 1.690-4.565, p < 0.001). This study is the first to show that perioperative hyperlactatemia and decreased lactate clearance may be predictors for occurrence of CDI after cardiac surgery.