Skip to content
Calcapedia
Science

Grams to Moles Calculator

Switch between grams, moles and number of particles, using a chemical formula or a molar mass you enter. Avogadro's number is built in.

Level: Grades 10–11

Printable worksheet

Grams to Moles Calculator

Know the answer you need? Pick an input to work backward.

Inputs
What do you know?
Molar mass

Case matters: Co is cobalt, CO is carbon monoxide.

Result

Amount of substance

2 mol

36.03 g of H2O is 2 mol, or about 1.2044e+24 particles.

Mass
36.03 g
Number of particles
1.2044e+24
Molar mass used
18.015 g/mol
Total atoms (3 per H2O unit)
3.6133e+24

See the step-by-step solution ↓

Step-by-step solution

  1. Find the molar mass of H2O, the weight of one mole. Take each atom's weight times how many there are, then add them up

    2×1.008+1×15.999=18.015 g/mol
  2. Divide the mass by the molar mass to find how many moles (n) you have

    n=36.03 g18.015 g/mol=2 mol
  3. Multiply the moles by Avogadro's number, the count in one mole, to get the particles (N)

    N=2×6.02214076e+23=1.204428e+24
  4. Each H2O unit contains 3 atoms, so multiply to count every atom

    1.204428e+24×3=3.613284e+24

Test yourself

20 quick questions built from this calculator's formula: work out results, predict what happens when an input changes, and work backward from an answer. Every answer comes with the working.

What this calculator does

Turn a weight in grams into moles or a count of particles, and back again. Chemists count tiny particles by weighing them. A mole is exactly 6.02214076 × 10²³ particles, much like a dozen means 12. The molar mass of a substance tells you how many grams one mole of it weighs. With those two numbers, you can move between the mass on a scale, the amount in moles and the actual number of molecules, atoms or ions.

Start from whatever you know. The calculator works out the molar mass from a chemical formula, or uses one you type in. Then it gives you all three amounts together. When you give it a formula, it also counts the total number of atoms. That's usually what a moles-to-atoms question is asking for.

Where it's used

Why this math matters outside the classroom:

  • Water molecules. Chemistry students weighing 18 g of water find 18 ÷ 18.02 ≈ 1 mole, about 6.02 × 10²³ molecules.
  • Mixing reactants. Lab technicians convert the grams on a balance to moles so reactants can be mixed in the ratio a balanced equation calls for.
  • Table salt. A 5.85 g sample of sodium chloride, molar mass 58.44 g/mol, holds about 0.1 mol of the salt.
  • Fuel burning. Engineers find 1 kg of methane is about 62 moles, which tells them how much oxygen it needs to burn.

How to use it

  1. Choose what you know: a mass, an amount in moles or a number of particles.
  2. Choose how to get the molar mass. Type a formula such as H2O or NaCl, or switch to typing the molar mass yourself in g/mol (grams per mole).
  3. Enter your value. Masses can be in milligrams, grams or kilograms. Particle counts accept scientific notation, such as 3.5e22.
  4. Read the converted values and the steps. The answer for the direction you chose comes first.

What the inputs mean

Chemical formula
Element symbols need the right capital letters. Brackets work, and so do hydrates (crystals with water built in) such as CuSO4·5H2O.
Number of particles
A particle is whatever one copy of the formula describes. That's a molecule for H2O, a formula unit (the smallest repeating group) for NaCl, and an atom for a single element such as Fe.

Formula and method

n = m ÷ M
m = n × M
N = n × N_A
n = N ÷ N_A
N_A = 6.02214076 × 10²³ mol⁻¹ (exact)

Here m is the mass in grams and M is the molar mass in grams per mole. The letter n is the amount in moles, and N is the number of particles. N_A is Avogadro's constant, the number of particles in one mole. Dividing grams by grams per mole leaves moles. Multiplying moles by Avogadro's constant leaves a plain count.

Since the 2019 update to the metric system (the SI), Avogadro's constant has been set as an exact number. So any uncertainty in these conversions comes only from your measurement and from the atomic weights used for the molar mass.

Worked example

How many moles and molecules are in 11 g of carbon dioxide, CO2?

  1. Molar mass of CO2: 1 × 12.011 + 2 × 15.999 = 44.009 g/mol.
  2. Moles: n = 11 g ÷ 44.009 g/mol = 0.249949 mol.
  3. Molecules: N = 0.249949 × 6.02214076 × 10²³ ≈ 1.5052 × 10²³.
  4. Each CO2 molecule has 3 atoms, so the sample holds about 4.5157 × 10²³ atoms.

Result: 11 g of CO2 is 0.2499 mol. That's about 1.5052 × 10²³ molecules, or 4.5157 × 10²³ atoms.

Understanding the result

A mole is a counting unit, just like a dozen. Saying a flask holds 0.25 mol of CO2 means it holds a quarter of Avogadro's number of molecules, whatever they weigh.

Balanced chemical equations are written in moles. So in a stoichiometry problem (working out amounts in a reaction), turning grams into moles is usually the first step. Turning moles back into grams is usually the last.

Assumptions and limitations

  • Molar masses worked out from a formula use the IUPAC short-form standard atomic weights. These are the official averages for elements as they're found in nature.
  • Particles are counted per formula unit as written: one NaCl unit, one H2O molecule or one Fe atom.
  • The total-atoms figure counts every atom in each formula unit. It isn't the number of atoms of one particular element. For that, multiply the particle count by the small number written after that element.
  • Results are only as precise as the mass you measured and the molar mass used. Extra decimal places in the answer don't make it more accurate.
  • For gases measured by volume, first turn the volume into moles (for example, with the ideal gas law). Then use this calculator.

Frequently asked questions

How do I convert grams to moles?

Divide the mass in grams by the molar mass in g/mol. For example, 36.03 g of water divided by 18.015 g/mol is exactly 2 mol.

How do I convert moles to atoms?

First multiply moles by Avogadro's constant to get the number of formula units. Then multiply by the number of atoms in one formula unit. One mole of water is 6.022 × 10²³ molecules. But it's about 1.807 × 10²⁴ atoms, because each molecule has three.

Is Avogadro's number exact?

Yes, since May 2019. The metric system now sets the Avogadro constant at exactly 6.02214076 × 10²³ per mole. Before that, the mole was based on the number of atoms in 12 g of carbon-12.

What is the difference between a mole and molar mass?

A mole is an amount: a fixed count of particles. Molar mass belongs to a substance: it's how many grams one mole of it weighs. One mole of hydrogen gas and one mole of gold hold the same number of particles. But they weigh about 2 g and 197 g.

How this calculator is checked

Method: Definition of the mole and the exact SI Avogadro constant (2019); n = m/M. The calculation is covered by automated tests with known reference values and edge cases. Last updated 2026-10-18. Found a problem? Tell us.

Embed this calculator

Put this Grams to Moles Calculator on your own website or blog for free. Paste this code where you want it to appear: