Mg is a chemical symbol of magnesium. Magnesium is an alkaline earth metal from the second group of periodic systems. Since it is a metal, in an elementary state it does not form an elementary molecule. H2O is a chemical formula for a molecule of water. NaCl is a chemical formula for a molecule of sodium chloride also known as salt. CO is a chemical formula for a molecule of carbon monoxide.