Skip to content

How to Calculate Molar Mass

Molar mass is the mass of one mole of a substance, in grams per mole, and you calculate it by adding up the atomic masses of every atom in the formula. It is the bridge between the mass you can weigh and the number of molecules a reaction actually counts, which is why almost every concentration calculation depends on it. This guide gives the method, works through the compounds people look up most — water, carbon dioxide, sodium chloride, sodium hydroxide and glucose — handles hydrates and parentheses, and shows how to convert between grams and moles. The molar mass calculator does the arithmetic for any formula and reports percent composition too.

What is molar mass?

Molar mass (M) is the mass in grams of one mole (6.022 × 10²³ particles) of a substance. Its unit is g/mol. For an element it is the atomic weight from the periodic table; for a compound it is the sum of the atomic weights of all its atoms. “Molecular weight” and “formula weight” are used interchangeably with molar mass at the bench, all in g/mol.

The number is the same as the average atomic or molecular mass in atomic mass units (u or Da) — a water molecule weighs about 18.02 u, and one mole of water weighs about 18.02 g. That one-to-one link between u and g/mol is what makes the conversion work.

The molar mass formula

Multiply each element’s atomic mass by the number of atoms of it in the formula, then sum:

M = Σ (atomic mass of element × number of atoms)

The number of atoms comes from the subscript after each element symbol. If there is no subscript, there is one atom. A subscript outside parentheses multiplies everything inside.

How do I calculate molar mass step by step?

  1. Write the formula and list every distinct element in it.
  2. Count the atoms of each element, expanding parentheses and hydrate dots.
  3. Look up the atomic mass of each element (periodic table or NIST).
  4. Multiply each atomic mass by its atom count.
  5. Add the results to get g/mol.

Worked example: water (H2O)

Water has 2 hydrogen and 1 oxygen. Using atomic masses H = 1.008 and O = 15.999:

  • H: 2 × 1.008 = 2.016
  • O: 1 × 15.999 = 15.999
  • M = 2.016 + 15.999 = 18.015 g/mol

So one mole of water weighs 18.015 g.

Worked example: carbon dioxide (CO2)

CO2 has 1 carbon and 2 oxygen. C = 12.011, O = 15.999:

  • C: 1 × 12.011 = 12.011
  • O: 2 × 15.999 = 31.998
  • M = 12.011 + 31.998 = 44.009 g/mol

Worked example: sodium chloride (NaCl)

NaCl has 1 sodium and 1 chlorine. Na = 22.990, Cl = 35.45:

  • Na: 1 × 22.990 = 22.990
  • Cl: 1 × 35.45 = 35.45
  • M = 22.990 + 35.45 = 58.44 g/mol

This is the value behind every “58.44 g of NaCl per litre for 1 M” recipe.

Worked example: sodium hydroxide (NaOH)

NaOH has 1 Na, 1 O and 1 H. Na = 22.990, O = 15.999, H = 1.008:

  • Na: 1 × 22.990 = 22.990
  • O: 1 × 15.999 = 15.999
  • H: 1 × 1.008 = 1.008
  • M = 22.990 + 15.999 + 1.008 = 39.997 g/mol (≈ 40.00)

Worked example: glucose (C6H12O6)

Glucose has 6 C, 12 H and 6 O. C = 12.011, H = 1.008, O = 15.999:

  • C: 6 × 12.011 = 72.066
  • H: 12 × 1.008 = 12.096
  • O: 6 × 15.999 = 95.994
  • M = 72.066 + 12.096 + 95.994 = 180.156 g/mol (≈ 180.16)

How do I handle hydrates and parentheses?

A hydrate dot (·) adds whole water molecules to the formula. Copper(II) sulfate pentahydrate, CuSO4·5H2O, is CuSO4 plus five H2O:

  • CuSO4: 63.546 + 32.06 + (4 × 15.999) = 159.60 g/mol
  • 5 × H2O: 5 × 18.015 = 90.08 g/mol
  • M = 159.60 + 90.08 = 249.68 g/mol

The anhydrous (159.60) and pentahydrate (249.68) forms differ by more than a third, so weighing the wrong one throws off every downstream concentration. For parentheses, multiply the subscript outside through everything inside: Ca(OH)2 is 1 Ca + 2 O + 2 H, and Mg(NO3)2 is 1 Mg + 2 N + 6 O.

How do I convert between grams and moles?

Molar mass is the conversion factor between mass and amount of substance:

  • moles = mass (g) ÷ molar mass (g/mol)
  • mass (g) = moles × molar mass (g/mol)

For 5 g of glucose: n = 5 / 180.16 = 0.02775 mol. For 0.25 mol of NaCl: m = 0.25 × 58.44 = 14.61 g. This is the first step inside how to calculate molarity — you cannot get from a weighed mass to a concentration without it.

How do I find percent composition?

Divide each element’s total mass by the molar mass and multiply by 100. For water (18.015 g/mol):

  • Oxygen: 15.999 / 18.015 × 100 = 88.81%
  • Hydrogen: 2.016 / 18.015 × 100 = 11.19%

Percent composition checks that a formula matches an expected elemental analysis and tells you how much of a given element a compound delivers — for example how much chloride is really in a salt. The molar mass calculator reports it for every element automatically.

Common mistakes

  • Missing a subscript. Reading H2O as HO, or dropping the 6 in C6H12O6.
  • Not multiplying through parentheses. Ca(OH)2 is not Ca + O + H.
  • Using the wrong form. Anhydrous vs hydrate differ substantially.
  • Rounding atomic masses too early. Carry an extra digit and round at the end.
  • Confusing g/mol with kg/mol. A factor-of-1000 error if you slip.

If your computed molar mass disagrees with a label value, re-count the atoms before doubting the atomic weights — most mismatches are a subscript or a forgotten water.

Where does this fit in the wider workflow?

Molar mass feeds directly into concentration work. Combined with mass and volume it gives molarity, M = m / (MW × V), explained in what is molarity, and it is the MW the molarity calculator and stock solution calculator both ask for. These tools live together in the laboratory calculators collection.

Scientific Sources

External links open in a new tab and carry rel="nofollow". We cite primary references (NIST, NIH/NCBI, peer-reviewed papers) and established manufacturer technical documentation (NEB, Thermo Fisher, Promega, IDT). Calculated results are estimates; your protocol and manufacturer guidance take precedence.