CODDY Tool

Molar Mass Calculator

Type a chemical formula and get its molar mass, broken down element by element.

Parses a chemical formula — including nested brackets and hydrates like CuSO4·5H2O — and calculates its molar mass from IUPAC standard atomic weights, with the contribution of every element shown separately.

Everything you enter stays in this browser tab. Nothing is sent to our servers, logged or stored.

Loading tool…

About Molar Mass Calculator

A compound's molar mass is just the sum of its atoms' atomic weights, but getting there by hand means parsing the formula correctly — tracking subscripts, multiplying through parentheses, remembering that Ca(OH)2 has two oxygens and two hydrogens, not one of each — and then looking up every element's weight on a periodic table. This does both steps: it reads the formula and does the arithmetic.

The formula parser handles real formulas, not just simple ones. Nested brackets multiply correctly — Mg3(PO4)2 gives three magnesiums, two phosphorus and eight oxygens, because the 2 outside the parentheses multiplies everything inside it. Hydrates work too: CuSO4·5H2O adds five water molecules' worth of hydrogen and oxygen on top of the anhydrous compound's own atoms.

Every element symbol is checked against the actual periodic table, so a capitalisation slip is caught immediately rather than silently misread — Co (cobalt) and CO (carbon monoxide, i.e. one carbon and one oxygen) are different formulas, and typing one when you meant the other is the single most common mistake in hand-entered chemical formulas.

How to calculate molar mass

  1. Type a formula

    Or pick one of the examples to see the syntax.

  2. Check the capitalisation

    Element symbols are one capital letter, optionally followed by one lowercase letter.

  3. Read the breakdown

    Total molar mass, plus each element's individual contribution.

Formula syntax this understands

  • Subscripts as plain digits after a symbol: H2O, not H₂O.
  • Parentheses and square brackets, nested to any depth: Mg3(PO4)2, K4[Fe(CN)6].
  • A hydrate dot (· or •) followed by a count and formula: CuSO4·5H2O.
  • Implicit counts of 1 where no digit follows a symbol: NaCl, not Na1Cl1.

Frequently asked questions

Why did my formula fail to parse?

Almost always a capitalisation mistake or an unmatched bracket — both are called out specifically in the error message, with the exact character that didn't make sense. Co and CO, or Na and NA, look similar but mean completely different things to a formula parser.

Does this handle hydrates?

Yes — write the hydrate dot as · or •, followed by the water's count and formula, as in CuSO4·5H2O. The water's hydrogen and oxygen are added on top of the anhydrous compound's own atoms, multiplied by the count before it.

Where do the atomic weights come from?

IUPAC's standard atomic weights — the same reference values printed on a periodic table. Elements with no stable isotope (nothing past uranium occurs naturally) use their most stable known isotope's mass number instead, which is the conventional way periodic tables handle synthetic elements.

Can I calculate the mass of a specific amount, not just one mole?

Multiply the molar mass shown here by however many moles you have, or use the Molarity Calculator if you're working from a concentration and volume instead of a mass directly.

Molar Mass Calculator is free to use with no account, no watermark and no usage limits. Last updated 7 September 2026.