How to use the Molar Mass Calculator
- Type the formula exactly as written, with capital letters for the first character of each element symbol — NaCl, not nacl.
- Write subscripts as plain digits after the symbol, such as C6H12O6.
- Bracketed groups such as Ca(OH)2 are expanded automatically.
- Enter a sample mass in grams to see how many moles and molecules it contains.
- Check the composition line to confirm the percentage of each element by mass.
How the calculation works
Molar mass is the sum of the standard atomic weights of every atom in the formula unit, expressed in grams per mole. The atomic weights used here are IUPAC standard values, which are averages weighted by the natural isotopic abundance found in terrestrial samples. That is why chlorine appears as 35.45 rather than 35 — natural chlorine is about three parts Cl-35 to one part Cl-37.
Since the 2019 SI redefinition the mole is fixed at exactly 6.02214076 × 10²³ elementary entities, decoupling it from the kilogram. In practice nothing changed for chemists: the numerical value of a substance's molar mass in g/mol still equals its relative molecular mass to well within experimental error, so the familiar arithmetic is untouched.
The percentage composition by mass is a fast integrity check on a formula. If a combustion analysis reports 40.0% carbon, 6.7% hydrogen and 53.3% oxygen, that matches CH₂O as an empirical formula — and glucose, C₆H₁₂O₆, has exactly the same percentages because it is the same ratio scaled up. Empirical formulas come from composition; molecular formulas need a separate molar-mass measurement to pin down the multiple.
M = Σ (nᵢ × Aᵢ), where nᵢ is the count of element i and Aᵢ its standard atomic weight; n = mass ÷ M; molecules = n × 6.02214076 × 10²³Source: IUPAC Commission on Isotopic Abundances and Atomic Weights, standard atomic weights (2021); BIPM SI Brochure, 9th edition, mole definition.
Worked example
Finding the molar mass of calcium hydroxide, Ca(OH)₂, and the moles in a 25 g sample.
- The bracket expands to CaO2H2.
- Ca 40.078 + O 15.999 × 2 = 31.998 + H 1.008 × 2 = 2.016.
- Total: 40.078 + 31.998 + 2.016 = 74.092 g/mol.
- Moles in 25 g: 25 ÷ 74.092 = 0.337 mol.
Ca(OH)₂ has a molar mass of 74.09 g/mol, so a 25 g sample contains 0.337 mol, or about 2.03 × 10²³ formula units.
Frequently asked questions
Why is capitalisation important?+
Element symbols are case-sensitive: Co is cobalt while CO is carbon monoxide. The parser follows the same rule, so lowercase input will be rejected or misread.
Are molar mass and molecular weight the same?+
Numerically yes for practical purposes. Molecular weight is a dimensionless relative mass; molar mass carries units of g/mol.
Can I enter hydrates like CuSO4·5H2O?+
Write it out as CuSO4H10O5 or compute the anhydrous salt and the water separately and add the results.
Why does the answer differ slightly from my textbook?+
Atomic weights are revised periodically as isotopic measurements improve. Differences appear in the third or fourth decimal place and never affect a laboratory weighing.
Last reviewed September 1, 2026. We review this page whenever the underlying formula, tax year, published rate or standard changes.