Molar mass calculator

Type a chemical formula to get its molar mass in g/mol, with the working shown, each element's share, and a grams-to-moles converter.

Brackets and hydrates work: Ca(OH)2, CuSO4·5H2O (or CuSO4.5H2O).

Molar mass of H2O

18.015 g/mol

Molar mass by element
ElementAtomsAtomic massMass (g/mol)Mass %
Hydrogen (H)21.0082.01611.19%
Oxygen (O)115.99915.99988.81%

2 × 1.008 + 1 × 15.999 = 18.015 g/mol

g

Type a mass to convert it.

What molar mass is

The molar mass of a substance is the mass of one mole of it, in grams per mole (g/mol). One mole is 6.022 × 10²³ particles, so the molar mass tells you how many grams you need to weigh out to get that many molecules or formula units.

It has the same number as the substance’s formula mass in atomic mass units: a water molecule has a mass of about 18.015 u, and a mole of water has a mass of about 18.015 g.

How to calculate molar mass

  1. Count the atoms of each element in the formula. A number after brackets multiplies everything inside them.
  2. Look up each element’s atomic mass on the periodic table.
  3. Multiply each atomic mass by its count, then add them up.

Example: glucose, C₆H₁₂O₆. It has 6 carbon, 12 hydrogen and 6 oxygen atoms:

6 × 12.011 + 12 × 1.008 + 6 × 15.999 = 180.156 g/mol

For a hydrate like CuSO₄·5H₂O, add the water too: the molar mass of CuSO₄ plus five times that of H₂O.

Molar masses of common compounds

CompoundFormulaMolar mass (g/mol)
WaterH2O18.015
Carbon dioxideCO244.009
Sodium chloride (table salt)NaCl58.440
GlucoseC6H12O6180.156
Sodium hydroxideNaOH39.997
Hydrochloric acidHCl36.458
Sulfuric acidH2SO498.072
AmmoniaNH317.031
Calcium carbonateCaCO3100.086
MethaneCH416.043
EthanolC2H5OH46.069
Copper(II) sulfate pentahydrateCuSO4·5H2O249.677

Questions

Why is my textbook's answer slightly different?
Books round atomic masses differently (O as 16 or 16.00, Cl as 35.5). This calculator uses the IUPAC standard atomic weights, so expect agreement to about one decimal place.
Is molar mass the same as molecular weight?
They're the same number. Molecular weight (or formula mass) is in atomic mass units per molecule; molar mass is in grams per mole.
How do I convert grams to moles?
Divide the mass in grams by the molar mass: moles = grams ÷ (g/mol). The converter under the result does it for you.
Can I type charges or states?
Yes. Charges (SO4^2-) and states like (aq) are ignored for the mass, since electrons weigh almost nothing.