The sodium compound used for softening hard water is washing soda , which is chemically known as sodium carbonate. Its chemical formula is Na2CO3⋅10H2O\text{Na}_2\text{CO}_3\cdot 10\text{H}_2\text{O}Na2CO3⋅10H2O (hydrated sodium carbonate). Washing soda softens hard water by reacting with the calcium and magnesium ions present in the water to form insoluble carbonates, thus removing the hardness.