While other minerals like iron, manganese, and barium can also contribute to hardness, calcium and magnesium are the primary culprits.