* Magnesium (Mg) is in group 2 of the periodic table, meaning it has 2 valence electrons. It loses these two electrons to become a cation with a +2 charge (Mg²⁺).
* Chlorine (Cl) is in group 17 of the periodic table, meaning it has 7 valence electrons. It gains one electron to become an anion with a -1 charge (Cl⁻).
In magnesium chloride, one magnesium ion (Mg²⁺) combines with two chloride ions (Cl⁻) to form the compound.
* The total positive charge from the magnesium ion is +2.
* The total negative charge from the two chloride ions is -2.
Since +2 and -2 cancel each other out, the overall charge of magnesium chloride (MgCl₂) is zero.