Sodium chloride in water dissociates as NaCl⇌Na++Cl− H2O⇌H++OH−
When electric current is passed through this solution using platinum electrodes, Na+and H+ move towards cathode whereas Cl−and OH−ions move towards anode.
At cathode H++e−⟶H H+H⟶H2
At anode Cl−⟶Cl+e− Cl+Cl⟶Cl2
If mercury is used as cathode H+ions are not discharged at mercury cathode because mercury has a high hydrogen over voltage. Na+ions are discharged at cathode in preference of H+ions yielding sodium, which dissolves in mercury to form sodium amalgam.