In one aspect of the invention, a method includes determining an amount of carbon dioxide (CO2) in dialysate flowing through a dialysis system using a CO2 sensor associated with the dialysis system, determining, using a pH sensor associated with the dialysis system, a pH level of the dialysate, and calculating a level of bicarbonate in the dialysate based at least in part on the determined amount of CO2 measured in the gas and the determined pH level of the dialysate.