Molar Mass Calculator
Enter a chemical formula such as H2O, Ca(OH)2, K4[Fe(CN)6] or CuSO4·5H2O. The calculator counts every atom, uses the current IUPAC atomic weights and shows each step.
How it is calculated
How to calculate molar mass
The molar mass M of a substance is the mass of one mole of it, in g/mol. For each element, multiply the number of atoms by its atomic weight, then add everything up:
M = Σ (number of atoms × atomic weight)
The atomic weight printed in the periodic table is numerically equal to the molar mass in g/mol. This calculator uses the abridged standard atomic weights published by the IUPAC Commission CIAAW (2021 values, including the 2024 revisions for gadolinium, lutetium and zirconium).
Worked example: copper(II) sulfate pentahydrate, CuSO4·5H2O
- Parts: CuSO4 + 5 × H2O
- Atoms: Cu 1, S 1, O 4 + 5 · 1 = 9, H 5 · 2 = 10
- Cu: 1 × 63.546 = 63.546 · S: 1 × 32.06 = 32.06 · O: 9 × 15.999 = 143.991 · H: 10 × 1.0080 = 10.080
- M = 63.546 + 32.06 + 143.991 + 10.080 = 249.677 g/mol
- Rounded to 2 decimal places (sulfur is only given to 0.01): M = 249.68 g/mol
Brackets, hydrates and ions
- Brackets multiply their contents: Ca(OH)2 contains 2 O and 2 H. Nested brackets such as K4[Fe(CN)6] are worked out from the inside out (M = 368.345 g/mol).
- Hydrates and adducts are written with a raised dot. Instead of “·” you can type * or a full stop: CuSO4*5H2O or CuSO4.5H2O. The number after the dot applies to the whole following part; 0.5 or ½ works too (plaster of Paris, CaSO4·½H2O).
- Ions like SO4^2- or NH4+ are accepted. Missing or extra electrons change the mass by only about 0.00055 g/mol per charge and are ignored, as is standard practice.
From grams to moles
With the molar mass you can convert between mass m and amount of substance n: n = m / M and m = n × M. Example: 36.03 g of water is n = 36.03 g / 18.015 g/mol = 2 mol.
More chemistry: atomic masses of single elements in the interactive periodic table, density from mass and volume with the density calculator, and the pH of a solution with the pH calculator.
Frequently asked questions
What is the difference between molar mass, molecular weight and molecular mass?
Molar mass is the mass of one mole in g/mol. Molecular mass is the mass of a single molecule in daltons (u), and “molecular weight” is the older, dimensionless term. The numbers are the same: water is 18.015 u per molecule and 18.015 g/mol.
Why does capitalization matter?
Because element symbols would otherwise be ambiguous: Co is cobalt (58.933 g/mol), while CO is carbon monoxide made of one C and one O atom (28.010 g/mol). If you type a formula in lower case, the calculator suggests possible spellings.
How do I enter water of crystallization (hydrates)?
Put a raised dot, an asterisk or a full stop between the salt and the water, with the number of water molecules right before it: CuSO4·5H2O, CuSO4*5H2O and CuSO4.5H2O all give 249.68 g/mol.
How many decimal places should I give?
As many as the least precise atomic weight in the formula. Oxygen is given to 0.001 g/mol, sulfur only to 0.01 g/mol – so H2O gets three decimals and CuSO4·5H2O two. The unrounded value is shown in the working.
Which atomic weights does the calculator use?
The abridged standard atomic weights of the IUPAC Commission CIAAW (Atomic Weights 2021, revised 2024). Elements without stable isotopes, such as technetium, have no standard atomic weight; for these the calculator uses the isotope mass given by PubChem and tells you so.
How do I convert grams to moles?
Divide the mass by the molar mass: n = m / M. 10 g of table salt (NaCl, 58.44 g/mol) is 10 / 58.44 ≈ 0.171 mol. Choose the direction under “Also convert”.
Sources and legal basis
- IUPAC CIAAW – Abridged Standard Atomic Weights (Atomic Weights 2021, revised 2024), retrieved 27 Sep 2026
- PubChem Periodic Table (NCBI) – masses for elements without a standard atomic weight
- SI Brochure 2019, sec. 2.3.1: BIPM – The International System of Units (SI Brochure, 9th ed.): mole and amount of substance
- NIST CODATA 2022 – electron mass in u
As of:
Related tools
- Interactive Periodic Table of the ElementsAll 118 elements with IUPAC atomic weights, electron configuration, melting and boiling points, density and discovery – search, filter, tap for details.
- Density calculator: density, mass and volumeCalculate density, mass or volume with ρ = m/V – step-by-step, with unit conversion from g/cm³ to kg/m³ and lb/ft³ and densities of water, metals and plastics.
- pH calculator with step-by-step solutionCalculate the pH of strong and weak acids and bases – exact quadratic solution, pKa/pKb or Ka/Kb, and conversion between pH, pOH, [H₃O⁺] and [OH⁻].
- Scientific Notation Converter with StepsConvert numbers to and from scientific notation: a × 10ⁿ, E notation, engineering notation with SI prefixes and standard form – exact, step by step.
- Significant Figures CalculatorCount significant figures, round to n sig figs and apply the rules for multiplying and adding – with highlighted digits, full working and scientific notation.
- Proportion CalculatorSolve direct and inverse proportion problems (rule of three) online: find x from a ↔ b and c, with the unit value and step-by-step working.