Molar Mass Calculation Formula & Examples
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
This calculator works out the molar mass of a chemical formula you type in, returning the mass in grams per mole (g/mol) for the whole compound. You enter a formula like H2O or Na2SO4, and it instantly sums the atomic masses of every element, accounting for subscripts and parentheses. The result is the molar mass, which you then use to convert between grams and moles in stoichiometry, solution preparation, and gas law problems.
Formula
The molar mass of a compound is the sum of the atomic masses of each element multiplied by the number of atoms of that element in the formula. In symbols:
M = Σ (ni × Ai)
- M = molar mass of the compound (g/mol)
- ni = number of atoms of element i in one formula unit (the subscript in the formula)
- Ai = atomic mass of element i (g/mol, from the periodic table)
For example, water (H2O) has two hydrogen atoms (each 1.008 g/mol) and one oxygen atom (16.00 g/mol), so M = 2×1.008 + 1×16.00 = 18.02 g/mol. The unit g/mol is numerically identical to the atomic mass unit (u) per molecule, so the same number also gives the mass of one molecule in daltons.
Worked Example
Using the default formula H2O from the calculator above:
- Identify each element and its subscript: H has subscript 2, O has subscript 1 (implied).
- Look up atomic masses: H = 1.008 g/mol, O = 16.00 g/mol.
- Multiply each by its subscript: 2 × 1.008 = 2.016 g/mol for H; 1 × 16.00 = 16.00 g/mol for O.
- Add them: 2.016 + 16.00 = 18.016 g/mol.
- Rounded to two decimals (as the calculator does): 18.02 g/mol.
This matches the calculator’s output for the default values.
How to Read the Periodic Table
The atomic mass listed on most periodic tables is a weighted average of all naturally occurring isotopes of that element. For carbon, the value is 12.011 g/mol, not exactly 12, because carbon-13 and carbon-14 exist in small amounts. When calculating molar mass, always use the table’s average value, not the mass number of the most common isotope, unless the problem specifically asks for a particular isotope. For elements that exist as diatomic molecules in their elemental form (H2, O2, N2, F2, Cl2, Br2, I2), the molar mass of the molecule is twice the atomic mass, but in a compound formula you use the atomic mass directly.
Handling Parentheses and Hydrates
Chemical formulas often contain parentheses and water of hydration. For example, calcium nitrate is Ca(NO3)2. The subscript outside the parenthesis multiplies every atom inside: N appears 1×2 = 2 times, O appears 3×2 = 6 times. So the molar mass is Ca (40.08) + 2×N (2×14.01 = 28.02) + 6×O (6×16.00 = 96.00) = 164.10 g/mol.
Hydrates, like copper(II) sulfate pentahydrate (CuSO4·5H2O), include water molecules in the crystal structure. The dot means the water is part of the formula unit: add 5 × 18.02 = 90.10 g/mol to the anhydrous salt’s mass (CuSO4 = 159.62 g/mol) to get 249.72 g/mol. When preparing a solution from a hydrate, you must use the hydrated molar mass, or your concentration will be too low.
Common Mistakes and How to Avoid Them
- Forgetting subscripts: H2O has 2 hydrogens, not 1. Always check the formula carefully.
- Ignoring parentheses: In Al2(SO4)3, the sulfate group appears 3 times, so S = 3×1 = 3 atoms and O = 3×4 = 12 atoms, not 4.
- Using the wrong atomic mass: Chlorine is 35.45 g/mol, not 35.5 or 36. Use the table’s average.
- Unit mix-ups: Molar mass is g/mol, not g or g·mol. If you see a number without per mole, it’s not molar mass.
- Rounding too early: Round only at the final step. Rounding each atomic mass to whole numbers (e.g., H = 1, O = 16) can shift the result by 0.1–0.5 g/mol, which matters in precise titrations.
Why Molar Mass Matters
Molar mass is the bridge between the microscopic world of atoms and the macroscopic world of lab measurements. With it, you can convert grams to moles using the formula n = m / M, where n is the amount in moles, m is the mass in grams, and M is the molar mass in g/mol. This conversion is essential for:
- Preparing solutions of known concentration (e.g., making 0.1 M NaCl: weigh 0.1 × 58.44 = 5.844 g of salt per liter).
- Calculating theoretical yields in chemical reactions from balanced equations.
- Finding the empirical formula of a compound from percent composition.
- Using the ideal gas law PV = nRT, where n is in moles.
Without molar mass, you cannot relate the mass of a substance you can weigh on a balance to the number of particles that actually react.
Limits of the Formula
The simple summation formula works for any stable, neutral compound with a known formula. However, it does not apply to:
- Mixtures: Air, saltwater, or alloys have no single molar mass; you would use an average molar mass based on composition.
- Polymers: A polymer sample contains chains of varying lengths, so it has a distribution of molar masses, often reported as an average (number-average or weight-average).
- Isotopically enriched compounds: If a sample is enriched in a specific isotope (e.g., deuterated water D2O), the molar mass differs from the natural-abundance value. D2O has a molar mass of about 20.03 g/mol, not 18.02.
- Ionic compounds in solution: The formula unit’s molar mass is still valid, but the dissolved ions have their own masses; the total mass of ions equals the mass of the original compound.
For most textbook and laboratory work, the periodic-table average gives sufficient accuracy (four significant figures). If you need isotopic purity, you must use the exact isotopic masses from a mass spectrometer.
Frequently Asked Questions
What is the difference between molar mass and molecular weight?
They are numerically identical for molecular compounds. Molecular weight (or molecular mass) is the mass of one molecule in daltons (u), while molar mass is the mass of one mole (6.022 × 1023 molecules) in grams. Because one dalton is defined as 1/12 the mass of carbon-12, the numerical values match. For ionic compounds like NaCl, the term
Related
Formula used
in f | Chemical formula | - | H2O | 0 out mm | Molar mass | g/mol | 0 | 2
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.