Maths

Molecular Weight Calculator

Find the molar mass of any formula, with brackets, hydrates and each element’s share.

By Nitin Raturi · Last reviewed

Your compound

How to use the Molecular Weight Calculator

Find the molar mass of a compound from its formula.

  1. Type the formula, using capital letters for each element.
  2. Read the molar mass in g/mol.
  3. Check each element’s count, mass and share of the total.

Good to know

  • Atomic weights are the 2024 IUPAC abridged values.
  • Molar mass in g/mol equals molecular mass in daltons.

Chemical formula

The formula of the compound, with element symbols and the number of each atom.

How to fill it in

  • Start each symbol with a capital: Co is cobalt, CO is carbon monoxide.
  • Use brackets for groups, Ca(OH)2, and a dot for hydrates, CuSO4·5H2O.

Example

Water, H2O, is 18.015 g/mol; sucrose, C12H22O11, is 342.297 g/mol.

Tip: Acetic acid, CH3COOH, is 60.052 g/mol; copper sulfate pentahydrate is 249.677 g/mol.

Molar mass of C12H22O11

342.297 g/mol

One mole of C12H22O11 weighs 342.297 g/mol, from 45 atoms per formula unit.

C × 12
144.132 g/mol (42.11%)
H × 22
22.176 g/mol (6.48%)
O × 11
175.989 g/mol (51.41%)

IUPAC 2024 abridged standard atomic weights. Real samples vary slightly with isotope mix.

How this calculator works

  1. Step 1Count atomsC12H22O11Read each element and how many there are.
  2. Step 2Weigh each× atomic weightMultiply by the IUPAC standard atomic weight.
  3. Step 3Add upg/molThe total is the mass of one mole.

The molar mass is the mass of one mole of a compound. Add up the atomic weights of every atom in its formula.

Worked example: table sugar

Sucrose, C12H22O11
Molar mass
Σ count × atomic weight
  1. C × 12144.132 g/mol
  2. H × 2222.176 g/mol
  3. O × 11175.989 g/mol
  4. Total342.297 g/mol

Oxygen and carbon make up most of the mass; the 22 hydrogen atoms add only about 6%.

Brackets and hydrates

  • Water, H2O18.015 g/mol2 × 1.008 + 15.999.
  • CuSO4·5H2O249.677 g/molBlue copper sulfate: five water molecules are counted too.

The OpenStax textbook uses 60.052 g/mol for acetic acid, the same as this table gives.

Assumptions and limits

  • IUPAC 2024Abridged standard atomic weights.
  • BracketsNested () and [] groups are read.
  • Unstable elementsNo standard weight, so they are refused.
  • Natural isotopesEnriched samples weigh differently.

Molar mass converts grams to moles, the first step in most solution and gas sums.

To make up a solution of known strength, use the molarity calculator. For gas volumes and pressures, try the ideal gas law calculator.

Common mistakes

  • Mistake: Typing co for cobalt.

    Instead: Write Co; CO is carbon monoxide.

  • Mistake: Leaving out water of crystallisation.

    Instead: Add ·5H2O for hydrates.

  • Mistake: Multiplying only the first atom in a group.

    Instead: Ca(OH)2 has two O and two H.

Checking the method

A separate script re-parses every formula with its own parser and sums exact decimals.

Read how we test our calculators, or browse more maths calculators.

Frequently asked questions

What is the molar mass of water?

18.015 g/mol: two hydrogens at 1.008 and one oxygen at 15.999.

What is the molar mass of sugar (sucrose)?

C12H22O11 is 342.297 g/mol.

How do I enter a hydrate?

Use a dot: CuSO4·5H2O is 249.677 g/mol. A full stop or * also works.

What is the molar mass of acetic acid?

CH3COOH is 60.052 g/mol.

Which atomic weights are used?

The IUPAC 2024 abridged standard atomic weights.

Sources and methodology

The formulas are standard time-value-of-money results. We check every figure against golden values worked out independently, by closed form and by month-by-month simulation; see the methodology.

Written and maintained by Nitin Raturi, a software engineer (about the author). Last reviewed 4 Nov 2026; next review due by . Found an error? Tell us.

Changelog

  • : Initial release.