To calculate molar mass, write the chemical formula, count the atoms of each element, multiply each count by that element's atomic weight, and add the results. The total, in grams per mole (g/mol), is the mass of one mole of the substance. For water (H₂O), that is (2 × 1.0080) + 15.999 = 18.015 g/mol.

A mole is a counting unit, like a dozen, but it stands for exactly 6.02214076 × 10²³ particles. This guide works through water, glucose and table salt using the current atomic weights from CIAAW, the international commission that evaluates them. It then covers the cases that trip people up: parentheses, hydrates, mass percent and converting between grams and moles.

The four-step method

Every molar mass uses the same four steps, however large the formula is. The OpenStax chemistry textbook describes the sum as adding the average atomic masses of all the atoms in the formula, and molar mass is that same number expressed in g/mol.

  1. Write the formula. Make sure it is the right one, because a wrong subscript changes everything after it.
  2. Count the atoms of each element. A subscript applies to the symbol right before it, and a symbol with no subscript means one atom.
  3. Multiply. For each element, multiply the atom count by the atomic weight.
  4. Add and round. Add the subtotals, round the total, and write g/mol after it.

The atomic weight is the larger number in an element's cell on the periodic table, and the atomic number is the smaller one. If you are unsure which is which, our guide on how to read the periodic table explains every number in a cell.

Which atomic weights to use

Use the values your course or textbook gives, if it gives any. Otherwise, use the abridged table from CIAAW, which gives one rounded value per element, normally to five significant figures. The current version is labeled 2024.

Table comparing CIAAW abridged atomic weights with the rounded values in the OpenStax textbook for seven common elements
Atomic weights used in this guide, next to common textbook rounding

Textbook rounding is why two correct answers can differ in the last digit. With CIAAW's values, water comes to 18.015 g/mol. With hydrogen at 1.008 and oxygen at 16.00, as OpenStax uses them, it comes to 18.016 g/mol.

Even the abridged value is a simplification. Some elements vary slightly between natural samples, so CIAAW's full table gives an interval instead of a single number. Chlorine is listed as [35.446, 35.457] and hydrogen as [1.00784, 1.00811]. For table salt, chlorine's interval alone moves the molar mass from about 58.436 to 58.447 g/mol, so the third decimal means little for an ordinary sample. CIAAW also flags hydrogen, nitrogen, oxygen and chlorine because commercial materials can have a modified isotope mix, and their atomic weight can then differ substantially from the standard value.

Worked examples: water, glucose and table salt

The three answers are 18.015 g/mol for water, 180.156 g/mol for glucose and 58.44 g/mol for table salt. All three use the CIAAW values above.

Water, H₂O

One molecule of water has 2 hydrogen atoms and 1 oxygen atom.

ElementAtomsAtomic weightSubtotal
Hydrogen21.00802.0160
Oxygen115.99915.999
Total18.015 g/mol

The NIST Chemistry WebBook lists water at 18.0153, which rounds to the same answer.

Glucose, C₆H₁₂O₆

One molecule of glucose has 6 carbon, 12 hydrogen and 6 oxygen atoms.

ElementAtomsAtomic weightSubtotal
Carbon612.01172.066
Hydrogen121.008012.096
Oxygen615.99995.994
Total180.156 g/mol

NIST lists glucose at 180.1559, which also rounds to the same answer. Use the molecular formula here and not the simplified one. Glucose's empirical formula (the simplest whole-number ratio of its atoms) is CH₂O, which adds up to only about 30 g/mol. OpenStax shows how the two connect: 180 ÷ 30 = 6, so each molecule holds six of those units.

Table salt, NaCl

The formula has 1 sodium and 1 chlorine.

ElementAtomsAtomic weightSubtotal
Sodium122.99022.990
Chlorine135.4535.45
Total58.44 g/mol

Chlorine's value has only two decimal places, so the total is rounded to two. NIST lists 58.443. Salt is an ionic compound, so it is not made of separate NaCl molecules, and its formula shows the ratio of ions. Textbooks may call the result a formula mass, but the calculation is the same.

Parentheses and hydrates

Both notations change the atom count, so write out the full count before you multiply anything.

Formulas with parentheses

A subscript outside parentheses multiplies every atom inside them. Calcium hydroxide, Ca(OH)₂, has 1 calcium, 2 oxygen and 2 hydrogen atoms:

40.078 + (2 × 15.999) + (2 × 1.0080) = 74.092 g/mol

Reading it as CaOH₂ would count only one oxygen and give 58.093 g/mol. OpenStax handles a longer case the same way: it rewrites Al₂(SO₄)₃ as Al₂S₃O₁₂, meaning 2 aluminum, 3 sulfur and 12 oxygen atoms, and gets 342.14 using its rounded atomic weights.

Hydrates

A hydrate is a compound that includes water in its formula. The dot is not a multiplication sign. The number after it says how many water molecules come with each formula unit, so you add those atoms to the count. Copper(II) sulfate pentahydrate, CuSO₄·5H₂O, has 1 copper, 1 sulfur, 9 oxygen (4 + 5) and 10 hydrogen atoms:

63.546 + 32.06 + (9 × 15.999) + (10 × 1.0080) = 249.68 g/mol

The unrounded sum is 249.677. Sulfur's value has two decimal places, so the total is rounded to two.

How to calculate mass percent

Mass percent is each element's subtotal divided by the molar mass, times 100. OpenStax writes it as %X = (mass of X ÷ mass of compound) × 100%. You already have both numbers from the tables above. For carbon in glucose, (72.066 ÷ 180.156) × 100 = 40.00%.

Bar chart of the mass percent of oxygen, carbon and hydrogen in glucose
Mass percent of each element in glucose

Hydrogen makes up half the atoms in glucose (12 of 24) but only 6.71% of the mass, because hydrogen atoms are so light. These three percentages add up to 99.99, and that small gap is only rounding.

The same method gives 11.19% hydrogen and 88.81% oxygen in water, and 39.34% sodium and 60.66% chlorine in table salt. So 10 g of salt contains about 3.9 g of sodium.

For a hydrate, you can treat the water as one block. In CuSO₄·5H₂O, the water weighs 5 × 18.015 = 90.075 g per mole, so the percent water is (90.075 ÷ 249.68) × 100 = 36.08%. LibreTexts teaches the same method: divide the mass of water in one mole of hydrate by the hydrate's molar mass.

Converting between grams and moles

Divide grams by molar mass to get moles, and multiply moles by molar mass to get grams. OpenStax uses this same pair of steps for elements and compounds.

  • Grams to moles: 25.0 g of water ÷ 18.015 g/mol = 1.39 mol
  • Moles to grams: 0.250 mol of table salt × 58.44 g/mol = 14.6 g

Both answers have three significant figures because 25.0 and 0.250 do. When you multiply or divide, the result keeps as many significant figures as the input with the fewest. To go from moles to a number of molecules, multiply by the Avogadro constant, 6.02214076 × 10²³ per mole.

Quick checks for your answer

A whole-number estimate catches big slips. Round each atomic weight to the nearest whole number and add in your head: glucose is (6 × 12) + 12 + (6 × 16) = 180, and salt is 23 + 35 = 58. If your exact answer is far from the estimate, look for one of these:

  • Atomic number used instead of atomic weight. Water would come out as 10.
  • A subscript applied to the wrong atoms. Write out what the parentheses mean and count again.
  • Water left out of a hydrate. CuSO₄·5H₂O is not the same as CuSO₄.
  • Empirical formula used instead of molecular formula. Glucose would come out near 30.
  • A missing unit. Molar mass is written in g/mol.

Check your work with a calculator

If you are learning this, work the problem by hand first, then use a calculator to catch typos. Atomap, the periodic table and molecules app we make for Android, has a free molar mass calculator with mass %. It handles parentheses and hydrates such as CuSO4·5H2O. If your course rounds atomic weights differently, the last digit may not match your answer key.

Molecule pages show a formula, molar mass and the elements with their mass %, so you can compare your own table with a finished one.

Atomap molecule details screen with a formula, molar mass and elements by mass percent
A molecule's page, with its molar mass and mass %

Calculation history and empirical formulas open with a 24-hour pass, which you get by watching an optional ad. The data is built into the app, so it works offline, and each page lists its sources.

AtomapFrom elements to the molecules in everyday products, and back.
Get it on Google Play

Common questions

What is the difference between molar mass and molecular weight?

Molar mass has a unit, usually g/mol, while molecular weight is a pure number with no unit. NIST's SI guide prefers the term relative molecular mass and calls molecular weight obsolete, though many books still use it. The number is the same for everyday work: a relative molecular mass of 18.015 means a molar mass of 18.015 g/mol. The official SI unit is kg/mol, but chemists almost always use g/mol.

Why does molar mass have the same number as atomic mass?

One mole of a substance has the same mass in grams that one atom or molecule has in atomic mass units. That is why carbon at 12.011 in atomic units is 12.011 g/mol. Strictly, CODATA's 2022 molar mass constant is 1.00000000105 g/mol, so the match is off by about one part per billion, far too small to matter in a calculation.

How do I find the molar mass of an element?

Read its atomic weight and add g/mol, so iron is 55.845 g/mol. Then check whether the question means single atoms or the form the element normally takes. Hydrogen, oxygen, nitrogen, fluorine, chlorine, bromine and iodine commonly form two-atom molecules, so O₂ is 31.998 g/mol and Cl₂ is 70.90 g/mol. Sulfur usually forms S₈, which is 256.48 g/mol.

Why is my answer slightly different from the answer key?

Almost always, the answer key used more heavily rounded atomic weights. Hydrogen at 1.01 instead of 1.0080 turns water into 18.02 g/mol. A difference in the last digit or two is normal, and your course's atomic weights are the ones to use on a test. A larger difference usually means an atom was miscounted.

How many decimal places should I keep?

When you add the subtotals, round the total to the same number of decimal places as the subtotal with the fewest. Atom counts are exact numbers, so they don't limit your precision. Keep extra digits while you work and round only at the last step.