Skip to content
LoveToCalc

Molar mass calculator

Type a chemical formula and see its molar mass, with each element's share of it, and turn grams into moles.

Start every symbol with a capital letter: Co is cobalt, CO is carbon monoxide. Brackets, a hydrate dot (CuSO4·5H2O, or * or .) and a charge (SO4^2-) are understood.

Try:
Grams and moles

Optional. Type a mass to get the amount in moles, or an amount to get the mass.

Molar mass

M(H₂O) = 18.015 g/mol

Given to 3 decimals: a sum is no more precise than the least precise atomic weight in it.

Molar mass of H₂O, element by element
ElementAtomsAtomic mass (g/mol)Mass (g/mol)Mass %
H Hydrogen21.00802.016011.2
O Oxygen115.99915.99988.8
Total18.015100.0

The molar mass of a substance is the sum of the atomic masses of the atoms in its formula: water, H₂O, is 2 · 1.008 + 15.999 = 18.015 g/mol. The calculator reads the formula, counts the atoms through brackets and hydrate dots, and adds up the standard atomic weights from IUPAC’s Commission on Isotopic Abundances and Atomic Weights, the same values as on the periodic table. With a mass in grams it also gives the amount of substance, n = m / M.

Last reviewed October 19, 2026 ·How pages are reviewed

The formula behind this

All math calculators

Put this calculator on your site

Copy the code into your page where the calculator should appear. It loads from lovetocalc.com, so it stays current on its own — all we ask is that the credit line comes with it.