Science & Engineering

Grams to Moles Calculator (n = m / M)

Enter a mass in grams and the molar mass, and it returns the number of moles using n = m / M. Pick a preset substance or type your own molar mass, and it can also report the particle count.

Reviewed and updated

How to use
  1. Pick a preset substance or enter a custom molar mass.
  2. Enter the mass in grams.
Try mass
Amount of substance
0.99917 mol

18 g of Water ÷ 18.015 g/mol

Molar mass
18.015 g/mol
Particles (N)
6.0167e23
1 g equals
0.05551 mol
For study and estimation. Verify against authoritative data before relying on a result.
Was this helpful?

Divide the mass by the molar mass

Moles are just a count of particles measured through weight. Divide how many grams you have by how much one mole weighs (the molar mass), and you get the number of moles.

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

The molar mass comes from the formula: add up the atomic mass of every atom in it. Watch the subscripts — O2 is 2 × 16.00 = 32.00 g/mol, not 16.

Worked example: 25 g of table salt

  • Molar mass of NaCl. Na (22.990) + Cl (35.45) = 58.44 g/mol.
  • Moles. 25 g ÷ 58.44 g/mol = 0.428 mol.
  • Molecules. 0.428 × 6.022 × 1023 = 2.58 × 1023 formula units.

Molar masses of common substances

SubstanceFormulaMolar mass (g/mol)
WaterH2O18.015
Table saltNaCl58.44
Carbon dioxideCO244.01
GlucoseC6H12O6180.16
EthanolC2H5OH46.07
Sodium hydroxideNaOH40.00
Sulfuric acidH2SO498.08
Calcium carbonateCaCO3100.09
SucroseC12H22O11342.30

Atomic masses use IUPAC 2021 standard values. Numerically the molar mass in g/mol equals the atomic or molecular weight, but the units differ.

Where people slip up

  • Wrong units. The formula needs grams. Convert from kilograms or milligrams first.
  • Forgetting subscripts. Every atom counts — H2O has two hydrogens, not one.
  • Atoms vs molecules. One mole of H2O is one mole of molecules but two moles of hydrogen atoms.

Common questions

How do you convert grams to moles?

Divide the mass in grams by the molar mass in grams per mole. For example, 36 grams of water divided by 18.015 g/mol gives 2 moles.

What is the molar mass of water?

18.015 grams per mole. You get it by adding the atomic masses in H2O: two hydrogens at 1.008 plus one oxygen at 15.999, which comes to 18.015.

How many molecules are in one mole?

Exactly 6.02214076 times 10 to the 23rd, known as Avogadro number. This value was fixed by definition in the 2019 revision of the SI units, so it carries no measurement uncertainty.

From the blog

Guides & how-tos

All articles →