Magnesium is a chemical element with the symbol Mg and atomic number 12. It is a shiny gray solid and is an essential mineral for human health. Magnesium is involved in more than 300 biochemical reactions in the body, including energy production, muscle function, and regulation of the nervous system.