Molar Mass Calculator

Calculate the molar mass of a compound from its chemical formula, including parentheses and hydrates, with a breakdown by element.

Enter a formula and select Calculate to see your result.

This calculator works out the molar mass of a compound from its chemical formula and shows how much each element contributes. It reads parentheses, brackets and hydrates, so formulas like Ca(OH)2 and CuSO4·5H2O work as you would write them.

How it’s calculated

Molar mass is the mass of one mole of a substance. To find it, multiply the number of atoms of each element by that element’s atomic weight, then add the results:

Molar mass = Σ (atoms of element × atomic weight of element)

Atomic weights come from the abridged table published by the IUPAC Commission on Isotopic Abundances and Atomic Weights. A number after a bracket multiplies everything inside it.

Worked example

Water, H2O, has two hydrogen atoms and one oxygen atom:

  1. Hydrogen: 2 × 1.008 = 2.016.
  2. Oxygen: 1 × 15.999 = 15.999.
  3. Add them: 2.016 + 15.999 = 18.015.

The molar mass of H2O is 18.015 g/mol.

Formulas with brackets and hydrates

In calcium hydroxide, Ca(OH)2, the 2 applies to both atoms in the bracket. That makes one calcium, two oxygen and two hydrogen atoms: 40.078 + (2 × 15.999) + (2 × 1.008) = 74.092 g/mol.

In copper(II) sulfate pentahydrate, CuSO4·5H2O, the 5 applies to the whole water molecule. That adds 10 hydrogen atoms and 5 oxygen atoms to the copper sulfate, for a total of 249.677 g/mol.

Molar mass of common compounds

CompoundFormulaMolar mass (g/mol)
AmmoniaNH317.031
WaterH2O18.015
Carbon dioxideCO244.009
Sodium chlorideNaCl58.440
Sulfuric acidH2SO498.072
Calcium carbonateCaCO3100.086
GlucoseC6H12O6180.156

Calculated from the IUPAC abridged atomic weights. Our tests check these values against the calculator.

Common questions

Why does capitalization matter?

Because it changes the element. CO is carbon monoxide, made of carbon and oxygen, while Co is the metal cobalt. The calculator reads a capital letter as the start of a new element, so it never has to guess. That's why it asks you to fix h2o rather than assuming you meant H2O.

How do I enter a hydrate?

Put a dot between the compound and the water, and a number in front of the water, as in CuSO4·5H2O. If you can't type the middle dot, a full stop or an asterisk also works, so CuSO4.5H2O and CuSO4*5H2O give the same result.

Why can't I calculate technetium or plutonium?

These elements have no stable isotopes with a characteristic natural composition, so IUPAC doesn't give them a standard atomic weight. Their mass depends on which isotope you have. We don't fill those gaps with a value from elsewhere, because the result would look more certain than it is.

Why is my answer slightly different from my textbook?

Different sources round atomic weights differently. Chemistry textbooks often use values such as 12.01 for carbon, where this calculator uses 12.011 from the IUPAC table. Small differences in the second or third decimal place usually come from this. Follow your course's values for graded work.

What's the difference between molar mass and molecular weight?

They have the same number but different units. Molar mass is the mass of one mole of a substance, in grams per mole. Molecular or formula weight describes one formula unit, in atomic mass units. For water, that's 18.015 g/mol and 18.015 amu.

Can I use this for a specific isotope?

No. Standard atomic weights reflect the mix of isotopes found in normal materials. A compound made with a specific isotope, like heavy water, has a different molar mass that this calculator won't show.

Sources

The calculator adds up the abridged standard atomic weights in the 2024 table from the IUPAC Commission on Isotopic Abundances and Atomic Weights. Results are shown to three decimal places, though several atomic weights in that table are only known to two. Read our methodology

Last updated: