Grams to Moles Calculator

Convert grams to moles, moles to grams, or find a molar mass from both, with the number of particles from the Avogadro constant.

Solve for
Molar mass from
Molar mass is computed from IUPAC standard atomic weights.
Mass
100 g0.1 kg
Molar mass
58.4398 g/mol
Particles (N)
1.03049 × 10²⁴molecules, atoms or formula units
Mass of one particle
9.70415 × 10⁻²³ g
Amount of substance (n)1.71116 molof NaCl

Show the work

  1. Molar mass of NaCl: 1 × 22.98976928 + 1 × 35.45 = 58.4398 g/mol
  2. n = m ÷ M = 100 g ÷ 58.4398 g/mol = 1.71116 mol
  3. Number of particles: N = n × NA = 1.71116 × 6.02214076 × 1023 = 1.03049 × 10²⁴

Chemists count atoms by weighing them. A balance reads grams, but reactions run in moles, so nearly every lab calculation passes through the conversion n = m/M. This calculator handles it in any direction: grams to moles, moles to grams, or the molar mass of an unknown from a measured mass and amount. It also tells you how many molecules, atoms or formula units that amount represents.

How to use the grams to moles calculator

  1. Under Solve for, pick Moles, Mass or Molar mass.
  2. When solving for moles or mass, choose where the molar mass comes from. With Chemical formula, type the formula (case matters: NaCl, not nacl) and it is computed from IUPAC atomic weights. With Known value, enter it in g/mol, kg/mol or kDa.
  3. Enter the Mass (m) in g, mg, kg, µg, lb or oz and/or the Amount (n) in mol, mmol, µmol, nmol or kmol.
  4. Use Show the result in to pick the output unit. The result also lists the number of particles (N), the mass of a single particle and the steps.

Mass, amount and molar mass must be greater than zero; a zero or negative entry is rejected.

Mole formulas

n = m ÷ M  ·  m = n × M  ·  M = m ÷ n
N = n × NA,  NA = 6.02214076 × 10²³ mol⁻¹

Here n is the amount of substance in moles, m the mass, M the molar mass and N the number of particles.

Worked example: 100 grams of table salt

The molar mass of NaCl is 22.98977 + 35.45 = 58.440 g/mol.

n = 100 g ÷ 58.440 g/mol = 1.711 mol

N = 1.711 mol × 6.02214076 × 10²³ mol⁻¹ ≈ 1.030 × 10²⁴ formula units

Sodium chloride is an ionic lattice, so the “particles” are NaCl formula units. Each one holds a sodium ion and a chloride ion, so the sample contains about 2.06 × 10²⁴ ions in total.

Going the other way: moles to grams

A recipe calls for 0.25 mol of glucose. Choose Mass, type C6H12O6 and enter 0.25 mol: m = 0.25 × 180.156 = 45.039 g, or 45,039 mg if you pick milligrams.

Finding an unknown molar mass

If 10 g of a red-brown oxide turns out to be 0.0625 mol, then M = 10 ÷ 0.0625 = 160 g/mol, close to iron(III) oxide, Fe₂O₃ (159.687 g/mol).

The mole and the Avogadro constant

Since the 2019 revision of the SI, the mole is defined by fixing the Avogadro constant at exactly 6.02214076 × 10²³ mol⁻¹. Before that, a mole was the number of atoms in 12 g of carbon-12. One side effect: 12 g of ordinary carbon is no longer quite one mole. Natural carbon contains about 1% carbon-13, so its atomic weight is 12.011, and 12 g of it is 0.999 mol.

Always say which particles you are counting. One mole of oxygen gas, O₂, has 6.022 × 10²³ molecules but twice as many oxygen atoms. The calculator counts whole formula units, exactly as written.

Typical conversions

Sample Molar mass (g/mol) Amount
1 g of hydrogen gas, H₂ 2.016 0.496 mol
1 g of gold, Au 196.967 5.077 mmol
18.015 g of water, H₂O 18.015 1 mol
1 kg of carbon dioxide, CO₂ 44.009 22.72 mol
1 kg of water, H₂O 18.015 55.51 mol
1 lb of sucrose, C₁₂H₂₂O₁₁ 342.297 1.325 mol

Avoiding unit mistakes

Prefixes carry straight through: milligrams divided by g/mol give millimoles, and micrograms give micromoles. Proteins and polymers are usually labeled in kilodaltons, and 1 kDa equals 1,000 g/mol, so 1 mg of a 66.5 kDa protein is 15.04 nmol. Pounds and ounces are treated as avoirdupois mass (1 lb = 453.592 g).

To get a molar mass with a full atom-by-atom breakdown, use the molar mass calculator. To turn moles into a concentration, continue with the molarity calculator. For gases, the ideal gas law calculator links moles to pressure, volume and temperature.

Frequently asked questions

How do I convert grams to moles?

Divide the mass in grams by the molar mass in g/mol. For 100 g of sodium chloride, 100 ÷ 58.440 g/mol = 1.711 mol. The calculator works out the molar mass from the formula you type, so you only need the mass.

How do I convert moles to grams?

Multiply the number of moles by the molar mass. A quarter mole of glucose (C6H12O6, 180.156 g/mol) weighs 0.25 × 180.156 = 45.039 g. Choose Mass under Solve for to do this in the calculator.

What is Avogadro's number?

It is the number of particles in one mole: exactly 6.02214076 × 10²³ per mole. Since the 2019 revision of the SI this value is fixed by definition, so it carries no measurement uncertainty.

How many molecules are in 18 grams of water?

Water's molar mass is 18.015 g/mol, so 18 g is 0.9992 mol, or about 6.017 × 10²³ molecules. Each molecule holds three atoms, so the same sample contains about 1.805 × 10²⁴ atoms.

Can I use the calculator for a protein or a polymer?

Yes. Switch Molar mass from to Known value and enter it in kDa or g/mol. One milligram of a 66.5 kDa protein is 15.04 nmol, or about 9.06 × 10¹⁵ molecules.

Last reviewed October 2026 by the CalcFluent editorial team. How we check our calculators.