The most abundant isotope of magnesium has 12 neutrons; it is therefore, technically known as magnesium-24. Calculating the number of neutrons in an isotope of any element involves subtracting that element's atomic number from its atomic weight. Magnesium's number is 12, and its weight is just over 24.
Magnesium has three stable isotopes: Mg-24, Mg-25 and Mg-26. Of these, Mg-24 is the most common, and represents over 78 percent of all naturally occurring magnesium. Mg-25 has one neutron more than Mg-24 and Mg-26 has two more. Unstable isotopes of magnesium range from seven to 28 neutrons, but these have half-lives measured from minutes to picoseconds.