Magnesium oxide is a compound of magnesium and oxygen with chemical formula MgO. Each molecule of magnesium oxide has one atom of magnesium and one atom of oxygen. To identify the percentage composition of an element in a compound, begin by looking up the molar mass of that element.
In this case, the molar mass of magnesium is 24.305 g/mol.
Next, take that element's molar mass and divide it by the molar mass of the entire compound, which in this case is 40.31 g/mol. We multiply that number by 100 to express it as a percentage.
Thus, the mass of magnesium as a percent of the total mass of the compound is 24.305 / 40.31 x 100 = 60.295%. Note that the g/mol units cancel themselves out.
In magnesium oxide, magnesium makes up 60.295% of the compound's mass.