Grams to Moles Calculator
Enter a chemical formula and an amount in g, mg or kg to calculate moles and estimate the particle count. Choose mol to convert moles to grams.
How to convert mass into moles
Start with the formula of the substance you weighed. Multiply each element’s atom count by its atomic weight, then add the contributions to find the molar mass in grams per mole. The calculator uses the same CIAAW abridged standard atomic weights as the molecular weight calculator.
Divide the sample mass in grams by its molar mass in g/mol. Grams cancel and the answer is in moles. Convert the mass to grams first: divide milligrams by 1,000 or multiply kilograms by 1,000. For the reverse calculation, multiply the number of moles by the molar mass. The mole units cancel and leave grams. See the BIPM table of SI prefixes and the SI guide to using the mole.
Worked example with sodium chloride
The formula NaCl contains one sodium and one chlorine per formula unit. Using CIAAW’s values, add 22.990 and 35.45 to get a molar mass of about 58.44 g/mol. A 5,844 mg sample is 5.844 g. Divide 5.844 g by 58.44 g/mol to get about 0.1000 mol. In reverse, multiply 0.1000 mol by 58.44 g/mol to get about 5.844 g. Both calculations use the same formula and molar mass.
From moles to molecules or formula units
Multiply moles by the Avogadro constant, exactly 6.02214076 × 1023 mol−1 under the SI definition of the mole. The NaCl sample contains about 6.022 × 1022 formula units. For water, the same multiplication gives the number of H2O molecules. Match the unit you are counting to the formula you entered: a molecule for water, a formula unit for solid sodium chloride, or an atom for a formula like He.
The particle count is an estimate because it comes from the amount entered and, for mass inputs, tabulated atomic weights. The calculator keeps full precision during the calculation, then rounds displayed results based on the amount entered and any atomic weights used to calculate them.