Halogens react with other non-metals to form covalent compounds. For example, hydrogen reacts with chlorine to form hydrochloric acid (HCl).
In this reaction, the hydrogen atom shares electrons with the chlorine atom, forming a covalent bond between them. Hydrogen requires only one electron to complete its outer shell, while chlorine requires one electron as well. By sharing electrons, both atoms can complete their outer shells and form a stable compound.
Halogens react with metals to form ionic compounds, known as metal halide salts. For example, sodium reacts with chlorine to form sodium chloride (NaCl), otherwise known as table salt.
As a result, the sodium atom loses its outer electron to chlorine, resulting in both atoms having a complete outer shell.
However, this transfer of electrons results in sodium now having 11 protons and 10 electrons. Because protons have a positive charge and electrons have a negative charge, sodium becomes a positive ion (Na+) with a +1 charge. Meanwhile, chlorine now has 17 protons and 18 electrons and becomes a negative ion (Cl–) with a -1 charge.
So, when reacting with metals, halogens gain an electron to complete their outer shell and form a negative ion, while metals lose an electron to become a positive ion. The positive and negative ions then attract each other and form an ionic bond, resulting in the formation of an ionic compound.
Halogen ions are called halides, and they form when halogens react with metals. The table below shows the halides that form from different halogens.