How to Convert Moles to Grams (and Grams to Moles) with Molar Mass
By Dr. Zubair Khalid, DVM, MS, PhD ·

Converting between moles and grams is the most common arithmetic you will do at the bench. A balance reads mass, a reaction runs on particle counts, and molar mass is the bridge between the two. Get this conversion right and stoichiometry, solution prep, and yield calculations all become routine.
The method itself is one multiplication or one division. The errors come from the molar mass you plug in, the units you forget to convert, and the rounding you do too early. This guide covers the formulas, a full hydrate example, and the mistakes that show up most often in lab reports.
Quick Answer
- To convert moles to grams: multiply the amount in moles by the molar mass. $m = n \times M$
- To convert grams to moles: divide the mass in grams by the molar mass. $n = \frac{m}{M}$
- Symbols: $n$ is amount of substance in mol, $m$ is mass in g, $M$ is molar mass in g/mol.
- Molar mass of a compound is the sum of (number of atoms $\times$ standard atomic weight) for every element in the formula, expressed in g/mol.
- To count particles, multiply moles by the Avogadro constant: $N = n \times N_A$, where $N_A = 6.02214076 \times 10^{23}\ \text{mol}^{-1}$ exactly [1][4].
What the Mole Actually Is
The mole is the SI unit for amount of substance. Since the 2019 revision of the SI, it is defined by fixing the Avogadro constant at exactly $6.02214076 \times 10^{23}\ \text{mol}^{-1}$ [1][3][4]. One mole contains exactly that many elementary entities, whether those entities are atoms, molecules, ions, or formula units. IUPAC recommended this number-based definition in 2017 [2].
That definition matters for one practical reason: the mole is no longer tied to the mass of carbon-12. It is a pure count. The link between moles and grams now runs entirely through molar mass, which is why the accuracy of your molar mass sets the accuracy of your answer.
Molar Mass Calculation
Molar mass is the mass of one mole of a substance, in g/mol. For a compound, you add up the standard atomic weights of every atom in the formula [5][6].
Take ammonium sulfate, $(\text{NH}_4)_2\text{SO}_4$. The parentheses multiplier applies to everything inside them:
| Element | Count | Standard atomic weight (g/mol) | Contribution (g/mol) |
|---|---|---|---|
| N | 2 | 14.007 | 28.014 |
| H | 8 | 1.008 | 8.064 |
| S | 1 | 32.06 | 32.06 |
| O | 4 | 15.999 | 63.996 |
| Total | 132.134 |
So $M = 132.14\ \text{g/mol}$ for $(\text{NH}_4)_2\text{SO}_4$.
A note on the weights themselves. Some elements, including hydrogen, carbon, nitrogen, and oxygen, have standard atomic weights published as intervals because isotopic composition varies in natural samples. For everyday calculations, IUPAC provides conventional single values such as H 1.008, C 12.011, N 14.007, and O 15.999 [6][7]. Use those single values unless your work requires the interval, for example in isotope-sensitive metrology.
How to Convert Moles to Grams
The relation is direct:
$$m = n \times M$$
If you have 0.25 mol of sodium chloride and the molar mass of NaCl is 58.44 g/mol:
$$m = 0.25\ \text{mol} \times 58.44\ \text{g/mol} = 14.61\ \text{g}$$
The mol units cancel, leaving grams. That unit check is the fastest way to catch an inverted formula. If your answer comes out in mol²/g or some other nonsense, you divided when you should have multiplied.
How to Convert Grams to Moles
Rearrange the same relation:
$$n = \frac{m}{M}$$
Weigh 12.5 g of copper(II) sulfate pentahydrate and you want the amount in moles. First you need the molar mass of the hydrate, not the anhydrous salt. For $\text{CuSO}_4 \cdot 5\text{H}_2\text{O}$:
$$M = 63.546 + 32.06 + 9 \times 15.999 + 10 \times 1.008 = 249.677\ \text{g/mol}$$
Then:
$$n = \frac{12.5\ \text{g}}{249.677\ \text{g/mol}} = 0.05006\ \text{mol}$$
If you also need the particle count:
$$N = 0.05006\ \text{mol} \times 6.02214076 \times 10^{23}\ \text{mol}^{-1} = 3.015 \times 10^{22}\ \text{formula units}$$
Note the wording: formula units, not molecules. An ionic solid like $\text{CuSO}_4 \cdot 5\text{H}_2\text{O}$ does not contain discrete $\text{CuSO}_4$ molecules, so the counted entity is the formula unit.
Worked Example: Hydrate Versus Anhydrous Salt
This is the example that separates a correct answer from one that is off by more than half.
You weigh 12.5 g of $\text{CuSO}_4 \cdot 5\text{H}_2\text{O}$ and calculate moles using the anhydrous molar mass of $\text{CuSO}_4$, which is 159.60 g/mol:
$$n = \frac{12.5\ \text{g}}{159.60\ \text{g/mol}} = 0.07832\ \text{mol}$$
Compare that with the correct value of 0.05006 mol. The anhydrous route overstates the moles by 56%. The water of crystallization is part of the mass you weighed, so it must be part of the molar mass you divide by.
The same logic applies in reverse. If a procedure says "dissolve 0.0500 mol of $\text{CuSO}_4 \cdot 5\text{H}_2\text{O}$," you need:
$$m = 0.0500\ \text{mol} \times 249.677\ \text{g/mol} = 12.48\ \text{g}$$
Working from the anhydrous molar mass would give 7.98 g, and weighing that much of the pentahydrate delivers only 0.0320 mol, about 36% less copper than the procedure asks for.
Worked Example: Making a Solution
Mass, moles, and molarity connect through one chain. To prepare 500 mL of 0.100 M glucose ($\text{C}_6\text{H}_{12}\text{O}_6$, $M = 180.156\ \text{g/mol}$), start with the definition of molarity:
$$n = c \times V$$
where $c$ is concentration in mol/L and $V$ is volume in liters. Convert the volume first:
$$V = 500\ \text{mL} = 0.500\ \text{L}$$
$$n = 0.100\ \text{mol/L} \times 0.500\ \text{L} = 0.0500\ \text{mol}$$
Then convert moles to grams:
$$m = 0.0500\ \text{mol} \times 180.156\ \text{g/mol} = 9.008\ \text{g}$$
So you weigh 9.008 g of glucose, dissolve it, and dilute to 500 mL final volume. The combined formula is:
$$\text{mass} = \text{molarity} \times \text{volume in L} \times \text{molar mass}$$
If you are doing this repeatedly with different compounds, a moles to grams calculator will handle the arithmetic while you focus on the weighing. For solution work specifically, the dilution calculator covers the concentration side.
Significant Figures and Rounding
Carry the full molar mass through the calculation, then round at the end. The final answer should have no more significant figures than the least precise measured input. A typical balance reading of 12.5 g has three significant figures, so 0.05006 mol rounds to 0.0501 mol.
Molar masses are known far more precisely than a balance reading, so they almost never limit your significant figures. The measured mass or volume does. Rounding the molar mass to two decimal places before you divide introduces error that has nothing to do with your measurement quality.
Common Mistakes
- Using the anhydrous molar mass for a hydrate. The water is part of the weighed mass. Add it to the formula before you calculate $M$. In the $\text{CuSO}_4 \cdot 5\text{H}_2\text{O}$ case, this error inflates moles by 56%.
- Using atomic number instead of atomic weight. Copper is element 29, but its standard atomic weight is 63.546 g/mol. The atomic number tells you nothing about mass.
- Ignoring parentheses multipliers. In $(\text{NH}_4)_2\text{SO}_4$, the subscript 2 multiplies both N and H. Miss it and your molar mass is wrong by roughly 18 g/mol.
- Rounding molar mass too early. Keep the full value in your calculator and round only the final answer.
- Mixing mg with g or mL with L. Convert to grams and liters before you substitute into any formula. A 500 mL volume is 0.500 L, not 500 L.
- Reporting "molecules" for an ionic compound. Use formula units for ionic solids and hydrates.
Limitations
The mole-to-mass conversion assumes you know the identity and purity of your substance. If your sample is a mixture, a wet solid, or a partially degraded protein, the calculated moles describe the nominal formula, not what is actually in the vial.
For polymers, DNA, and proteins, molar mass is usually estimated from sequence or from a standard curve, not from an elemental formula. A common rule of thumb for double-stranded DNA is about 650 g/mol per base pair, used for copy number estimates. That is an average, not a precise molar mass, and it should be reported as an estimate.
Standard atomic weights themselves carry uncertainty. For elements with variable isotopic composition, the single conventional value is a representative number, not a fixed constant [7]. For most bench work the difference is negligible. For high-accuracy metrology, use the interval or an isotope-specific value.
Finally, the conversion says nothing about reactivity, solubility, or whether your reaction will proceed. It converts units. The chemistry is still on you.
Frequently Asked Questions
What is the formula to convert moles to grams?
Multiply the amount in moles by the molar mass in g/mol: $m = n \times M$. For 0.25 mol NaCl with $M = 58.44\ \text{g/mol}$, the mass is 14.61 g. The mol units cancel and you are left with grams.
How do I convert grams to moles?
Divide the mass in grams by the molar mass: $n = m / M$. Make sure the mass is in grams and the molar mass is in g/mol before you divide. If your balance reads milligrams, convert to grams first.
How do I calculate molar mass for a hydrate?
Add the water of crystallization to the formula and include it in the sum. For $\text{CuSO}_4 \cdot 5\text{H}_2\text{O}$, the molar mass is $63.546 + 32.06 + 9 \times 15.999 + 10 \times 1.008 = 249.677\ \text{g/mol}$. Using the anhydrous value of 159.60 g/mol would overstate the moles by 56%.
How many particles are in one mole?
Exactly $6.02214076 \times 10^{23}$ elementary entities, by definition of the SI mole since 2019 [1][4]. Multiply the amount in moles by the Avogadro constant to get the particle count: $N = n \times N_A$. The entities can be atoms, molecules, ions, or formula units.
Why did my moles-to-grams answer come out wrong?
Check three things in order: whether you used the right molar mass (hydrate versus anhydrous), whether your mass is in grams and your volume in liters, and whether you rounded the molar mass before the final step. Unit cancellation is the fastest diagnostic. If the units do not resolve to grams or moles, the formula is inverted.
References
- NIST: Redefining the Mole
- Marquardt R, Meija J, Mester Z, et al. Definition of the mole (IUPAC Recommendation 2017). Pure and Applied Chemistry, 2018
- Tiesinga E, Mohr PJ, Newell DB, Taylor BN. CODATA recommended values of the fundamental physical constants: 2018. Reviews of Modern Physics, 2021
- NIST CODATA value: Avogadro constant
- Prohaska T, Irrgeher J, Benefield J, et al. Standard atomic weights of the elements 2021 (IUPAC Technical Report). Pure and Applied Chemistry, 2022
- CIAAW: Standard Atomic Weights
- van der Veen AMH, Meija J, Possolo A, Hibbert DB. Interpretation and use of standard atomic weights (IUPAC Technical Report). Pure and Applied Chemistry, 2021