How molar mass is calculated
Molar mass is the sum of the atomic masses of all atoms in a formula, weighted by how many of each there are. Each element's symbol is followed by a subscript giving its count — a bare symbol means one atom:
M(Ca(OH)₂) = 40.078 + 2 × (15.999 + 1.008) ≈ 74.092 g/mol
Parentheses group a piece of the formula so a subscript applies to everything inside: Ca(OH)₂ is one calcium, two oxygens and two hydrogens. Hydrates are written with a middle dot — CuSO₄·5H₂O is copper sulfate plus five waters of crystallization, and all of it counts toward the molar mass (249.68 g/mol), because those water molecules are part of what you weigh out of the bottle.
Worked example
Glucose, C₆H₁₂O₆: 6 × 12.011 + 12 × 1.008 + 6 × 15.999 = 72.066 + 12.096 + 95.994 ≈ 180.156 g/mol. That single number is the workhorse of the lab: to make 0.0500 mol you weigh 0.0500 × 180.156 = 9.008 g, and to make 10.0 g you dissolve 10.0 ÷ 180.156 = 0.0555 mol. Sodium chloride (NaCl) is 58.44 g/mol, sulfuric acid (H₂SO₄) is 98.08 g/mol — check them the same way and the calculator shows you the running total element by element.
Molar mass, moles and mass — the one conversion you need
The triangle has three sides: mass (g), moles (n) and molar mass (M, g/mol), with n = m ÷ M and m = n × M. Every stoichiometry problem is a trip around this triangle. Multiply the mole count by Avogadro's number, 6.022 × 10²³, and you get the actual number of molecules — 1 mol of anything, from a grain of sand to a planet, contains the same 6.022 × 10²³ particles, which is one of the more useful facts in all of chemistry.