To convert grams to moles, divide the mass in grams by the molar mass of the substance (in grams per mole). For example, 2.922 g of sodium chloride (NaCl, molar mass 58.44 g/mol) equals 0.05000 mol. This page walks through the calculation with a working calculator, a worked example, and the reasoning behind each step.
Formula
The core conversion is:
moles = mass (g) ÷ molar mass (g/mol)
where:
- mass is the amount of substance you have, in grams (g).
- molar mass is the mass of one mole of the substance, in grams per mole (g/mol). Numerically it equals the atomic or molecular weight expressed in grams.
- moles is the amount of substance, in moles (mol).
The calculator above also converts moles to molarity when you supply a solution volume. Molarity (mol/L) is defined as:
molarity = moles ÷ volume in liters
Since the volume is entered in milliliters, the expression divides by (v / 1000) to convert mL to L.
Worked Example
Take the default values from the calculator: 2.922 g of NaCl, molar mass 58.44 g/mol, dissolved in 250 mL of water.
Step 1: Convert grams to moles.
moles = 2.922 g ÷ 58.44 g/mol = 0.05000 mol
Step 2: Convert the volume to liters.
250 mL ÷ 1000 = 0.250 L
Step 3: Calculate molarity.
molarity = 0.05000 mol ÷ 0.250 L = 0.2000 mol/L
Step 4: Convert to millimolar.
0.2000 mol/L × 1000 = 200.0 mM
The calculator returns 0.2000 mol/L and 200.00 mM, matching these steps.
Assumptions
- The substance is pure and dry; impurities change the effective mass.
- The molar mass is the formula weight of the exact chemical form (e.g., anhydrous NaCl, not NaCl·H₂O).
- For molarity, the final solution volume is used — not the volume of solvent added. This is the standard convention.
- Dissolution is complete and the solution is homogeneous.
- Temperature and pressure do not affect molarity (they affect gas volumes, not masses or moles).
Where the Molar Mass Comes From
Molar mass is the sum of the atomic weights of all atoms in the chemical formula. For NaCl:
- Sodium (Na): 22.990 g/mol
- Chlorine (Cl): 35.45 g/mol
- Total: 22.990 + 35.45 = 58.44 g/mol
These are IUPAC abridged standard atomic weights. For a hydrated salt like CuSO₄·5H₂O, you must include the water molecules in the formula mass: one copper (63.546), one sulfur (32.06), nine oxygens (9 × 15.999), and ten hydrogens (10 × 1.008) add up to about 249.69 g/mol. Using the anhydrous mass (159.61 g/mol) for a hydrated compound would undercount moles by roughly 36%.
Common Mistakes and How to Avoid Them
Mixing up grams and moles in the formula. The most frequent error is multiplying instead of dividing. If you have 10 g of a substance with molar mass 50 g/mol, you have 0.2 mol, not 500 mol. Check that your answer is a reasonable number: a few grams of a typical salt gives a few hundredths to a few tenths of a mole.
Forgetting to convert mL to L. Molarity is moles per liter. If you plug in 250 mL directly without dividing by 1000, you get a molarity that is 4 times too large for the default example. Always convert volume to liters first.
Using the wrong molar mass. Sodium chloride is 58.44 g/mol, but sodium carbonate is 105.99 g/mol and sodium bicarbonate is 84.01 g/mol. Read the formula on the bottle carefully. Hydrates are a common trap — the mass of water is real and must be counted.
Rounding too early. If you round the molar mass to 58 g/mol, you introduce about 0.8% error. For precise lab work, keep at least four significant figures until the final step.
Why This Conversion Matters
Grams are what you weigh on a balance, but chemical reactions happen between particles — atoms, molecules, or formula units. The mole is the bridge between the macroscopic world of the balance and the microscopic world of particles. One mole always contains 6.02214076 × 1023 particles (Avogadro’s constant).
In practice, you use this conversion whenever you need to:
- Prepare a solution of known molarity from a solid reagent.
- Calculate how much of a reactant you need for a stoichiometric reaction.
- Convert a measured mass of a product into moles to find percent yield.
- Determine the empirical formula from elemental analysis masses.
For example, to make 500 mL of 0.1 M KCl (molar mass 74.55 g/mol), you need 0.1 mol/L × 0.5 L = 0.05 mol, which is 0.05 × 74.55 = 3.7275 g. Weigh that mass, dissolve it, and bring the total volume to 500 mL.
When to Use Moles Instead of Grams
Chemical equations are balanced in moles, not grams. The equation 2H₂ + O₂ → 2H₂O says that 2 moles of hydrogen react with 1 mole of oxygen to give 2 moles of water. It does not say 2 g of hydrogen reacts with 1 g of oxygen. To use the equation, you must convert your measured masses to moles, use the mole ratios, then convert back to grams if needed.
Moles also let you compare quantities of different substances on an equal footing. One mole of hydrogen gas (2.016 g) and one mole of iron (55.845 g) contain the same number of atoms, even though their masses differ by a factor of about 28.
Limits of the Simple Formula
The grams-to-moles conversion assumes you are dealing with a pure substance with a well-defined formula. It breaks down when:
- The sample is a mixture — you only get the average molar mass, which may not be meaningful.
- The substance is a polymer or protein with a distribution of chain lengths; you need an average molar mass, often from a separate measurement.
- The compound has multiple stable forms (allotropes) — but this rarely affects molar mass since it depends only on atomic composition.
- You are working with a solution of unknown concentration; you cannot convert grams to moles without knowing the solute identity and purity.
For gases, the same conversion works, but you may also want the ideal gas law (PV = nRT) to find moles from pressure, volume, and temperature. The molar mass route is still valid: n = mass / molar mass.
Frequently Asked Questions
How do I find the molar mass of a compound?
Add the atomic weights of every atom in the formula. For water (H₂O), that is 2 × 1.008 + 15.999 = 18.015 g/mol. For glucose (C₆H₁₂O₆), it is 6 × 12.011 + 12 × 1.008 + 6 × 15.999 = 180.156 g/mol. Use the periodic table values — the abridged IUPAC weights are sufficient for most lab work.
What if I only have the number of molecules, not grams?
Divide the number of particles by Avogadro’s constant (6.02214076 × 1023 per mole) to get moles. Then multiply by the molar mass to get grams. The reverse of the grams-to-moles conversion works the same way.
Can I convert grams to moles for a gas without knowing the molar mass?
No — you need the identity of the gas to know its molar mass. However, if you know the volume, temperature, and pressure, you can use the ideal gas law to find moles directly: n = PV / RT, where R = 0.0820574 L·atm/(mol·K) or 8.31446261815324 J/(mol·K) depending on units.
Why is the answer sometimes written in millimoles?
For small masses or dilute solutions, moles can be inconveniently small numbers. Millimoles (mmol) are one-thousandth of a mole. A 0.05 mol quantity is 50 mmol. Biologists and biochemists often work in millimolar (mM) concentrations, which are millimoles per liter.
Does temperature affect the grams-to-moles conversion?
No. Mass and molar mass are independent of temperature. However, if you are converting to molarity, temperature can change the solution volume slightly due to thermal expansion, so molarity changes with temperature even though the number of moles stays fixed. For precise work, prepare solutions at the temperature where you will use them.
What is the difference between molar mass and molecular weight?
They are numerically identical. Molecular weight is the dimensionless ratio of the molecule’s mass to 1/12 of a carbon-12 atom’s mass. Molar mass is that same number expressed in grams per mole. For NaCl, the molecular weight is 58.44 and the molar mass is 58.44 g/mol. The terms are used interchangeably in practice.
Related
Formula used
in m | Mass of solute | g | 2.922 | 0 in mm | Molar mass | g/mol | 58.44 | 0.001 in v | Final solution volume | mL | 250 | 0.001 out c | Molarity | mol/L | m / mm / (v / 1000) | 4 out cmm | Concentration in millimolar | mM | c * 1000 | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation with the constants and conversion factors written on the page, rounded as each result states. See method and constants, the disclaimer or report an error.
More in this section
- QPP Calculator Canada: How It Works & How to Use It
- PPP Calculator World Bank: How It Works & How to Use It2,000.00
- PPP Calculator: India vs USA Cost Comparison1,000.00 USD
- PPP Calculator USD to INR: How It Works2,335 INR
- PPP Calculator India vs UK: Real Cost Comparison103.63 GBP
- PPP Calculator India vs Dubai: Real Cost Comparison8,954.58 AED