My Easy Science

Guide

How to Calculate Molecular Mass: Step-by-Step Examples

The molecular mass of a compound is the mass of one molecule of it, worked out by adding up the mass of every atom in its formula. Once you know the three steps, count the atoms, multiply by the atomic weights, add them up, you can do any formula by hand and check it against the calculator.

A periodic table wall chart with a calculator and notebook on the desk below
The periodic table and a calculator, all you need for molecular mass.

The one rule

A molecule is a collection of atoms, so its mass is the sum of its parts. For each element in the formula, take the number of atoms of that element and multiply it by the atomic weight of that element, then add the results together.

Molecular mass = sum of (number of atoms x atomic weight), for every element in the formula

The answer is usually given in grams per mole (g/mol). That is the mass of one mole of the substance, and it is the same number as the relative molecular mass, which has no units. The difference between the terms is explained in the guide Molecular Weight vs Molar Mass vs Molecular Mass: What's the Difference?

Step 1: count the atoms

Read the formula from left to right. Each element symbol starts with a capital letter, and the small number after it, the subscript, tells you how many atoms of that element are present. A symbol with no number after it means one atom.

Water, H2O, has 2 hydrogen atoms and 1 oxygen atom. Glucose, C6H12O6, has 6 carbon atoms, 12 hydrogen atoms and 6 oxygen atoms. Table salt, NaCl, has 1 sodium atom and 1 chlorine atom. Note the second letter of a symbol is always lowercase: Na is sodium, while NA would be meaningless, and Cl is chlorine, not CI.

Brackets group atoms together, and the number after a closing bracket multiplies everything inside it. Calcium hydroxide, Ca(OH)2, has 1 calcium atom, 2 oxygen atoms and 2 hydrogen atoms, because the OH group appears twice. Brackets are covered in full in the guide How to Calculate Molecular Weight from a Chemical Formula: Brackets, Subscripts and Ions.

Step 2: look up the atomic weights

Atomic weights are the average masses of the atoms of each element, allowing for the natural mix of isotopes. The calculator uses the standard average values, and so does this guide. Here are the ones used in the examples below.

ElementSymbolAtomic weight (g/mol)
HydrogenH1.008
CarbonC12.011
NitrogenN14.007
OxygenO15.999
SodiumNa22.99
MagnesiumMg24.305
SulfurS32.06
ChlorineCl35.45
PotassiumK39.098
CalciumCa40.078

Step 3: multiply and add

Now work through each element in turn. Water is the shortest example.

H2O: 2 x 1.008 + 1 x 15.999 = 2.016 + 15.999 = 18.015 g/mol

Salt is the same idea with two heavier atoms.

NaCl: 1 x 22.99 + 1 x 35.45 = 22.99 + 35.45 = 58.440 g/mol

Glucose has three elements, so keep the running total in view.

C6H12O6: 6 x 12.011 + 12 x 1.008 + 6 x 15.999 = 72.066 + 12.096 + 95.994 = 180.156 g/mol

Here are more results, all checked against the Molecular Weight Calculator.

CompoundFormulaMolecular mass (g/mol)
AspirinC9H8O4180.159
Magnesium sulfateMgSO4120.361
Calcium carbonateCaCO3100.086
Sulfuric acidH2SO498.072
EthanolC2H5OH46.069
Acetic acidCH3COOH60.052

Brackets multiply everything inside

Calcium hydroxide is the classic bracket example. The subscript 2 after the closing bracket applies to both the oxygen and the hydrogen inside.

Ca(OH)2: 40.078 + 2 x (15.999 + 1.008) = 40.078 + 2 x 17.007 = 40.078 + 34.014 = 74.092 g/mol

The common slip is to multiply only the last atom in the bracket. If you counted the OH group once, you would get 57.085 g/mol, which is wrong by a whole water-free OH group. Whenever you see a bracket, work out the mass of the group first, then multiply by the number outside.

What the answer tells you: percent composition

Once the total is known, each element's share of the mass follows at once: divide that element's mass by the total and multiply by 100. For glucose:

Carbon: 72.066 / 180.156 = 40.00%. Hydrogen: 12.096 / 180.156 = 6.71%. Oxygen: 95.994 / 180.156 = 53.28%.

The calculator shows this breakdown in its results table, with a bar for each element. Percent composition is how you check a proposed formula against an analysis: if a sample is 40.00% carbon by mass, glucose fits, and a formula with a different carbon share does not.

From molecular mass to moles and molarity

The molecular mass is also the bridge to the lab bench. Moles equal mass divided by molecular mass, and molarity equals moles divided by volume in litres.

Take 0.5 g of salt dissolved and made up to 100 mL. The moles are 0.5 / 58.440 = 0.00856 mol, and the molarity is 0.00856 / 0.100 = 0.0856 M.

Going the other way, the mass to weigh for a target solution is molarity x volume in litres x molecular mass. For 250 mL of 0.5 M glucose: 0.5 x 0.250 x 180.156 = 22.52 g. The calculator works both directions out for you, including dilution and serial dilution steps.

Common mistakes

Writing symbols in the wrong case. Lowercase h2o or C6h12o6 will not parse. Element symbols start with a capital letter, and the second letter, if there is one, is lowercase.

Forgetting the subscript. H2O is not HO. One missing 2 changes the mass from 18.015 to 17.007 g/mol, which is a different substance.

Counting a bracket group once. In Ca(OH)2 the 2 outside the bracket doubles the whole OH group, not just the hydrogen. Work out the group mass first.

Reading a charge as a count. In Fe3+ the 3 is the charge, so it is one iron atom at 55.845 g/mol, not three. Charges never change the mass. The full charge rules are in the guide How to Calculate Molecular Weight from a Chemical Formula: Brackets, Subscripts and Ions.

Try it yourself: open the Molecular Weight Calculator, type C6H12O6, and check that you get 180.156 g/mol with carbon at 40.00%. Then try Ca(OH)2 and confirm 74.092 g/mol.

Last reviewed: November 16, 2026