Enter a sample mass in grams and a chemical formula or molar mass to find the moles of that pure substance.
Advanced options
Table of contents
How to use our Grams to Moles Calculator
- Choose whether to calculate molar mass from a chemical formula or enter a known molar mass.
- Enter the sample mass in grams from your problem, label, or balance reading.
- Enter the chemical formula exactly as written, or enter the supplied molar mass in g/mol.
- Click Calculate, then check that the shown setup divides grams by g/mol, which leaves mol.
- Open Advanced options only if your class or lab tells you how many significant figures to report.

Definitions
Mole (mol): The SI unit for amount of substance. It measures a specified count of chemical entities, such as atoms, molecules, or formula units. [1]
Molar mass (g/mol): The mass of one mole of a substance, measured in grams per mole.
Chemical formula: A set of element symbols and subscripts that states the relative number of atoms in a substance.
Subscript: A small whole number after an element or group. In H2O, the 2 means two hydrogen atoms for each water formula.
Hydrate: A compound written with water included in its formula, such as CuSO4.5H2O. The 5 counts water molecules associated with each copper sulfate unit.
Significant figures: Meaningful digits retained when reporting a measured or calculated value.
Common mistakes and quick fixes
Mistake: Entering kilograms or milligrams as though they were grams.
Fix: Check How will you provide molar mass? and then recalculate. Convert the mass to grams before entering it.
Mistake: Multiplying the sample mass by molar mass.
Fix: Check How will you provide molar mass? and then recalculate. For grams to moles, divide mass in g by molar mass in g/mol.
Mistake: Using the wrong capitalization in a chemical formula.
Fix: Check How will you provide molar mass? and then recalculate. Check each element symbol. Co is cobalt, while CO contains carbon and oxygen.
Mistake: Leaving out a subscript, grouped part, or hydrate water group.
Fix: Check How will you provide molar mass? and then recalculate. Copy the formula exactly, such as Ca(OH)2 or CuSO4.5H2O.
Mistake: Entering 0 or a negative value for molar mass.
Fix: Check How will you provide molar mass? and then recalculate. Enter a positive molar mass because it is the number used for division.
Mistake: Rounding the molar mass before calculating moles.
Fix: Check How will you provide molar mass? and then recalculate. Keep available digits through the division, then round the final answer as your assignment requires.
Limitations & Key Assumptions / Boundary Conditions
- This calculation applies to the stated mass of one pure substance. It does not adjust for purity, mixtures, solutions, concentration, reaction yield, or limiting reactants.
- Formula entry accepts recognized element symbols, whole-number subscripts, parentheses, brackets, and hydrate groups separated by an ASCII period.
- Formula entry does not accept isotope labels, ionic charge notation, reaction equations, leading reaction coefficients, or compound names. Enter a known isotope-specific molar mass manually when needed.
- Formula-based molar mass uses standard atomic weights for naturally occurring material. A sample with an unusual isotopic composition can have a different molar mass.
- A mass of 0 g is valid and gives 0 mol. Negative mass and molar mass less than or equal to 0 g/mol are outside the calculator's domain.
- Changing significant figures changes only the displayed rounding, not the underlying division.
Methodology
Calculation
The calculator first finds molar mass. In chemical-formula mode, it counts each element in the formula and adds its atomic-mass contributions. In manual mode, it uses the molar mass you enter.
moles = sample mass (g) / molar mass (g/mol)
Grams divided by grams per mole leaves mol. Molar mass is the mass of one mole of a substance, and a formula's mass comes from the atomic masses and counts shown in that formula. [1]
Worked example
For 18.015 g of water, H2O has a molar mass of 18.015 g/mol: two hydrogen atoms contribute 2.016 g/mol and one oxygen atom contributes 15.999 g/mol.
moles = 18.015 g / 18.015 g/mol = 1.00000 mol
Rounding
The calculator divides using the unrounded molar mass, then rounds visible values to the selected number of significant figures. Keep the digits required by your course or lab rule in the final reported answer.