Grams to Moles Calculator
Convert between grams and moles for any substance using its molar mass.
Supports 25 common compounds with metric and imperial mass units.
Updated August 26, 2026
Introduction / overview
The Grams to Moles Calculator converts between mass, amount of substance (moles), and molar mass using the standard stoichiometric relationship. It supports six mass units (from nanograms to kilograms) and five mole units (from picomoles to moles), so you can work at any scale — from trace analytical chemistry to bulk industrial preparation.
The calculator works in all three directions: enter mass and molar mass to find moles, enter moles and molar mass to find mass, or enter mass and moles to find molar mass.
Choose between two modes: I know the molar mass (enter your own value) or Choose substance from the list (pick from 416 common compounds with pre-loaded molar masses). The substance list covers gases, acids, bases, salts, organic solvents, metals, and common laboratory reagents.
How to use / quick start
- 1Choose your mode — select “I know the molar mass” if you already have the molar mass value, or “Choose substance from the list” to pick a compound and auto-fill its molar mass.
- 2Enter two known values — type values into any two of the three fields (mass, number of moles, or molar mass). The third field fills in automatically.
- 3Read the result — the calculated value appears instantly. A blue-highlighted value means it was derived from your inputs.
- 4Flip directions — type into any field to make it the new input. The calculator automatically re-solves for the unknown.
Quick example: 36 g of water
Suppose you have 36 grams of water (H2O) and want to know how many moles that is. Water has a molar mass of approximately 18.015 g/mol.
Select “I know the molar mass” mode, enter 36 in the mass field and 18.015 in the molar mass field.
The calculator shows ≈ 2.00 mol in the moles field. Conversely, entering 2 in the moles field and 18.015 in the molar mass field gives 36.03 g in the mass field.
Real-world examples / use cases
Preparing a solution in the lab
A protocol calls for 0.5 mol of sodium chloride (NaCl, molar mass 58.44 g/mol). You need to weigh out the right amount.
Enter 0.5 in the moles field, 58.44 in the molar mass field, and read 29.22 g from the mass field.
Determining molar mass experimentally
You dissolve 5.00 g of an unknown compound and find it is exactly 0.1 mol. What is its molar mass?
Enter 5.00 in mass and 0.1 in moles. The calculator derives the molar mass as 50.0 g/mol — useful for identifying unknown substances.
Using the substance list for common compounds
Switch to “Choose substance from the list” mode and pick Sulfuric acid from the dropdown. The molar mass (98.079 g/mol) fills in automatically. Now you can convert between grams and moles for any amount of H2SO4 without looking up the molar mass separately.
If your substance is not in the list, check the “I don't see my substance” option to reveal the molar mass field and enter a custom value.
Calculation method / formulas
The calculator uses the fundamental stoichiometric equation. Because it solves bidirectionally, any one of the three variables can be the unknown:
Variable definitions
- — number of moles (mol)
- — mass of the substance (g)
- — molar mass of the substance (g/mol)
The three possible calculation directions are:
Find moles from mass and molar mass:
Find mass from moles and molar mass:
Find molar mass from mass and moles:
Unit conversions happen automatically. For example, if you enter mass in milligrams and molar mass in g/mol, the calculator converts milligrams to grams before applying the formula, then displays the result in whatever mole unit is selected. No manual conversion factors are needed on your end.
Frequently asked questions
What is the relationship between grams and moles?
Grams measure mass; moles measure the number of particles. They are connected by molar mass: one mole of a substance weighs exactly its molar mass in grams. For example, one mole of carbon-12 weighs exactly 12 grams.
How do I find molar mass if I don't know it?
Switch to “Choose substance from the list” mode and search for your compound. The molar mass fills in automatically. If your substance is not listed, check “I don't see my substance” and enter the molar mass manually — you can look it up in a periodic table or use the Molar Mass Calculator to compute it from the chemical formula.
Can I convert milligrams to moles directly?
Yes. Select any mass unit (ng, µg, mg, g, dag, kg) from the mass field dropdown and any mole unit (pmol, nmol, µmol, mmol, mol) from the moles field dropdown. The calculator handles the unit conversion internally.
Why can't I enter zero moles?
Zero moles means no substance is present, which would make the molar mass undefined (division by zero). The calculator enforces moles > 0 as a domain constraint. If you enter zero, you'll see a validation message.
Limitations
Mass must be ≥ 0 — negative mass is not physically meaningful. Zero mass is allowed (it represents an empty sample).
Moles and molar mass must be > 0 — zero or negative values for these fields would lead to undefined or non-physical results.
Substance list coverage — the built-in list contains 416 common compounds. If your substance is not listed, use the custom molar mass option.
Results are for ideal calculations — real-world measurements involve weighing uncertainty, purity differences, and temperature-dependent density. This calculator provides the theoretical conversion; always verify critical measurements with laboratory equipment.
Related Calculators
Atom Calculator
Calculate atomic properties including protons, neutrons, electrons, atomic number and mass number
Electron Configuration Calculator
Get the electron configuration for any element from the periodic table. View atomic number, atomic mass, and valence electrons.
Atomic Mass Calculator
Calculate atomic mass from protons and neutrons. Get atomic mass in various units including atomic mass units (u), kilograms, and more.
Electronegativity Calculator
Calculate electronegativity difference between two elements and determine bond type (ionic, polar covalent, or nonpolar covalent).
Average Atomic Mass Calculator
Calculate the average atomic mass of an element based on the isotopes and their natural abundances.
Mass Concentration to Molar Concentration Conversion
Convert mass concentration (g/L, kg/L, mg/L) to molar concentration (M, mM, μM) and vice versa using molar mass.