Molar Mass Calculator

Type any chemical formula — brackets, hydrates and coefficients included — and get its molar mass, percent composition, and the grams-to-moles arithmetic worked out.

Instant answers Works offline once loaded Nothing you type is sent anywhere Full formula parser Percent composition Moles, mass and particles
Case matters: Co is cobalt, CO is carbon monoxide. Brackets, hydrate dots and leading coefficients all work.

Molar mass of

Atoms per formula unit
Distinct elements
Heaviest contributor
Empirical formula

Percent composition by mass

ElementSymbolCountAtomic massMass contributed% by mass

Mass, moles and particles

Edit either box — the other follows.
Avogadro's number is exactly 6.02214076×10²³ per mole.

Making up a solution

How the formula was read

Instructions

How to use this calculator

Step by step

  1. Type a chemical formula into the box. Capitalisation is significant and unavoidable: Co is cobalt, CO is carbon monoxide, and the calculator has no way to guess which you meant.
  2. Use brackets for polyatomic groups exactly as you would write them on paper — Ca(OH)2, (NH4)2SO4, Fe2(SO4)3 all parse correctly, including brackets inside brackets.
  3. Write hydrates with a dot: CuSO4·5H2O. A plain full stop or an asterisk works too, so CuSO4.5H2O and CuSO4*5H2O give the same answer.
  4. Put a coefficient in front if you want a multiple, as in 2H2O. It multiplies the whole formula.
  5. Read the molar mass at the top, then the percent composition table for how the mass divides between elements — that table is what most homework questions are actually asking for.
  6. Enter a mass in grams to get moles and the number of particles, or type moles to get the mass. The two boxes stay in step with each other.
  7. For lab work, put your target volume and concentration into the solution panel and it tells you what to weigh out.

Good to know

  • Molar mass in grams per mole is numerically the same as the molecular mass in atomic mass units. A water molecule is 18.015 u; a mole of water is 18.015 g. That equivalence is the entire point of the mole.
  • Percent composition is independent of how much you have. It is a property of the compound, which is why it is used to identify unknowns from combustion analysis.
  • The empirical formula is the whole-number ratio; the molecular formula is the actual count. Glucose is C6H12O6 molecular and CH2O empirical — and so is formaldehyde, which is why you need the molar mass to tell them apart.
  • Atomic weights are averages over natural isotope abundances, so they are not whole numbers. Chlorine is 35.45 because natural chlorine is roughly three parts Cl-35 to one part Cl-37.
  • When making a solution, dissolve the solid in less than the final volume and then top up to the mark. Adding solid to a full volume of water gives you more than you wanted.
  • Check your answer against a rough mental estimate. If you typed CaCO3 and got 40 g/mol, you have probably dropped the carbonate — it should be around 100.

The maths behind it

  • Molar mass M = Σ (count × atomic weight) In grams per mole; numerically equal to the molecular mass in u.
  • Moles from mass n = m ÷ M Mass in grams, molar mass in g/mol.
  • Number of particles N = n × N_A N_A = 6.02214076×10²³ mol⁻¹, exact by definition since 2019.
  • Percent composition % = (count × atomic weight) ÷ M × 100 The percentages always sum to 100.
  • Molarity c = n ÷ V Moles per litre of solution, not per litre of solvent.
  • Mass to make a solution m = c × V × M Concentration in mol/L, volume in litres.
  • Empirical from molecular divide all counts by their greatest common divisor The molecular formula is a whole-number multiple of it.
Why does capitalisation matter so much?
Because element symbols are defined that way. A symbol is one capital letter, optionally followed by one lowercase letter. So "CO" is unambiguously carbon then oxygen, and "Co" is unambiguously cobalt. If the calculator guessed, it would silently give you the wrong answer half the time — so it rejects anything it cannot read exactly.
How do I enter a hydrate like copper sulfate pentahydrate?
Write CuSO4·5H2O. The dot separates the two parts and the number after it multiplies the water. A full stop or asterisk works as well, since the interpunct is awkward to type on most keyboards.
What is the difference between molar mass, molecular mass and formula mass?
They are the same number in different units and contexts. Molecular mass is the mass of one molecule in atomic mass units; molar mass is the mass of one mole in grams; formula mass is the term used for ionic compounds, which do not form discrete molecules. NaCl has a formula mass of 58.44 because there is no such thing as an NaCl molecule in a crystal.
Why are atomic weights not whole numbers?
Because they are weighted averages over the isotopes found in nature. Chlorine sits at 35.45 because roughly 76% of natural chlorine is Cl-35 and 24% is Cl-37. Carbon is 12.011 rather than exactly 12 for the same reason — a little C-13 is mixed in.
How is percent composition used?
Mostly to identify unknown compounds. Burn a sample, measure the carbon dioxide and water produced, and you can work out the percentages of carbon and hydrogen. Match those against candidate formulas and you have your empirical formula; a separate molar mass measurement then gives you the molecular one.
Does this handle charges, like SO4 2−?
Charges are ignored, and for molar mass that is correct — an electron weighs about 1/1800 of a proton, so the difference between a sulfate ion and a neutral sulfate group is far below the precision of the atomic weights used here. Just type SO4.
Why do I get a slightly different answer from my textbook?
Almost always rounding in the atomic weights. This page uses the IUPAC 2021 values, which are more precise than the two-decimal figures printed on many classroom periodic tables. Differences in the third or fourth significant figure are expected and rarely matter; if your answer differs in the first two, something else is wrong.