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.

Add DexoCalc as a preferred source on Google

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²³.

C6H12O6
180.156 g/mol Molar mass from IUPAC standard atomic weights
Mass25.00 g25,000 mg
Amount0.1388 mol138.8 mmol
Particles8.357 × 10²²2.006 × 10²⁴ atoms

  

Molar mass breakdown

ElementAtomsAtomic weightSubtotal (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.

n = m ÷ MGrams to moles
m = n × MMoles to grams
N = n × NₐMoles to 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

  1. Type the formula with correct capitals (Co is cobalt, CO is carbon monoxide). Use · or a dot for hydrates.
  2. Check the molar mass panel to confirm the formula was read the way you meant.
  3. Choose what you have: grams, moles or number of particles.
  4. 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

  1. Molar mass of C6H12O6 = 6(12.011) + 12(1.008) + 6(15.999) = 72.066 + 12.096 + 95.994 = 180.156 g/mol.
  2. Moles = 25.0 g ÷ 180.156 g/mol = 0.1388 mol (138.8 mmol).
  3. Molecules = 0.1388 × 6.02214076 × 10²³ = 8.357 × 10²² molecules.
  4. 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

CompoundFormulaMolar mass (g/mol)Moles in 100 g
WaterH2O18.0155.551 mol
Carbon dioxideCO244.0092.272 mol
Sodium chlorideNaCl58.4401.711 mol
Sodium hydroxideNaOH39.9972.500 mol
Calcium carbonateCaCO3100.0860.9991 mol
Sulfuric acidH2SO498.0721.020 mol
GlucoseC6H12O6180.1560.5551 mol
CaffeineC8H10N4O2194.1940.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.

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

  1. BIPM: SI Brochure, definition of the mole (2019)
  2. NIST CODATA: Avogadro constant
  3. CIAAW / IUPAC Standard Atomic Weights
  4. OpenStax Chemistry 2e, Section 3.1: Formula Mass and the Mole Concept
  5. PubChem compound database

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.