The invention relates to devices, systems, and methods for calculating a bicarbonate concentration in a fluid used in dialysis. The devices, systems, and methods can be used to calculate the bicarbonate concentration in either dialysate or blood. The invention measures the amount of carbon dioxide in both an acidified and non-acidified solution and calculates the bicarbonate concentration based on the difference in carbon dioxide concentrations.