Grams to Moles Converter
To convert grams to moles, divide mass by the substance's molar mass: n = m / M. To convert moles to grams, multiply moles by molar mass: m = n x M. The calculator above works both ways: enter the molar mass plus either mass or moles, leave the other field blank, and it computes the missing value instantly.
Why Chemists Count in Moles, Not Just Mass
A single reaction flask can hold more atoms than there are stars in the observable universe, so no chemist counts particles one at a time. Instead, chemistry needs a fixed counting unit, the same way a bakery counts eggs by the dozen instead of one by one. The mole is that unit: one mole of any substance always contains the same fixed number of particles, whether those particles are atoms, ions, or molecules. Because a lab balance reads mass in grams, not particle count, chemists needed a bridge between the two. Molar mass is that bridge. It tells you how many grams correspond to one mole of a given substance, so a balance reading can stand in for a count of atoms or molecules without anyone having to see or count a single one.
Avogadro's Number
One mole is defined as 6.022 x 10^23 particles of a substance. This value, known as Avogadro's number, is fixed regardless of what the substance is: one mole of iron atoms, one mole of water molecules, and one mole of sodium ions each contain exactly 6.022 x 10^23 particles. What differs between substances is how much one mole weighs, since atoms and molecules have different masses. That per-substance weight is the molar mass, expressed in grams per mole (g/mol). Avogadro's number connects a particle count to the mole unit; molar mass connects the mole unit to a mass you can measure on a balance.
Grams to Moles: n = m / M
To find how many moles are in a known mass of a substance, divide the mass by the molar mass:
n = m / M
where n is amount in moles, m is mass in grams, and M is molar mass in grams per mole. The molar mass has to be worked out from the substance's chemical formula first; if you need help building that number from a formula, the molar mass calculator walks through adding up atomic masses for any formula. Once you have M, plug it into this converter alongside the mass, leave the moles field blank, and the amount in moles is computed automatically.
Moles to Grams: m = n x M
The same relationship runs in reverse when you already know an amount in moles and need a mass, which is common when a recipe or a stoichiometric calculation gives you moles but a balance only reads grams:
m = n x M
Here m is the mass you're solving for, n is the known amount in moles, and M is molar mass again. Multiply moles by molar mass and the result is a mass in grams. In the calculator above, enter the molar mass and the amount in moles, leave the mass field blank, and the mass fills in on its own.
Worked Example 1: Grams to Moles (Sodium Chloride)
How many moles are in 9.00 g of NaCl, given a molar mass of 58.44 g/mol?
- n = m / M
- n = 9.00 g / 58.44 g/mol
- n = 0.154 mol
Rounded to three significant figures to match the 9.00 g input, 9.00 g of NaCl is 0.154 mol.
Worked Example 2: Moles to Grams (Glucose)
What mass corresponds to 0.250 mol of glucose, C6H12O6, given a molar mass of 180.16 g/mol?
- m = n x M
- m = 0.250 mol x 180.16 g/mol
- m = 45.0 g
0.250 mol of glucose weighs 45.0 g. Rounding follows the 0.250 mol input, which carries three significant figures.
Worked Example 3: Bridging a Percent Yield Calculation
Suppose a lab isolates 3.50 g of anhydrous sodium sulfate (Na2SO4, molar mass 142.04 g/mol) and needs to compare it against a theoretical yield that was calculated in moles from a balanced equation. The masses can't be compared directly to a mole figure, so the actual product mass has to be converted first:
- n = m / M
- n = 3.50 g / 142.04 g/mol
- n = 0.0246 mol
That 0.0246 mol of actual product can now be set against a theoretical amount that is also in moles, or converted onward to a percent yield once both quantities share the same unit. Mixing grams and moles without converting is one of the most common percent yield errors; the percent yield overview covers why that mismatch happens and how it distorts a result. For the stoichiometry that produces the theoretical mole figure in the first place, see the stoichiometry calculator and the theoretical yield calculator.
Quick Reference: 1.00 g Converted to Moles
| Substance | Molar mass (g/mol) | Moles in 1.00 g |
|---|---|---|
| Water (H2O) | 18.02 | 0.0555 mol |
| Sodium chloride (NaCl) | 58.44 | 0.0171 mol |
| Carbon dioxide (CO2) | 44.01 | 0.0227 mol |
Avogadro's number, 6.022 x 10^23 particles per mole, is the same for every row; only the molar mass changes, which is why the same 1.00 g sample converts to a different number of moles for each substance.
Using the Two-Way Converter
The calculator above accepts a molar mass plus either a mass or an amount in moles, never both at once. Fill in molar mass and a mass, leave the moles field blank, and it solves n = m / M for you. Fill in molar mass and an amount in moles instead, leave the mass field blank, and it solves m = n x M. The mass field also carries a unit dropdown for milligrams, grams, or kilograms, so a reading straight off a balance in any of those units can be entered without converting it by hand first.
Frequently asked questions
How do you convert grams to moles?
Divide the mass in grams by the substance's molar mass in g/mol: n = m / M. For example, 9.00 g of NaCl divided by its molar mass of 58.44 g/mol gives 0.154 mol. The molar mass has to be worked out from the chemical formula first; the calculator above does the division automatically once mass and molar mass are entered.
How do you convert moles to grams?
Multiply the amount in moles by the substance's molar mass in g/mol: m = n x M. For example, 0.250 mol of glucose multiplied by its molar mass of 180.16 g/mol gives 45.0 g. Enter the moles and molar mass into the calculator above and leave the mass field blank to get this result directly.
What is Avogadro's number?
Avogadro's number is 6.022 x 10^23, the fixed number of particles contained in one mole of any substance. It applies equally to atoms, ions, and molecules: one mole of NaCl and one mole of glucose each contain that same particle count, even though the two samples have very different masses because their molar masses differ.
Why do chemists use moles instead of just mass?
Chemists use moles because chemical reactions happen between individual particles in fixed whole-number ratios, not fixed masses, and atoms are far too small and numerous to count or weigh one at a time. The mole gives a fixed particle count that a lab balance can stand in for through molar mass, letting a gram reading represent a specific number of atoms or molecules.
What happens if I mix up mass and moles in a yield calculation?
Mixing mass and moles produces a meaningless ratio, since percent yield compares two quantities in matching units, either both mass or both moles. Dividing a mass in grams by an amount in moles, or the reverse, gives a number that isn't a valid yield percentage. The <a href="/">percent yield page</a> explains this mismatch in detail; converting one side with n = m / M or m = n x M before comparing fixes it.
Does this conversion need a balanced equation?
No. Converting grams to moles for a single substance only needs that substance's molar mass, not a reaction or balanced equation. A balanced equation only becomes necessary once you compare moles of one substance to moles of another, a separate step covered by <a href="/stoichiometry/">the stoichiometry calculator</a> and <a href="/mole-ratio/">the mole ratio calculator</a>.
What units does molar mass need to be in?
Molar mass needs to be in grams per mole (g/mol) for the n = m / M and m = n x M formulas to give correct results. This is the standard unit for molar mass on the periodic table and in most textbook problems. If you need to build a molar mass value from a chemical formula first, <a href="/molar-mass/">the molar mass calculator</a> covers that step.
Can this converter go both directions?
Yes. Enter the molar mass plus either a mass or an amount in moles, and leave the other field blank; the calculator detects which value is missing and solves for it. Leave mass blank to compute moles from a known mass, or leave moles blank to compute the mass corresponding to a known amount in moles.
How many significant figures should a mole conversion keep?
Keep the same number of significant figures as the least precise measurement going into the calculation, which is usually the mass or mole amount you started with rather than a periodic-table molar mass. In the worked NaCl example, 9.00 g has three significant figures, so the answer, 0.154 mol, is also reported to three significant figures.
What if my molar mass is wrong, how does that affect the mole count?
An incorrect molar mass produces a proportionally incorrect mole count, since moles are calculated by dividing mass by molar mass. A molar mass that is too high understates the moles present; one that is too low overstates them. Double-checking the formula and atomic masses behind a molar mass value, as shown on <a href="/molar-mass/">the molar mass calculator</a>, prevents this error from carrying through a whole calculation.