Skip to content
The Calculatorz
Stoichiometry

Molar Mass Calculator (Grams to Moles)

Calculate the molar mass of any chemical formula, its percent composition by element, and convert between grams, moles and number of particles.

Formula and mass

Compound

How to use this calculator

Type a chemical formula using element symbols with a capital first letter, numbers for counts, brackets for groups and a dot or * for water of crystallisation (hydrates). The calculator adds up the standard atomic weights to give the molar mass, shows how much of the mass each element contributes and, if you enter a mass, converts it to moles and particles.

Formula

Molar mass M = Σ (number of atoms of each element × its standard atomic weight), in g/mol. Mass percent of an element = (count × atomic weight) ÷ M × 100. Moles n = mass ÷ M. Number of particles = n × Avogadro's number (6.02214076 × 10²³ mol⁻¹).

Calculator credits

Calculator developmentJulia Edwards

Editorial supervision

Expert reviewAslamResearcher, Chemical Engineer

Published byThe Calculatorz

Last updated

Read how we research, test, review and correct our calculators in our editorial policy.

Frequently asked questions

What is molar mass?

The mass of one mole of a substance in grams per mole. Numerically it equals the formula's mass in daltons (atomic mass units).

How do I convert grams to moles?

Divide the mass in grams by the molar mass: 10 g ÷ 180.156 g/mol = 0.0555 mol of glucose.

Which atomic weights are used?

The IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW) standard atomic weights, using conventional values such as H = 1.008 and C = 12.011.

How do I enter hydrates and complex ions?

Use a dot or asterisk for water of crystallisation (CuSO4·5H2O or CuSO4*5H2O) and brackets for groups (K4[Fe(CN)6]). Charges at the end, such as SO4^2-, are ignored because electrons have negligible mass.

Why do my answers differ slightly from my textbook?

Textbooks round atomic weights differently (for example Cl = 35.45 or 35.453). Differences are usually in the second decimal place.

What is percent composition used for?

To check a compound's identity, compare fertiliser or ore grades, and work backwards from analysis results to an empirical formula.

References & methodology sources

These sources support the calculator’s formula, definitions, thresholds, units or result interpretation.

  1. Commission on Isotopic Abundances and Atomic Weights. (n.d.). Standard atomic weights. International Union of Pure and Applied Chemistry. View source
  2. Flowers, P., Theopold, K., Langley, R., & Robinson, W. R. (2019). Formula mass and the mole concept. In Chemistry 2e (Section 3.1). OpenStax. View source
  3. International Union of Pure and Applied Chemistry. (n.d.). Periodic table of elements. View source
  4. Mohr, P. J., Newell, D. B., Taylor, B. N., & Tiesinga, E. (2025). CODATA recommended values of the fundamental physical constants: 2022. Journal of Physical and Chemical Reference Data, 54, 033105. View source