Grams to Moles Calculator

Convert a mass in grams to an amount in moles — or moles back to grams — using the substance's molar mass.

Quick answer: moles = mass (g) ÷ molar mass (g/mol), and grams = moles × molar mass. For example, 18 g of water (molar mass 18.015 g/mol) is 18 ÷ 18.015 = 0.999 mol.

Need the molar mass? Use our molecular weight calculator to get it from the formula.

A mole is a fixed count of particles — 6.022 × 10²³, Avogadro's number — and the molar mass is the mass of one mole of a substance in grams. Dividing a mass by the molar mass tells you how many moles you have; multiplying moles by the molar mass gives the mass. This conversion is the backbone of nearly every stoichiometry problem.

How the conversion works

moles = mass (g) ÷ molar mass (g/mol)
grams = moles × molar mass (g/mol)
molecules = moles × 6.022 × 10²³

Worked example

How many moles are in 25 g of sodium chloride (NaCl, molar mass 58.44 g/mol)? moles = 25 ÷ 58.44 = 0.4278 mol. Going the other way, 2 mol of NaCl weighs 2 × 58.44 = 116.88 g.

Frequently asked questions

How do I convert grams to moles?
Divide the mass in grams by the molar mass in g/mol. For 18 g of water (18.015 g/mol), that's 18 ÷ 18.015 ≈ 1 mol.
Where do I get the molar mass?
Add up the standard atomic weights of every atom in the formula, or use our molecular weight calculator, which does it from the formula.
How do I get the number of molecules?
Multiply the moles by Avogadro's number, 6.022 × 10²³ molecules per mole.
Is molar mass the same as molecular weight?
Numerically yes; molar mass carries the unit grams per mole. For this conversion you can treat them as the same value.

Related calculators

For general and educational use.
Written by the CalcPine team · Reviewed for accuracy · Last updated 31 July 2026 · Method: moles = mass ÷ molar mass; grams = moles × molar mass.