Grams to Moles Calculator
Convert mass to moles, or moles back to mass, using the molar mass of any chemical formula. Get the number of particles and a full step-by-step solution using n = m ÷ M.
Choose a direction, give a formula (or molar mass), then enter the known quantity.
Amount of substance
Formula used: n = m ÷ M
58.44 g/mol
Molar mass used
0.171116 mol
Amount of substance
10 g
Mass
1.030e+23
Number of particles
Grams ↔ Moles ↔ Particles Pathway
See how mass, moles, and the number of particles connect through the molar mass.
Mass
10 g
Moles
0.171116 mol
Particles
1.030e+23
Molar mass in use: 58.44 g/mol · Avogadro’s number: 6.02214076 × 10²³ /mol
Step-by-Step Grams to Moles Calculation
Here's exactly how this answer was calculated, one step at a time.
Given: mass = 10 g, molar mass = 58.44 g/mol
Step 1: Find the molar mass of NaCl
Add up the atomic mass of every atom in the formula to get the molar mass.
M = 58.44 g/molStep 2: Convert the given mass to grams
10 g = 10 gStep 3: Apply n = m ÷ M
n = 10 ÷ 58.44 = 0.171116 molStep 4: Convert to number of particles (optional)
Multiplying moles by Avogadro's number gives the number of atoms, molecules, or formula units present.
0.171116 mol × 6.02214076 × 10²³ = 1.0305e+23 formula units
Result:
0.171116 mol
Grams to Moles Calculator: Convert Mass to Moles Online
This grams to moles calculator converts any mass into the matching number of moles, and it works the other way too — enter moles and it gives you grams. All it needs is the molar mass of the substance, which it can work out for you straight from a chemical formula like NaCl or C6H12O6, or you can type the molar mass in yourself if you already know it.
This tool is made for chemistry students, lab assistants, teachers, and anyone doing everyday chemistry calculations. It shows the number of atoms or molecules in your sample too, using Avogadro's number, and it lays out every step of the working so you can check your homework or a lab calculation line by line.
What Is a Mole in Chemistry?
A mole is simply a counting unit, the same way a dozen means 12 of something. One mole always means 6.02214076 × 10²³ particles, whether those particles are atoms, molecules, ions, or formula units. This huge number is called Avogadro's number, and it was chosen so that the mass of one mole of a substance, in grams, matches its atomic or molecular mass on the periodic table.
Chemists use moles because atoms and molecules are far too small and too numerous to count one by one. A tiny sample you could hold in your hand already contains trillions upon trillions of particles, so the mole gives chemistry a practical way to talk about amounts of substance that connects directly to a mass you can actually weigh on a balance.
The Grams to Moles Formula
The formula for converting grams to moles is n = m ÷ M, where n is the number of moles, m is the mass in grams, and M is the molar mass in grams per mole. To go the other way, from moles back to grams, use m = n × M. These two equations are simply rearrangements of each other.
For example, table salt, NaCl, has a molar mass of about 58.44 g/mol. If you have 10 grams of salt, the number of moles is 10 ÷ 58.44, which comes out to about 0.171 mol. This calculator performs that division automatically and also shows you the molar mass calculation behind it, atom by atom.
How to Convert Grams to Moles Step by Step
First, find the molar mass of the substance. You can look this up, calculate it from the chemical formula by adding up atomic masses, or use the built-in formula lookup in this calculator. Second, make sure your mass is in grams — convert milligrams or kilograms to grams first if needed.
Third, divide the mass in grams by the molar mass in g/mol. The units cancel neatly: grams divided by grams-per-mole leaves you with moles. Finally, if you need it, multiply the moles by Avogadro's number to find the actual count of atoms or molecules in your sample. This calculator walks through all four steps automatically every time you enter a value.
How to Convert Moles to Grams
Converting moles back to grams uses the same relationship in reverse: mass equals moles multiplied by molar mass, or m = n × M. This is useful when a recipe, a lab procedure, or a chemical equation tells you how many moles of a substance you need, but your balance only measures grams.
For example, if a procedure calls for 0.25 mol of glucose, and glucose has a molar mass of about 180.156 g/mol, you would need 0.25 × 180.156, which is about 45.04 grams. Switch the mode in this calculator to Moles → Grams to get this kind of answer instantly, along with the number of molecules in that sample.
Why Molar Mass Is the Key to This Conversion
Molar mass is what connects grams and moles. Every element has a known atomic mass, and adding up the atomic masses of every atom in a formula gives the molar mass of the whole compound, in grams per mole. Without knowing the molar mass, there is no way to convert between a weighed mass and a mole amount.
This calculator can compute molar mass directly from a formula you type in, using nested brackets and hydrate notation just like a real periodic table lookup. If you already know the molar mass from a textbook or a bottle label, you can skip the formula step entirely and type the number in directly.
Grams, Moles and Number of Particles
Once you know the number of moles, you can also find out exactly how many individual particles are in your sample. Multiply moles by Avogadro's number, 6.02214076 × 10²³, to get the count of atoms, molecules, or formula units, depending on what kind of substance you are working with.
This is a genuinely huge number even for a small mass. Ten grams of table salt, for instance, contains roughly one hundred billion trillion formula units of sodium chloride. Seeing this number helps make the mole concept feel real — it explains why chemists never try to count particles directly and always work through mass and molar mass instead.
Grams to Moles in Real Chemistry Problems
Converting grams to moles is often the very first step in a stoichiometry problem. Once you know how many moles of a reactant you are starting with, you can use the mole ratios from a balanced chemical equation to predict how many moles of product will form, and then convert that answer back into grams to find an actual yield.
This conversion also comes up constantly outside the classroom — in pharmacy, when calculating drug doses from a known molar concentration; in industrial chemistry, when scaling a reaction up from a lab bench to a full production batch; and in environmental testing, when reporting pollutant levels in moles per litre instead of just grams per litre.
Common Mistakes When Converting Grams to Moles
The most common mistake is dividing by the wrong number, or forgetting units altogether. Always keep straight which number is the mass and which is the molar mass; dividing molar mass by mass instead of mass by molar mass will give you the reciprocal of the right answer, which is a very easy slip to make under time pressure.
Another frequent error is mixing up milligrams and grams, since a factor of 1000 can completely change a result and, in a lab setting, could mean adding far too much or far too little of a reagent. Always double check your mass unit before dividing, and use this calculator's built-in unit selector to avoid manual conversion mistakes.
Grams to Moles Calculator FAQ and Quick Reference
To convert grams to moles, divide the mass in grams by the molar mass in g/mol: n = m ÷ M. To convert moles to grams, multiply moles by the molar mass: m = n × M. To find the number of particles, multiply moles by Avogadro's number, 6.02214076 × 10²³.
This free online grams to moles calculator is designed to help with homework, lab planning, and everyday chemistry problem solving. For regulated, clinical, or safety-critical work, always verify the substance's identity, purity, and exact molar mass against a certified reference before relying on any calculation for a real procedure.
Frequently Asked Questions
What is the formula to convert grams to moles?
Divide the mass in grams by the molar mass in g/mol: n = m ÷ M.
How many moles are in 10 grams of NaCl?
NaCl has a molar mass of about 58.44 g/mol, so 10 g ÷ 58.44 g/mol is about 0.171 mol.
How do I convert moles to grams?
Multiply the number of moles by the molar mass: m = n × M.
How many molecules are in 1 mole of a substance?
Exactly Avogadro's number, 6.02214076 × 10²³ molecules, atoms, or formula units.
Do I need the chemical formula to convert grams to moles?
You need the molar mass. This calculator can work it out from a formula automatically, or you can type the molar mass in directly if you already know it.