Average molecular weight
The average molecular weight of a compound is the sum of the conventional atomic weights of its atoms. For glucose, C₆H₁₂O₆, that is 6 × 12.011 + 12 × 1.008 + 6 × 15.999 = 180.156 g/mol. This is the value to use when you weigh a solid on a balance, because it reflects the natural isotopic abundance of each element.
The calculation needs the formula as the bottle actually is. Copper sulfate pentahydrate is CuSO₄·5H₂O, 249.68 g/mol, not the anhydrous 159.61 g/mol; write the water of crystallisation explicitly. The same applies to salts supplied as a hydrate or a hydrochloride, where the counter-ion adds mass that the formula must include.
Monoisotopic mass
A mass spectrometer separates individual molecules by mass, so it reports the monoisotopic mass: the sum of the most abundant isotope of each element, with ¹²C defined as exactly 12. For glucose that is 180.06339 Da, about 0.09 Da below the average mass. The difference grows with the number of atoms, which is why average mass is useless for assigning a high-resolution peak of a large molecule.
This calculator tabulates monoisotopic masses only for the elements where the brief supplies them. If a formula contains an element without that value, the column shows n/a rather than a partial sum that would look like a real mass.
Percent composition and the converter
Percent by mass is each element’s contribution divided by the total, times 100. For Mg(OH)₂ the magnesium fraction is 24.305 ÷ 58.319 = 41.68 %, which is what a specification means when it says the product is at least 41 % magnesium. It is also the fastest check that a formula and a molecular weight belong together.
The converter uses the same molecular weight: mass in grams = millimoles × molecular weight ÷ 1000, and millimoles = milligrams ÷ molecular weight. It does not correct for purity, water content or a counter-ion that is not in the formula, so a 95 % pure solid needs the purity applied separately.