Grams to Moles Calculator

Converting grams to moles is one of the most common steps in chemistry, and it rests on a single idea: the mole is the unit that counts particles by weighing them. Every substance has a molar mass, the mass of one mole in grams per mole, and once you know it the conversion is a simple division. Divide the mass of your sample by the molar mass and you get the amount of substance in moles, ready to use in a reaction equation, a concentration, or a yield calculation. This calculator takes a mass in grams and a molar mass in grams per mole, then returns the number of moles along with a quick check of the relation. The default values use water, which has a molar mass of about 18.015 grams per mole, so a 36.03 gram sample returns exactly 2.00 moles. You supply the molar mass because it depends on the exact formula of your substance, and the National Institute of Standards and Technology publishes the atomic weights you need to build it. Every figure here is computed deterministically from the standard mole relation shown below, with a worked example that reconciles exactly to the calculator so you can follow each step.

Grams to moles divides the sample mass by the molar mass: moles = mass / molar mass. A 36.03 g sample of water (molar mass 18.015 g/mol) contains 2.00 mol. Reverse the relation to convert moles back to grams.

Source: US National Institute of Standards and Technology (NIST). As at 25 June 2026.

Mass of your sample in grams
Grams per mole for the substance
Sample mass--
Molar mass--
Amount of substance--

Grams to moles formula

n = m / M
n = amount of substance (moles)
m = mass of the sample (grams)
M = molar mass of the substance (grams per mole)

The molar mass acts as the conversion factor between mass and amount. Dividing a mass in grams by a molar mass in grams per mole cancels the grams and leaves moles. To go the other way, multiply moles by molar mass to recover the mass in grams.

Worked example

You have 36.03 grams of water. Water has a molar mass of 18.015 grams per mole.

  1. Identify the molar mass: M = 18.015 g/mol
  2. Divide mass by molar mass: n = 36.03 / 18.015
  3. n = 2.00 mol

The sample contains 2.00 moles. These are the calculator's default inputs, so the result above matches the widget exactly.

Molar masses of common substances

Approximate molar masses you can use as a starting point. Always confirm against current atomic weights for precise work.

Substance Formula Molar mass (g/mol)
WaterH2O18.015
Carbon dioxideCO244.009
Sodium chlorideNaCl58.443
GlucoseC6H12O6180.156
Oxygen gasO231.998

Atomic weights and physical reference data: US National Institute of Standards and Technology (NIST).

Grams to moles calculator: frequently asked questions

How do you convert grams to moles?

Divide the mass of the sample in grams by the molar mass of the substance in grams per mole. The result is the amount of substance in moles. For example, 36.03 grams of water divided by a molar mass of 18.015 grams per mole gives 2.00 moles. The mole is the SI base unit for the amount of a substance.

What is molar mass and where do I find it?

Molar mass is the mass of one mole of a substance, expressed in grams per mole. For an element it equals the atomic weight from the periodic table; for a compound you sum the atomic weights of every atom in the formula. The National Institute of Standards and Technology publishes atomic weights and physical reference data you can use to build a molar mass.

What is the molar mass of water?

Water is H2O, so its molar mass is two hydrogen atoms (about 1.008 grams per mole each) plus one oxygen atom (about 15.999 grams per mole), which totals roughly 18.015 grams per mole. The calculator uses this value as its default, so 36.03 grams of water returns exactly 2.00 moles.

Is one mole the same as Avogadro's number?

One mole contains exactly 6.02214076 times ten to the twenty-third elementary entities, which is the defined value of the Avogadro constant. Converting grams to moles tells you how many moles you have; multiplying that by the Avogadro constant tells you the number of individual atoms or molecules in the sample.

How do I go from moles back to grams?

Multiply the number of moles by the molar mass. If you have 2.00 moles of water and the molar mass is 18.015 grams per mole, the mass is 2.00 times 18.015, which equals 36.03 grams. Grams to moles and moles to grams are simply the same relation rearranged.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 25 June 2026. See our methodology. This is general information, not financial, tax, legal or investment advice.