Grams to Moles Calculator
Enter a chemical formula and a mass to get the number of moles, or enter moles to get grams. The molar mass is calculated from the formula, including brackets and hydrates, and you also see the number of molecules and atoms and each element's share of the mass.
How to use the Grams to Moles Calculator
- Type the chemical formula, e.g. NaCl, C6H12O6 or Ca(OH)2 (element symbols are case-sensitive).
- Choose the direction: grams to moles or moles to grams.
- Enter the amount and pick its unit.
- Read the result, the molar mass and the number of molecules and atoms.
- Check the element table for the mass percent of each element, or copy the results.
Grams to moles formulas
- Moles: n = m ÷ M (mass in grams divided by molar mass in g/mol)
- Grams: m = n × M
- Particles: N = n × NA, with Avogadro's number NA = 6.02214076 × 10²³ mol⁻¹
- Molar mass: M = Σ (number of atoms × atomic weight) over all elements in the formula
Molar masses of common compounds
| Compound | Formula | Molar mass (g/mol) | Moles in 1 g |
|---|---|---|---|
| Water | H₂O | 18.015 | 0.05551 |
| Carbon dioxide | CO₂ | 44.009 | 0.02272 |
| Sodium chloride | NaCl | 58.44 | 0.01711 |
| Sodium hydroxide | NaOH | 39.997 | 0.02500 |
| Calcium carbonate | CaCO₃ | 100.086 | 0.009991 |
| Calcium hydroxide | Ca(OH)₂ | 74.092 | 0.01350 |
| Sulfuric acid | H₂SO₄ | 98.072 | 0.01020 |
| Hydrochloric acid (HCl) | HCl | 36.458 | 0.02743 |
| Glucose | C₆H₁₂O₆ | 180.156 | 0.005551 |
| Copper(II) sulfate pentahydrate | CuSO₄·5H₂O | 249.677 | 0.004005 |
Formula tips: element symbols are case-sensitive (Co = cobalt, CO = carbon monoxide), a number after a bracket multiplies the whole group, and a leading number after a hydrate dot multiplies that part (5H2O = 5 waters).
Frequently asked questions
How do I convert grams to moles?
Divide the mass by the molar mass: n = m ÷ M. For example, 49.04 g of sulfuric acid (H2SO4, M = 98.072 g/mol) is 49.04 ÷ 98.072 ≈ 0.500 mol.
How do I convert moles to grams?
Multiply the number of moles by the molar mass: m = n × M. Two moles of water (18.015 g/mol) weigh 2 × 18.015 = 36.03 g.
How is the molar mass calculated from a formula?
Add up the standard atomic weight of every atom in the formula. For Ca(OH)2: Ca 40.078 + 2 × (O 15.999 + H 1.008) = 74.092 g/mol. The subscript after a bracket multiplies everything inside it.
How many molecules are in a mole?
One mole contains Avogadro's number of particles, exactly 6.02214076 × 10²³ (fixed by the 2019 SI definition). Multiply moles by this number to get molecules or formula units; multiply again by the atoms per formula to get atoms.
How do I enter hydrates and complex formulas?
Use a dot or an asterisk for water of crystallisation, like CuSO4·5H2O or CuSO4*5H2O, and round, square or curly brackets for groups, like K4[Fe(CN)6]. Element symbols must start with a capital letter: Co is cobalt, CO is carbon monoxide.
Which atomic weights does the calculator use?
IUPAC standard (conventional) atomic weights, for example H 1.008, C 12.011, N 14.007, O 15.999. Elements with no stable isotopes use the mass number of their longest-lived isotope, so results containing them are approximate.