Magnesium chloride (MgCl2) is an ionic compound. This classification arises from the nature of the bonding between its constituent elements; magnesium (Mg) and chlorine (Cl).
Magnesium is a metal that tends to lose two electrons to achieve a stable electron configuration, similar to that of a noble gas. When it reacts with chlorine, which is a non-metal that typically gains an electron to fill its outer shell, magnesium donates its two electrons to two chlorine atoms. This transfer of electrons creates positively charged magnesium ions (Mg2+) and negatively charged chloride ions (Cl–).
The electrostatic attraction between these oppositely charged ions results in ionic bonds, which are characteristic of ionic compounds. In addition, magnesium chloride exhibits properties typically associated with ionic compounds, such as high melting and boiling points, as well as the ability to conduct electricity when dissolved in water.