During electrolysis, a direct electric current is passed through the brine solution, causing the positively charged sodium ions (Na+) to migrate towards the cathode (negative electrode) and the negatively charged chloride ions (Cl-) to migrate towards the anode (positive electrode).
At the cathode, the sodium ions gain electrons and become neutral sodium atoms, which then react with water molecules to form hydrogen gas (H2) and sodium hydroxide (NaOH).
At the anode, the chloride ions lose electrons and become chlorine gas (Cl2). The chlorine gas bubbles up and can be collected.
The overall reaction for the electrolysis of brine is:
NaCl(aq) + H2O(l) → Cl2(g) + H2(g) + NaOH(aq)