Science & Engineering

Molar Mass Calculator (Chemical Formula)

Compute molar mass from any chemical formula, including nested parentheses like Ca(OH)2. It returns the total g/mol and the mass percent of each element.

Reviewed and updated

How to use
  1. Type a chemical formula, using parentheses where needed.
  2. Check the percent-by-mass breakdown for each element.
For study and estimation. Verify against authoritative data before relying on a result.
Was this helpful?

Add up the atoms, weighted by how many there are

M =(atomic weight × subscript)  [g/mol]

Molar mass is the mass of one mole of a substance. To get it, take each element in the formula, multiply its atomic weight by its subscript, and total the results. The subscripts are the whole point — treating H₂O as one H plus one O is the most common mistake.

Worked example — glucose (C₆H₁₂O₆)

ElementAtomic weightCountSubtotal
Carbon (C)12.011672.07
Hydrogen (H)1.0081212.10
Oxygen (O)15.999695.99
Total180.16 g/mol

Keep full precision on the atomic weights and round only the final answer; rounding early can shift the result by a few tenths.

Molar masses of common compounds

CompoundFormulaMolar mass (g/mol)
WaterH₂O18.02
Table saltNaCl58.44
Carbon dioxideCO₂44.01
EthanolC₂H₆O46.07
GlucoseC₆H₁₂O₆180.16
Sulfuric acidH₂SO₄98.08
CaffeineC₈H₁₀N₄O₂194.19

What molar mass lets you do

  • Grams to moles. n = m ÷ M. Divide a weighed mass by the molar mass to get moles.
  • Moles to grams. m = n × M. To weigh out 2.5 mol of glucose: 2.5 × 180.16 = 450.4 g.
  • Parentheses. Distribute the outside subscript first: Ca(OH)₂ has 2 O and 2 H, giving 74.09 g/mol.

Common questions

How do you calculate the molar mass of a compound?

Multiply each element's atomic weight by how many of that atom the formula contains, then add the pieces up. For water, H2O: 2 times 1.008 plus 15.999 equals 18.02 g/mol.

Is molar mass the same as molecular weight?

Numerically yes, but the units differ. Molecular weight is the mass of one molecule in atomic mass units; molar mass is the mass of one mole (6.022 x 10^23 molecules) in grams per mole. The figures match, so most people use them interchangeably.

Do I include the water in a hydrate like CuSO4 5H2O?

Yes. The waters of crystallisation are part of the formula. CuSO4 is 159.6 g/mol, but CuSO4 5H2O is 249.7 g/mol, and using the wrong one throws off every weighing.

From the blog

Guides & how-tos

All articles →