Molar Mass Calculator

Work out the molar mass of any chemical formula, with brackets, nested groups and hydrates. See the per element breakdown, mass percent composition, and grams to moles.


Capital letters start an element. Brackets and hydrate dots both work, as in Fe2(SO4)3 or CuSO4·5H2O.
Molar mass
74.092 g/mol
Ca(OH)2

Breakdown by element

Element Atoms Atomic weight Subtotal Mass %
Ca 1 40.078 40.078 54.09%
O 2 15.999 31.998 43.19%
H 2 1.008 2.016 2.72%
Total 5   74.092 100%

What molar mass is

Molar mass is the mass in grams of one mole of a substance, and one mole is 6.022 x 1023 particles. The useful part is that it comes straight from the formula: add up the atomic weight of every atom and you have it. Water is two hydrogens at 1.008 and one oxygen at 15.999, so 18.015 g/mol. That number is what turns a balanced equation, which counts particles, into something you can actually weigh out on a balance.

How to write the formula

Element symbols start with a capital letter and may have one lowercase letter after it, which is why Co is cobalt but CO is carbon and oxygen. A number after a symbol multiplies that symbol; a number after a bracket multiplies everything inside, so Fe2(SO4)3 is two irons, three sulfurs and twelve oxygens. Brackets can nest, and square brackets work too, as in K4[Fe(CN)6]. For a hydrate, write the dot as a middle dot, a full stop or an asterisk: CuSO4·5H2O, CuSO4.5H2O and CuSO4*5H2O all give 249.677 g/mol.

Grams to moles and back

Once you have the molar mass, the two conversions are one division apart. Moles = grams / molar mass, and grams = moles x molar mass. Put a number in the amount box and pick the unit, and the answer appears next to the molar mass: 18.015 g of water is exactly 1 mol, and 2 mol of sodium chloride weighs 116.88 g. This is the step most of stoichiometry rests on, because reactions are written in moles but chemicals are measured in grams.

Percent composition

The last column of the table is each element as a share of the total mass, which is what a question means by percent composition. It is the subtotal for that element divided by the molar mass. In water, oxygen is 15.999 of 18.015, so 88.8 percent by mass even though only one atom in three is oxygen. That gap between counting atoms and weighing them is the point of the calculation, and it is why the percentages always add to 100 while the atom counts do not.

Worth knowing

  • Case matters: Co is cobalt, CO is carbon monoxide, and the tool will read them differently.
  • A leading number multiplies the whole formula, so 2H2O is twice the mass of H2O.
  • Atomic weights are the IUPAC standard values, which are averages across natural isotopes.
  • Percentages always total 100, which makes them a quick check that you typed the formula you meant.
  • Nothing is stored. The calculation runs on our server and the result is discarded once sent.

Frequently Asked Questions

Add up the atomic weight of every atom in the formula. For water, two hydrogens at 1.008 plus one oxygen at 15.999 gives 18.015 g/mol. This tool does the adding and shows each element separately, so you can check the arithmetic rather than just take the answer.

18.015 g/mol. That is 2 x 1.008 for the hydrogen and 15.999 for the oxygen. By mass it is 11.2 percent hydrogen and 88.8 percent oxygen, which surprises people the first time because two of the three atoms are hydrogen.

Write it as CuSO4·5H2O. The dot can be a middle dot, a full stop or an asterisk, so CuSO4.5H2O and CuSO4*5H2O work the same way. All three give 249.677 g/mol, because the 5 multiplies the whole water molecule that follows it.

Very much. An element symbol is one capital letter, optionally followed by one lowercase letter. So Co is cobalt with a molar mass of 58.933, while CO is carbon monoxide at 28.010. Typing h2o in lowercase will be rejected rather than guessed at, because guessing would sometimes be wrong silently.

Numerically nothing, in practice. Molecular weight is a ratio and has no units; molar mass is the mass of one mole and is in grams per mole. They are the same number, which is why the terms get used interchangeably. Molar mass is the more useful of the two because it is what you weigh out.

Divide the grams by the molar mass. Enter the formula, put the number of grams in the amount box and leave the unit on grams, and the answer appears beside the molar mass. Switching the unit to moles reverses it and gives you the weight instead.

They are the IUPAC standard atomic weights, which are weighted averages across the isotopes as they occur naturally on Earth. That is why chlorine is 35.45 rather than a whole number: natural chlorine is a mixture of chlorine 35 and chlorine 37. For elements with no stable isotope, the value is that of the longest lived one.

Yes. The formula is parsed properly rather than pattern matched, so K4[Fe(CN)6] works and gives 368.345 g/mol, and so does anything nested more deeply. Square brackets and round brackets are treated the same way.

How do you calculate molar mass?

Add the atomic weight of every atom in the formula. Water is 2 x 1.008 + 15.999 = 18.015 g/mol. This calculator parses brackets, nested groups and hydrates such as Fe2(SO4)3 and CuSO4·5H2O, shows a per element breakdown with percent composition, and converts grams to moles.