How to calculate molar mass: worked examples from H2O to Al2(SO4)3

Updated 2026-10-20 ยท FreeToolHub

Molar mass is the mass of one mole of a substance, in grams per mole (g/mol). To get it, you add up the atomic masses of every atom in the formula. That is the whole method. The only places people slip are brackets and counting atoms.

The three steps

  1. List every element in the formula and count its atoms.
  2. Multiply each element's atomic mass by its count.
  3. Add the results.

Example 1: water, H2O

2 H = 2 × 1.008 = 2.016. 1 O = 15.999. Total: 18.015 g/mol.

Example 2: table salt, NaCl

Na 22.990 + Cl 35.453 = 58.443 g/mol.

Example 3: glucose, C6H12O6

6 C = 72.066, 12 H = 12.096, 6 O = 95.994. Total: 180.156 g/mol.

Example 4: brackets, Ca(OH)2

The 2 outside the bracket multiplies everything inside it. So there is 1 Ca, 2 O and 2 H. Ca 40.078 + O 2 × 15.999 + H 2 × 1.008 = 74.092 g/mol.

Example 5: Al2(SO4)3

Count first: Al = 2. Inside the bracket there is 1 S and 4 O, and the 3 outside multiplies both, so S = 3 and O = 12. Then: Al 2 × 26.982 = 53.964, S 3 × 32.065 = 96.195, O 12 × 15.999 = 191.988. Total: 342.147 g/mol.

Why your answer may differ in the last digit. Textbooks and tables round atomic masses differently. Our calculator uses S = 32.065 and Cl = 35.453, for example, while some tables give 32.06 and 35.45. If your teacher or exam uses a specific table, follow that one.

Mass percent of each element

Divide an element's total mass by the molar mass. In water, oxygen is 15.999 / 18.015 = 88.8%, and hydrogen is 11.2%. In glucose, carbon is 40.0%, hydrogen 6.7% and oxygen 53.3%.

Grams to moles and back

Moles = mass in grams / molar mass.

Check your answers

Type any formula into the Molecular Weight Calculator to see the molar mass and the mass percent of each element, with nested brackets supported. To look up an atomic mass, use the Interactive Periodic Table. Working on a reaction? Balance it first with the Chemical Equation Balancer.

See also: how to balance chemical equations.