This calculator finds the amount of substance in moles from its mass and its molar mass. Enter the mass in grams and the molar mass in g/mol; you get moles, millimoles and the number of particles from Avogadro’s constant.
Formula
n = m ÷ M. The number of particles N = n × N_A, with Avogadro’s constant N_A = 6.02214076 × 10²³ per mole (exact).
- m: mass in grams
- M: molar mass in g/mol (sum of the atomic masses in the formula)
Worked Example
10 g of sodium chloride, NaCl (M = 22.99 + 35.45 = 58.44 g/mol).
- n = 10 ÷ 58.44 = 0.171116 mol
- 0.171116 × 1000 = 171.12 mmol
- N = 0.171116 × 6.02214076 × 10²³ = 1.0305 × 10²³ formula units
Limits and common mistakes
- Use the molar mass of the whole formula, including water of crystallisation (CuSO₄·5H₂O is 249.69 g/mol, not 159.61).
- Milligrams: divide by 1000 first (250 mg = 0.25 g).
- For a gas at a known volume, the ideal gas law gives moles instead.
Formula used
in m | Mass | g | 10 | 0 in mm | Molar mass | g/mol | 58.44 | 0 out n | Amount of substance | mol | m / mm | 6 out mmol | Amount of substance | mmol | n * 1000 | 2 out parts | Particles | × 10²³ | n * 6.02214076 | 4
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, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- AMU to MeV Calculator (Mass-Energy Equivalent)931.494 MeV
- Species Evenness Calculator (Shannon and Pielou)1.2799