Magnesium ( /mæɡˈniːziəm/ mag-NEE-zee-əm) is a chemical element with the symbol Mg, atomic number 12 and common oxidation state +2. It is an alkaline earth metal and the eighth most abundant element in the Earth's crust, where it constitutes about 2% by mass, and ninth in the known universe as a whole.[2] This preponderance of magnesium is related to the fact that it is easily built up in supernova stars from a sequential addition of three heliumnuclei to carbon (which in turn is made from three helium nuclei). Magnesium ion's high solubility in water helps ensure that it is the third most abundant element dissolved in seawater.[3]

Magnesium is the 11th most abundant element by mass in the human body. Its ions are essential to all living cells. The ions play a major role in manipulating important biological polyphosphate compounds like ATP, DNA, and RNA. Hundreds of enzymes thus require magnesium ions to function. Magnesium is also the metallic ion at the center of chlorophyll, and is thus a common additive to fertilizers.[4] Magnesium ions are sour to the taste, and in low concentrations help to impart a natural tartness to fresh mineral waters.

The free element (metal) is not found naturally on Earth, as it is highly reactive (though once produced, is coated in a thin layer of oxide (see passivation), which partly masks this reactivity). The free metal burns with a characteristic brilliant white light, making it a useful ingredient in flares. The metal is now mainly obtained by electrolysis of magnesium salts obtained from brine.

Commercially, the chief use for the metal is as an alloying agent to make aluminium-magnesium alloys, sometimes called "magnalium" or "magnelium". Since magnesium is less dense than aluminium, these alloys are prized for their relative lightness and strength.

Magnesium is used in fireworks to make a brilliant white light. Another use is to mix it with other metals to make it strong, lightweight alloys such as those used to make bicycle frames.

Magnesium compounds are used medicinally as common laxatives, antacids (i.e., milk of magnesia), and in a number of situations where stabilization of abnormal nerve excitation and blood vessel spasm is required (that is, to treat eclampsia).

Magnesium is used in electronic devices, including: mobile phones, laptop computers, cameras, and other electronic components. Magnesium's low weight, good mechanical and electrical properties are good for these uses.