Can eletrolysis be used to separate salt in the sea int o elemental sodium and clorine gas -- somthing like 2NaCl --> 2Na + Cl2 ?

It is my understanding that you have to get the water out first, and do the electrolysis in pure molten salt. Otherwise, the products are H2 and O2 gas.

Yes, electrolysis can indeed be used to separate salt (sodium chloride) into elemental sodium and chlorine gas. The process of electrolysis involves using an electric current to induce a chemical reaction. In this case, when a direct electric current is passed through a solution of sodium chloride (in water), the sodium chloride dissociates into sodium ions (Na⁺) and chloride ions (Cl⁻).

To set up the electrolysis experiment, you'll need the following:

1. A container filled with a solution of sodium chloride (saltwater).
2. Two electrodes (usually made of inert materials like graphite or platinum), which are connected to a power source.
3. An external power source, such as a battery or a power supply.

Here's how the electrolysis process would work to separate the salt into sodium and chlorine:

1. Connect the positive terminal of the power source to the anode (the electrode where oxidation occurs) and the negative terminal to the cathode (the electrode where reduction occurs). The anode should be placed in the sodium chloride solution.
2. As the electric current passes through the solution, the chloride ions (Cl⁻) will migrate toward the anode (positive terminal).
3. At the anode, chloride ions will lose electrons and undergo oxidation. Each chloride ion will give up one electron, resulting in the formation of chlorine gas (Cl₂): 2Cl⁻ → Cl₂ + 2e⁻.
4. Meanwhile, the sodium ions (Na⁺) will migrate toward the cathode (negative terminal).
5. At the cathode, sodium ions will gain electrons and undergo reduction. Each sodium ion will accept one electron, leading to the formation of sodium metal (Na): Na⁺ + e⁻ → Na.
6. The sodium metal (Na) formed at the cathode is highly reactive and will generally react with water from the solution to produce sodium hydroxide (NaOH) and hydrogen gas (H₂): 2Na + 2H₂O → 2NaOH + H₂.

So, while electrolysis can be used to separate sodium chloride into elemental sodium and chlorine gas, the actual result would involve the production of sodium hydroxide as well. The chlorine gas would be collected at the anode, and sodium metal (which reacts with water) would be formed at the cathode.