Convert between grams and moles for any substance using the formula n = m / M (moles = mass ÷ molar mass). Enter any two of mass, molar mass, and moles and the calculator finds the third — or let it work out the molar mass automatically from a chemical formula.
The grams to moles calculator converts between the mass of a substance and the number of moles it contains, using the fundamental chemistry formula n = m / M. It works in both directions — as a grams-to-moles converter and a moles-to-grams converter — and it can even find the molar mass when you know the mass and the number of moles. Enter any two of the three quantities and the calculator returns the third, with full support for units from nanograms to kilograms and from picomoles to moles. If you do not know the molar mass, type a chemical formula and the calculator works it out for you from the periodic table.
This page explains what a mole is, the grams-to-moles formula and how to use it, step-by-step worked examples you can reproduce, how molar mass is calculated, and answers to the questions students ask most. Whether you are balancing equations, preparing a solution in the lab, or studying for a chemistry exam, this tool takes the arithmetic off your plate.
The mole is the SI unit for the amount of a substance. One mole contains exactly 6.02214076 × 10²³ elementary entities — atoms, molecules, ions, or whatever you are counting — a figure known as Avogadro's number. Just as a "dozen" always means twelve, a "mole" always means about 6.022 × 10²³. Chemists use the mole because atoms and molecules are far too small and numerous to count individually; instead, they weigh a sample and convert that mass into a number of moles, which tells them how many particles are present. This bridge between the mass you can measure on a balance and the number of particles that actually react is what makes the mole the beating heart of quantitative chemistry.
Converting grams to moles relies on one compact equation:
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 (g/mol). The molar mass is the mass of one mole of the substance, and it is numerically equal to the substance's atomic or molecular weight. Because the equation is a simple ratio, it rearranges easily to solve for whichever quantity you need:
Moles: n = m / M · Mass: m = n × M · Molar mass: M = m / n
That flexibility is why the calculator is bidirectional: give it any two of the three values and it computes the missing one.
The molar mass of a compound is the sum of the molar masses of every atom in its chemical formula, read from the periodic table. To find it by hand, you multiply each element's atomic weight by how many of that atom appear in the formula, then add the results. For water, H₂O, there are two hydrogen atoms (about 1.008 g/mol each) and one oxygen atom (about 15.999 g/mol):
M(H₂O) = 2 × 1.008 + 15.999 = 18.015 g/mol
The calculator automates exactly this process: switch to "From formula" mode, type a formula such as H2O, Na2SO4, or C6H12O6, and it parses the elements and their counts — including bracketed groups like Ca(OH)2 — and returns the molar mass instantly.
How many moles are there in 100 grams of water? Water has a molar mass of about 18.015 g/mol, so:
n = 100 g / 18.015 g/mol ≈ 5.551 mol
There are about 5.551 moles in 100 grams of water. This is the calculator's default (100 g of H₂O), so you can press Calculate to confirm it. Scaling up, 5,988 grams of water gives n = 5,988 / 18.015 ≈ 332.4 moles — the same formula, larger numbers.
Working the other way, how many grams are in 2 moles of sodium chloride (table salt, NaCl)? The molar mass of NaCl is about 58.44 g/mol, so:
m = n × M = 2 mol × 58.44 g/mol = 116.88 g
You would weigh out about 116.88 grams of salt to have 2 moles of it. Enter 2 in the moles field and the NaCl molar mass, leave the mass blank, and the calculator returns this figure — handy when preparing solutions of a known concentration.
If you know the mass and the number of moles, you can find the molar mass. Suppose 90 grams of a substance is known to be 0.5 moles. Then:
M = m / n = 90 g / 0.5 mol = 180 g/mol
The molar mass is 180 g/mol — which happens to be the molar mass of glucose, C₆H₁₂O₆. Leaving the molar mass field blank and entering the mass and moles lets the calculator identify it for you.
Real chemistry problems span an enormous range of scales, so the calculator accepts many units. On the mass side you can work in nanograms, micrograms, milligrams, grams, decagrams, or kilograms; on the amount side in moles, millimoles, micromoles, nanomoles, or picomoles. Internally the tool converts everything to grams and moles, applies n = m / M, and then converts the answer back to the units you selected. This means you can, for example, find how many micromoles are in a few milligrams of a drug, or how many kilograms of reactant you need for a given number of moles in an industrial process, without doing any unit conversion by hand. Note that molar mass in grams per mole (g/mol) is numerically identical to kilograms per kilomole (kg/kmol), so those two options give the same number.
Chemical reactions happen between particles in whole-number ratios, not between equal masses, so almost every quantitative problem in chemistry starts by converting a measured mass into moles. Balancing equations, working out how much product a reaction will yield, figuring out which reactant runs out first (the limiting reagent), preparing a solution of a target molarity, and scaling a recipe up from the lab bench to the factory all depend on knowing the number of moles. Because you can weigh a substance but cannot directly count its molecules, the grams-to-moles conversion is the essential first step that turns a reading on a balance into the particle counts that chemistry actually cares about. Mastering it — and having a reliable calculator to check your work — unlocks the rest of stoichiometry.
For quick reference, here are the approximate molar masses of some common substances, all of which the calculator can compute from their formulas:
| Substance | Formula | Molar mass (g/mol) |
|---|---|---|
| Water | H₂O | 18.015 |
| Table salt | NaCl | 58.44 |
| Carbon dioxide | CO₂ | 44.01 |
| Glucose | C₆H₁₂O₆ | 180.16 |
| Sodium hydroxide | NaOH | 40.00 |
| Sulfuric acid | H₂SO₄ | 98.08 |
These three terms are closely related and often used interchangeably, but it is worth knowing the distinctions. Atomic weight (more properly, relative atomic mass) is the average mass of an element's atoms relative to a defined standard, and it is the number you read off the periodic table for a single element. Molecular weight (relative molecular mass) is the same idea applied to a whole molecule — the sum of the atomic weights of its atoms — and it is a dimensionless ratio. Molar mass is that same numerical value but expressed with units of grams per mole, describing the mass of exactly one mole of the substance. In everyday chemistry the number is identical for all three; the difference is really about whether you attach units and whether you mean one atom, one molecule, or one mole. This calculator works with molar mass in g/mol, which is what the n = m / M formula requires, and it computes that value for you from any chemical formula.
Underneath every grams-to-moles conversion sits Avogadro's number, 6.02214076 × 10²³ particles per mole. It is the bridge between the macroscopic world of grams that you can weigh and the microscopic world of individual atoms and molecules. Once you have converted a mass into moles with this calculator, multiplying by Avogadro's number tells you the actual count of molecules present. For instance, the 5.551 moles in 100 grams of water correspond to about 5.551 × 6.022 × 10²³ ≈ 3.34 × 10²&sup4; individual water molecules — an almost unimaginable number that shows why chemists prefer to count in moles rather than in raw particles. The mole and Avogadro's number together let scientists move seamlessly between what they can measure on a balance and what is actually happening at the level of atoms.
The grams-to-moles conversion is the first step in almost every stoichiometry problem. A balanced chemical equation tells you the ratio in which substances react — but that ratio is given in moles, not grams. So the standard workflow is: convert the grams of your starting material to moles, use the equation's coefficients to find the moles of product or of another reactant, and then convert back to grams if you need a mass. For example, to find how much product a reaction yields, you begin by turning the mass of your reactant into moles with n = m / M, exactly what this calculator does. The same conversion identifies the limiting reagent — the reactant that runs out first — because you must compare amounts in moles, not in grams, to see which one restricts the reaction. Being fluent with grams-to-moles conversions therefore unlocks yield calculations, limiting-reagent analysis, and solution preparation alike.
Divide the mass in grams by the molar mass in grams per mole: n = m / M. For example, 100 g of water divided by 18.015 g/mol gives about 5.551 moles.
Multiply the number of moles by the molar mass: m = n × M. For example, 2 moles of NaCl × 58.44 g/mol = 116.88 grams.
Molar mass is the mass of one mole of a substance, in grams per mole. It equals the sum of the atomic weights of all the atoms in the chemical formula.
About 5.551 moles, because 100 g ÷ 18.015 g/mol ≈ 5.551 mol.
Yes, numerically. A molar mass of 18.015 g/mol is the same as 18.015 kg/kmol, so the value does not change when you switch between those two units.
Yes. Rearrange the formula to M = m / n. Enter the mass and the number of moles, leave the molar mass blank, and the calculator returns it.
This Grams to Moles Calculator is provided for general educational purposes. Molar masses are computed from standard atomic weights and may differ very slightly from values that use different isotopic conventions. Always double-check critical laboratory calculations against an authoritative source.