Grams to Moles and Moles to Grams: Conversions with Worked Examples

Convert between grams, moles and number of particles using molar mass and Avogadro's number, with step-by-step examples and a stoichiometry walkthrough.

A scientist using a pipette with test tubes in a lab
Photo by Julia Koblitz on Unsplash
Try the Molecular Weight Calculator – Type a chemical formula to get its molar mass in g/mol, a breakdown by element with mass percent, and quick grams-to-moles conversions.

Balances measure grams, but chemical equations count particles. The mole is the bridge between them, and molar mass is the conversion factor that lets you cross it in either direction.

The two conversions

moles = grams ÷ molar mass
grams = moles × molar mass

To find the number of particles, multiply moles by Avogadro's number, 6.022 × 10²³ per mole.

Example 1: grams to moles

How many moles are in 25.0 g of sodium chloride?

  • Molar mass of NaCl: 22.99 + 35.45 = 58.44 g/mol
  • 25.0 ÷ 58.44 = 0.428 mol

Example 2: moles to grams

What is the mass of 0.150 mol of glucose, C₆H₁₂O₆?

  • Molar mass: 180.16 g/mol
  • 0.150 × 180.16 = 27.0 g

Example 3: grams to molecules

How many molecules are in 10.0 g of water?

  • 10.0 ÷ 18.015 = 0.555 mol
  • 0.555 × 6.022 × 10²³ = 3.34 × 10²³ molecules

The molecular weight calculator has grams and moles boxes under the formula, so you can do the first two steps for any compound.

Using the factor-label method

Writing units and cancelling them prevents most mistakes:

25.0 g NaCl × (1 mol NaCl / 58.44 g NaCl) = 0.428 mol NaCl

If the units don't cancel to what you want, the conversion factor is upside down.

A stoichiometry example

How many grams of water form when 4.00 g of hydrogen gas burns completely? The balanced equation is 2H₂ + O₂ → 2H₂O.

  1. Grams to moles of H₂: 4.00 ÷ 2.016 = 1.984 mol
  2. Mole ratio: 2 mol H₂ gives 2 mol H₂O, so 1.984 mol H₂O
  3. Moles to grams of H₂O: 1.984 × 18.015 = 35.7 g

The middle step is a ratio from the balanced equation, which is why chemistry and the ratio calculator overlap more than you might expect.

Significant figures

Report answers to the same number of significant figures as the least precise measurement. Molar masses from the periodic table are usually more precise than your measured mass, so the mass you weighed typically sets the precision.

Common mistakes

  • Using the atomic weight of an element instead of the molar mass of the whole compound.
  • Forgetting diatomic elements: hydrogen gas is H₂ (2.016 g/mol), not H.
  • Dividing when you should multiply; check units.
  • Ignoring water of hydration in compounds like CuSO₄·5H₂O; see molar mass of hydrates.

Further reading from official sources

More molecular weight guides

A round glass dish on white paper in a laboratoryMolar Mass vs. Molecular Weight vs. Formula Mass: What's the Difference?Clear definitions of molar mass, molecular weight, formula mass and atomic mass units, why their numbers match, and how to calculate each from a chemical formula.3 min readTest tubes filled with different colored liquidsPercent Composition by Mass: How to Calculate It and Why It MattersCalculate the mass percent of each element in a compound from its formula, check the result, and use percent composition in labs, nutrition labels and fertilizers.2 min readA person in green gloves using a pipette to fill a small vialMolarity and Preparing Solutions: From Molar Mass to Grams to WeighCalculate how many grams to weigh for a solution of a given molarity, dilute stock solutions with C1V1 = C2V2, and avoid common preparation mistakes.2 min read