The resin can be recharged by washing it with a solution containing a high concentration of sodium ions (e.g. it has large amounts of common salt (NaCl) dissolved in it). The calcium and magnesium ions migrate from the resin, being replaced by sodium ions from the solution until a new equilibrium is reached. The salt is used to recharge an ion-exchange resin, which itself is used to soften the water.