Grams to Moles Calculator

Whether you're in a general chemistry class or brushing up on lab skills, converting grams to moles is one of those calculations you'll run into constantly. This calculator does the heavy lifting for you: plug in the mass of your substance and its molar mass, and you'll get the number of moles in seconds. Not sure what molar mass to use, or how the math works behind the scenes? The sections below walk through everything you need, from the basic formula to worked examples with real compounds.

Enter Details

Water (H₂O) ≈ 18.015 g/mol. Use the substance’s molar mass.

Result

Enter grams and molar mass to estimate moles.

Moles = mass ÷ molar mass. Molar mass depends on the chemical formula.

How to Convert Grams to Moles

Converting grams to moles comes down to one piece of information: the molar mass of the substance you're working with. Once you have that number (in grams per mole), you divide your sample's mass by it. That's it.

The reason this works is that a mole is just a counting unit, like a dozen but for atoms and molecules. One mole of any substance contains about 6.022 × 10²³ particles. The molar mass tells you how many grams that collection of particles weighs, and dividing your sample by that weight tells you how many of those collections you have.

A few things to keep in mind before you start:

  • Make sure your mass is in grams. If you have kilograms or milligrams, convert first.
  • Use the molar mass in g/mol, which you can pull from the periodic table or calculate for compounds.
  • The answer will be in moles (mol).

Grams to Moles Formula (moles = grams ÷ molar mass)

The formula is straightforward:

moles = grams ÷ molar mass

Or written with symbols: n = m / M, where n is the number of moles, m is the mass in grams, and M is the molar mass in g/mol.

Say you have 36 grams of water (H₂O), which has a molar mass of 18 g/mol. Divide 36 by 18 and you get 2 moles. Simple enough. The formula stays the same no matter how complex the compound gets; the only thing that changes is the molar mass you plug in.

You can also rearrange this formula when you need to solve for something else. Need the mass instead? Multiply moles by molar mass: m = n × M. Need the molar mass of an unknown? Divide the known mass by the known number of moles: M = m / n.

What Is Molar Mass?

Molar mass is the mass of one mole of a substance, expressed in grams per mole (g/mol). Think of it as the substance's "weight per batch" when the batch size is one mole.

For elements, the molar mass is numerically equal to the atomic mass listed on the periodic table. Carbon has an atomic mass of about 12.011 amu, so its molar mass is 12.011 g/mol. Iron is 55.845 g/mol. Oxygen is 15.999 g/mol. You just read it straight off the periodic table.

For compounds, you add up the molar masses of every atom in the chemical formula. More on exactly how to do that in the next section, but the concept is the same: total atomic masses of all the atoms present equals the molar mass of the compound.

Molar mass is sometimes called molecular weight or formula weight, depending on the context. Those terms mean essentially the same thing for most purposes in a general chemistry course.

How to Find Molar Mass of a Substance

Finding molar mass is a matter of reading the periodic table and doing a bit of arithmetic. Here's the process:

  1. Write out the chemical formula of your substance (for example, NaCl, CO₂, or C₆H₁₂O₆).
  2. Identify each element and how many atoms of it appear in the formula.
  3. Look up the atomic mass of each element on the periodic table.
  4. Multiply each atomic mass by the number of atoms of that element.
  5. Add up all the results to get the total molar mass.

Let's use carbon dioxide (CO₂) as a quick example. Carbon has an atomic mass of 12.011 g/mol and there's one carbon atom. Oxygen is 15.999 g/mol and there are two oxygen atoms, so that's 2 × 15.999 = 31.998. Add them together: 12.011 + 31.998 = 44.009 g/mol.

For more complex molecules like glucose (C₆H₁₂O₆), just repeat that process for each element: 6 carbons, 12 hydrogens, 6 oxygens. Add everything up and you'll land at about 180.16 g/mol. A periodic table and a calculator are all you need.

Stoichiometry and Chemical Reaction Calculations

Stoichiometry is basically the math of chemical reactions: figuring out how much of each substance is consumed or produced. Moles are the currency of stoichiometry, which is exactly why grams-to-moles conversions show up so often in this context.

A balanced chemical equation gives you mole ratios between reactants and products. If the equation says 2 H₂ + O₂ → 2 H₂O, that tells you 2 moles of hydrogen react with 1 mole of oxygen to produce 2 moles of water. Those ratios hold at any scale, as long as you're working in moles.

In practice, you almost never start with a number of moles. You start with a mass you measured on a balance. So the typical workflow is:

  • Convert your starting mass from grams to moles.
  • Use the mole ratio from the balanced equation to find the moles of the target substance.
  • Convert back to grams if needed.

Every step in that chain depends on accurate molar masses and clean unit tracking. Get those right and stoichiometry problems become a lot more manageable.

Common Grams to Moles Examples

Seeing the formula in action a few times makes it click faster than any explanation. Here are some worked examples with compounds that come up frequently in chemistry courses.

SubstanceMass (g)Molar Mass (g/mol)Moles
Water (H₂O)1818.015≈ 1.00
Sodium chloride (NaCl)58.4458.441.00
Carbon dioxide (CO₂)2244.009≈ 0.50
Glucose (C₆H₁₂O₆)90180.16≈ 0.50
Calcium carbonate (CaCO₃)50100.09≈ 0.50

Notice that 1 mole of NaCl weighs almost exactly 58.44 grams, so it's a handy mental benchmark. For water, 18 grams is one mole, which also maps neatly to 18 mL of liquid water (since water's density is about 1 g/mL). These shortcuts are worth remembering for quick sanity checks in the lab.

Units Used in Chemistry Calculations

Chemistry calculations live or die by proper unit tracking. A number without a unit is just a number; it doesn't tell you anything useful on its own.

Here are the key units you'll work with when converting grams to moles:

  • Grams (g): the unit of mass for your sample. Convert milligrams (mg) or kilograms (kg) to grams before plugging into the formula.
  • Moles (mol): the unit of amount of substance. This is what you're solving for.
  • Grams per mole (g/mol): the unit for molar mass. It's what connects mass to moles.
  • Atomic mass units (amu or u): used on the periodic table; numerically equal to g/mol for molar mass purposes.

When you do the division (grams ÷ g/mol), the grams cancel and you're left with mol. That unit cancellation is a reliable way to check that you've set up the problem correctly. If your units don't cancel down to what you're solving for, something's off in the setup.

Step-by-Step Conversion Method

If you want a reliable process you can follow every time, here it is laid out cleanly:

  1. Identify your substance and write down its chemical formula.
  2. Find the molar mass by adding up the atomic masses of every atom in the formula using a periodic table.
  3. Record the mass of your sample in grams. Convert from other units if necessary.
  4. Divide the sample mass by the molar mass: moles = grams ÷ g/mol.
  5. Label your answer in moles and double-check that the units canceled correctly.

That's the whole process. The steps don't change based on how simple or complicated the substance is. Sodium metal or a large organic molecule, same five steps.

One practical tip: carry a few extra decimal places during intermediate steps and round only at the end. Rounding too early can introduce small errors that add up, especially in multi-step stoichiometry problems where you're using one answer to calculate the next.

Other Conversion Calculators

Explore all