Understanding molecular weight
Every chemical formula is a shopping list written in symbols. H2O says two hydrogen atoms and one oxygen atom; NaCl says one sodium and one chlorine; C6H12O6 says six carbons, twelve hydrogens and six oxygens. The molecular weight is what that list weighs when each atom is charged at its standard atomic mass: multiply each element's mass by how many of its atoms appear, then add the results together.
Formula and method
Molar mass of a formula: Atomic mass — the standard mass of one mole of that element's atoms, in grams per mole; hydrogen is 1.008, oxygen is 15.999, carbon is 12.011, nitrogen is 14.007, sodium is 22.990 and chlorine is 35.45. Atom count — how many atoms of that element the formula contains, after subscripts and brackets are expanded. Molar mass — the total, in grams per mole, numerically equal to the molecular weight. Why brackets multiply the whole group. A bracket with a subscript after it, such as the 2 in a group written with parentheses, applies to every atom inside the brackets, not just the last one. Counting the group once and then multiplying is the same as writing the group's atoms out in full — the total is identical either way, and missing that multiplication is the commonest error in hand calculations. Why standard masses are used. Atomic masses are averages over the naturally occurring isotopes of each element, agreed internationally and printed on the periodic table. Using those standard values keeps every chemist's answer the same; a mass measured for one particular isotope would give a different figure and would not match a textbook. Why the answer is in grams per mole. The molecular weight of water is 18.015, and its molar mass is 18.015 g/mol — the same number with a unit attached. That unit is what lets grams on a balance be divided into moles for the next calculation, which is the reason the figure is wanted in the first place.
Worked example
Example 1 — H2O (the live-page example) Water: two hydrogen atoms and one oxygen atom. Hydrogen: 2 × 1.008 = 2.016 Oxygen: 1 × 15.999 = 15.999 Total: 2.016 + 15.999 = 18.015 g/mol Result: 18.015 g/mol (molar mass) That formula is the stored example from the live page, and working it through gives the headline figure of 18.015 g/mol. Water is the compound most people meet first in this calculation, and its small total hides the method's power: the same adding works for a formula with six carbons and twelve hydrogens just as it works for two hydrogens and one oxygen.