The molar mass of a compound is the sum of the standard atomic weights of all its atoms:
M=i∑niAi
where ni is the number of atoms of element i and Ai is its atomic weight in g/mol. The mass percent of an element is 100×niAi/M.
Worked example
Find the molar mass of calcium hydroxide, Ca(OH)2.
One calcium: 40.078.
Two oxygens: 2×15.999=31.998.
Two hydrogens: 2×1.008=2.016.
Total: 40.078+31.998+2.016=74.092 g/mol.
Calcium is 40.078/74.092=54.09% of the mass.
Common mistakes
Writing symbols in the wrong case, such as CL for chlorine or co for cobalt.
Forgetting that a subscript outside brackets multiplies everything inside: the 2 in Ca(OH)2 doubles both O and H.
Dropping the water of crystallisation. CuSO4 and CuSO4·5H2O have very different molar masses.
Using rounded atomic weights from memory. For exam work, follow the table your course provides.
Frequently asked questions
What is the difference between molar mass and molecular weight?
Molar mass is the mass of one mole of a substance in grams per mole, and molecular weight (or formula mass) is the same number as a mass ratio in atomic mass units. They have the same numerical value, for example 18.015 for water, so the terms are used almost interchangeably in the lab.
Does the calculator handle brackets and hydrates?
Yes. Write nested brackets such as K4[Fe(CN)6] or Ca3(PO4)2, and hydrates with a dot, an asterisk or the middle dot, for example CuSO4·5H2O. A number in front of a part multiplies it, so 5H2O means five waters.
Why are element symbols case-sensitive?
Because Co is cobalt but CO is carbon monoxide, and Cs is caesium but CS is carbon and sulfur. Start every element with a capital letter and use a lower-case second letter only where the symbol has one.