How to convert grams to moles (with a worked example)

Divide the mass in grams by the molar mass in g/mol. How to find the molar mass from a formula, a worked baking soda example, and quick checks.

To convert grams to moles, divide the mass by the molar mass: moles = grams ÷ g/mol. The molar mass calculator reads your formula, works out the molar mass, and has a grams, moles and particles box where changing any one number updates the other two.

What you need

  • The mass of your substance in grams. If the balance shows mg, divide by 1000 first.
  • The chemical formula, written with the right capitals (NaCl, not NACL). For a hydrate, include the water, such as CuSO4·5H2O.
  • That is all. The atomic weights come built in.

Step by step

A mole is a counting unit, like a dozen, only far larger: one mole holds 6.022 × 10²³ particles, a number called Avogadro’s constant. The molar mass (M) is how many grams one mole of a substance weighs. It is the sum of the atomic weights of every atom in the formula.

So the conversion is a single division:

n = m ÷ M

  • n is the amount in moles (mol).
  • m is the mass in grams (g).
  • M is the molar mass in grams per mole (g/mol).

And if you want the number of particles:

N = n × 6.022 × 10²³

With the tool:

  1. Open the molar mass calculator and type the formula in the Formula box. The big line shows the molar mass at once.
  2. Glance at the composition table under “What it is made of”. It lists each element, how many atoms of it there are and its share of the mass. If an element is missing or its count looks wrong, fix the formula.
  3. Scroll to Grams, moles and particles and type your mass in the Mass (g) box.
  4. Read the moles and the number of formula units in the other two boxes.
  5. To go the other way, type into the Amount (mol) box instead, and the grams appear.

A worked example

You weigh out 5.00 g of baking soda, sodium hydrogen carbonate, NaHCO₃. How many moles is that?

Molar mass by hand. One formula unit has one sodium, one hydrogen, one carbon and three oxygens:

22.990 + 1.008 + 12.011 + (3 × 15.999) = 84.006 g/mol

Typing NaHCO3 into the calculator gives the same 84.006 g/mol (shown as 84.01 on the big line).

Grams to moles.

n = 5.00 g ÷ 84.006 g/mol = 0.05952 mol

Moles to particles.

N = 0.05952 mol × 6.022 × 10²³ per mol ≈ 3.584 × 10²² formula units

Type 5 into the Mass box and the calculator fills in 0.05952 mol and about 3.584 × 10²² formula units.

And back again. A recipe asks for 0.025 mol of baking soda. Type 0.025 into the Amount box and the mass box shows about 2.100 g, since 0.025 × 84.006 = 2.100.

The composition table adds one more useful fact: sodium is 27.37 % of the mass of baking soda, so those 5.00 g contain about 1.37 g of sodium.

Check your answer

  • Estimate first. 5 g divided by roughly 84 g/mol is a bit under 0.06 mol. An answer near 0.6 or 0.006 means a decimal has slipped.
  • Small numbers are normal. For everyday masses of common chemicals, moles usually come out well below 1. Every substance has a molar mass above 1 g/mol, so the number of moles is always smaller than the number of grams.
  • Multiply back. 0.05952 mol × 84.006 g/mol = 5.000 g. If you do not land on your starting mass, recheck the molar mass.
  • Check the formula’s water. A hydrate’s molar mass is much larger than the dry salt’s, so the moles for the same mass are smaller.

Questions people ask

What is the difference between molar mass and molecular weight? In practice they are the same number. Molar mass carries the unit g/mol. Molecular weight (or relative molecular mass) is the same value without a unit, or in daltons for one molecule.

How do I convert moles of one substance to grams of another in a reaction? You need the balanced equation, because it tells you how many moles of product each mole of reactant makes. The equation balancer balances the equation and works out the amounts for you.

I want a solution of a certain molarity, not just a number of moles. What now? Moles per litre is molarity, so multiply the molarity you want by the volume in litres to get the moles, then by the molar mass to get grams. The dilution calculator does that in one step.

Sources

  • Atomic weights: IUPAC/CIAAW standard atomic weights (abridged values).
  • Avogadro constant: 6.02214076 × 10²³ per mole, exact by definition in the SI (2019).

If you are an author or publisher and want a credit or a passage changed or removed, tell us and we will act quickly.

Tools in this article

Read next