How molecular weight is calculated
The molecular weight (or molar mass) of a compound is the sum of the atomic masses of all atoms in one molecule. Each element's standard atomic weight is taken from the IUPAC periodic table, and multiplied by the number of times it appears in the formula.
For example, water (H2O) has two hydrogen atoms at 1.008 each and one oxygen at 15.999, giving a molecular weight of 18.015 g/mol. Parentheses in formulas like Ca(OH)2 indicate groups: the OH group appears twice, contributing 2 oxygen and 2 hydrogen atoms.
M = Σ (nᵢ × Aᵢ)
Sum of each element's count times its atomic weight.