Grams to Moles Converter
Enter a mass and a molar mass — from the built-in compound list or your own — and this converter applies n = m ÷ M to give moles and molecules instantly.
Example: with Mass (grams) 10 · Compound (molar mass) Table salt NaCl (58.44 g/mol) · Custom molar mass (g/mol) 18.015 → Moles: 0.1711 mol.
Computed by the calculator below using its default values. Change any input to see your own numbers.
π§ͺ Ace chemistry with a solved-problems guide
Check it outThe grams to moles formula
To convert grams to moles, divide the mass by the molar mass: n = m ÷ M. The molar mass M is the sum of the atomic masses on the periodic table, in g/mol. Worked example: 10 g of table salt (NaCl, 58.44 g/mol) is 10 ÷ 58.44 = 0.171 mol. The same mass of a heavier compound contains fewer moles — 10 g of glucose (180.156 g/mol) is only 0.056 mol — which is why moles, not grams, are what reaction ratios count.
To go from grams to molecules, convert to moles first, then multiply by Avogadro’s number: molecules = n × 6.022 × 10²³. So 18.015 g of water is exactly 1 mol, or 6.022 × 10²³ molecules. Going the other way — moles to grams — just multiply: m = n × M.
How itβs calculated
Moles n = mass m (in grams) ÷ molar mass M (in g/mol). Built-in molar masses use IUPAC standard atomic weights: H2O 18.015, CO2 44.01, NaCl 58.44, NaOH 40.00, H2SO4 98.079, glucose C6H12O6 180.156 g/mol; the custom option accepts any value. Molecules or formula units = n × 6.02214076 × 10²³, the exact SI Avogadro constant.
Results update as you type and are estimates, not professional advice β verify important decisions with a qualified professional.
Common mistakes
- Using the atomic number instead of the atomic mass — carbon is 12.011 g/mol, not 6.
- Forgetting to multiply subscripts through parentheses: Ca(OH)2 has two O and two H, so 74.09 g/mol, not 57.09.
- Flipping the division: it is mass ÷ molar mass, so 10 g of NaCl is 0.171 mol, not 5.844.
Frequently asked questions
How do I convert grams to moles?
Divide the mass in grams by the compound's molar mass in g/mol. For 90 g of glucose (180.156 g/mol): 90 ÷ 180.156 = 0.4996 mol, essentially half a mole.
What is the grams to moles formula?
n = m ÷ M, where m is mass in grams and M is molar mass in g/mol. Rearranged, m = n × M converts moles back to grams.
How do I find a compound's molar mass?
Add the atomic masses of every atom in the formula from the periodic table. CO2 = 12.011 + 2 × 15.999 = 44.01 g/mol.
How do I convert grams to molecules?
Convert grams to moles first, then multiply by Avogadro's number (6.022 × 10²³). For example, 9 g of water is 0.4996 mol, or about 3.009 × 10²³ molecules.
How many grams are in one mole?
It depends on the substance: one mole weighs its molar mass in grams. One mole of water is 18.015 g, while one mole of NaCl is 58.44 g.