Molar mass (molecular weight) is the mass of one mole of a compound, found by adding the standard atomic weights of every atom in its formula. This calculator parses a formula — including parentheses and nested groups — and returns the molar mass in g/mol with a per-element breakdown.
Reviewed: June 20, 2026 · Author: Naveen P N, Founder — AI Calculator · Verified against: IUPAC standard atomic weights, recomputed in code.
How it's summed
Each element symbol contributes its atomic weight times how many of that atom appear. Subscripts multiply the element just before them; a number after a closing parenthesis multiplies everything inside the group. Symbols are case-sensitive — Co is cobalt, but CO is carbon plus oxygen. Once you have the molar mass, moles = mass ÷ molar mass converts grams to moles in stoichiometry.
Worked examples
Water, H₂O:
Glucose, C₆H₁₂O₆:
Calcium hydroxide, Ca(OH)₂:
Parentheses make groups easy: in Al₂(SO₄)₃ the (SO₄) is taken three times, giving 342.132 g/mol. Knowing the molar mass, 36 g of water is about 2.0 moles, since 36 ÷ 18.015 ≈ 2.
Frequently Asked Questions
Sum atomic weights of all atoms. H2O = 2×1.008 + 15.999 = 18.015 g/mol.
180.156 g/mol.
Parentheses + subscript, like Ca(OH)2 or Al2(SO4)3. Nested groups work too.
Same number; molar mass has units g/mol, molecular weight is relative (dimensionless).
moles = grams ÷ molar mass. 36 g water ÷ 18.015 ≈ 2 mol.