Grams to Moles CalculatorConvert grams, moles and molecules for any chemical formula
Type a formula like H2O, Ca(OH)2 or CuSO4·5H2O. The calculator finds the molar mass, converts in any direction and shows every step.
How do you convert grams to moles?
Divide the mass by the molar mass: moles = grams ÷ molar mass (g/mol). For 25.0 g of glucose (C6H12O6, 180.156 g/mol), moles = 25.0 ÷ 180.156 = 0.1388 mol. To go from moles to grams, multiply instead. To count molecules, multiply moles by Avogadro’s constant, 6.02214076 × 10²³.
Molar mass breakdown
| Element | Atoms | Atomic weight | Subtotal (g/mol) | Mass % |
|---|
Grams, moles and particles: the three conversion formulas
Molar mass is the bridge between what you can weigh and what you can count. Avogadro’s constant is the bridge between moles and individual particles.
Here m is mass in grams, M is molar mass in g/mol, n is amount in moles, N is the number of particles, and Nₐ = 6.02214076 × 10²³ mol⁻¹ exactly, as fixed by the 2019 SI redefinition.
How to use this grams to moles calculator
- Type the formula with correct capitals (Co is cobalt, CO is carbon monoxide). Use · or a dot for hydrates.
- Check the molar mass panel to confirm the formula was read the way you meant.
- Choose what you have: grams, moles or number of particles.
- Enter the amount. The bridge updates all three values, and the breakdown shows where the molar mass comes from.
Worked example: 25.0 g of glucose
- Molar mass of C6H12O6 = 6(12.011) + 12(1.008) + 6(15.999) = 72.066 + 12.096 + 95.994 = 180.156 g/mol.
- Moles = 25.0 g ÷ 180.156 g/mol = 0.1388 mol (138.8 mmol).
- Molecules = 0.1388 × 6.02214076 × 10²³ = 8.357 × 10²² molecules.
- Each glucose molecule has 24 atoms, so the sample holds 24 × 8.357 × 10²² = 2.006 × 10²⁴ atoms.
In pharmacy, the same step converts a weighed dose into millimoles, for example when checking electrolyte content in an infusion.
Molar mass and moles in 100 g of common compounds
| Compound | Formula | Molar mass (g/mol) | Moles in 100 g |
|---|---|---|---|
| Water | H2O | 18.015 | 5.551 mol |
| Carbon dioxide | CO2 | 44.009 | 2.272 mol |
| Sodium chloride | NaCl | 58.440 | 1.711 mol |
| Sodium hydroxide | NaOH | 39.997 | 2.500 mol |
| Calcium carbonate | CaCO3 | 100.086 | 0.9991 mol |
| Sulfuric acid | H2SO4 | 98.072 | 1.020 mol |
| Glucose | C6H12O6 | 180.156 | 0.5551 mol |
| Caffeine | C8H10N4O2 | 194.194 | 0.5149 mol |
Mistakes that give the wrong number of moles
- Lower-case element symbols. “co” or “CO” are not cobalt. Type Co.
- Diatomic elements. Oxygen gas is O2 (31.998 g/mol), not O (15.999 g/mol). The same applies to H2, N2, Cl2, F2, Br2 and I2.
- Dropping the hydrate water. MgSO4·7H2O and anhydrous MgSO4 differ by over 100 g/mol.
- Multiplying instead of dividing. Grams to moles always divides by molar mass. A sanity check: moles should be smaller than grams for anything heavier than hydrogen.
Related chemistry calculators
Moles are the currency of stoichiometry. Take your answer into the next step with these tools.
Grams to moles FAQs
Divide the mass in grams by the molar mass in g/mol: moles = grams ÷ molar mass. For example, 36.03 g of water ÷ 18.015 g/mol = 2.000 mol.
Multiply moles by molar mass: grams = moles × molar mass. 0.500 mol of sodium chloride × 58.44 g/mol = 29.22 g.
A mole is the SI unit for amount of substance. Since 2019 it is defined as exactly 6.02214076 × 10²³ specified particles, such as atoms, molecules or ions.
Add up the atomic weight of every atom in the formula. Water, H2O, is 2 × 1.008 + 15.999 = 18.015 g/mol. The calculator does this automatically from the formula you type.
Multiply moles by Avogadro's constant, 6.02214076 × 10²³ per mole. 0.1388 mol of glucose contains about 8.36 × 10²² molecules.
Type CuSO4·5H2O, CuSO4.5H2O or CuSO4*5H2O. All three are read the same way and give 249.68 g/mol.
Yes. Parentheses, square brackets and braces all work, including nested ones such as K4[Fe(CN)6] or (NH4)2SO4.
Textbooks often round atomic weights, for example using 1.0 for hydrogen or 16.0 for oxygen. This calculator uses IUPAC conventional standard atomic weights, so small differences in the last digit are normal.
Grams measure mass, while moles count particles. One mole of hydrogen gas weighs about 2 g, but one mole of gold weighs about 197 g, even though both contain the same number of particles.
Each water molecule has 3 atoms, so 1 mol of H2O contains 3 × 6.022 × 10²³ = 1.807 × 10²⁴ atoms. The calculator reports total atoms as well as molecules.
In everyday chemistry they have the same number. Strictly, molar mass has units of g/mol, while relative molecular mass (molecular weight) is unitless.
Yes. For ionic compounds the particle is a formula unit rather than a molecule, but the grams-to-moles math is identical.
Sources
This calculator is an educational tool. Atomic weights are IUPAC conventional values; for isotope-specific or high-precision analytical work, use the full CIAAW tables.
