Molar Mass Calculator — Molecular Weight from Chemical Formula

Enter any chemical formula to compute its molar mass in g/mol. Supports parentheses: Ca(OH)₂, Fe₂(SO₄)₃, and more.

  • All 118 elements
  • Nested parentheses
  • Element breakdown
  • Browser-only

18.0150 g/mol

ElementCountAtomic massContribution
H21.0082.0160
O115.99915.9990
Total molar mass18.0150 g/mol

About the Molar Mass Calculator

Type a chemical formula and get its molar mass in g/mol, plus a table showing each element's count, atomic mass and contribution to the total. Chemistry students use it to convert between grams and moles before a stoichiometry or solution problem. It handles nested parentheses such as Fe2(SO4)3 and has one-click buttons for ten common compounds.

How to use the Molar Mass Calculator

  1. Type the formula into Chemical formula with correct capitals: Co is cobalt, but CO is carbon monoxide.
  2. Or click one of the preset buttons (H2O, CO2, C6H12O6, NaCl, CaCO3, H2SO4, NH3, C2H5OH, Ca(OH)2, Fe2(SO4)3).
  3. Read the total in g/mol at the top of the result. The table below breaks it down by element.
  4. For a hydrate, write the water as a group in parentheses, for example CuSO4(H2O)5. The dot notation is not parsed.
  5. Divide your sample mass by the total to get moles, or multiply moles by the total to get grams.

Worked example: iron(III) sulfate, Fe2(SO4)3

The subscript 3 after the parentheses multiplies everything inside them. So the formula contains 2 Fe, 3 S and 3 x 4 = 12 O. The calculator uses these atomic masses: Fe 55.845, S 32.065, O 15.999.

Grams to moles for a 25.0 g sample
n = m / M
n = 25.0 g / 399.873 g/mol
n = 0.06252 mol
ElementCountAtomic massContribution
Fe255.845111.6900
S332.06596.1950
O1215.999191.9880
Total399.8730 g/mol

The formula and every variable

Molar mass is M = Σ (nᵢ x Aᵢ), where nᵢ is how many atoms of element i are in one formula unit and Aᵢ is that element's standard atomic weight. M comes out in g/mol because one mole of atoms with atomic mass A u has a mass of A grams. Once you have M, three conversions cover most problems: moles n = m / M, mass m = n x M, and number of particles N = n x 6.022 x 10²³.

CompoundFormulaResult (g/mol)
WaterH2O18.0150
Carbon dioxideCO244.0090
EthanolC2H5OH46.0690
Calcium hydroxideCa(OH)274.0920
Sulfuric acidH2SO498.0770
GlucoseC6H12O6180.1560
Copper sulfate pentahydrateCuSO4(H2O)5249.6820

When the answer looks wrong

  • 0.0000 g/mol: the formula was typed in lowercase ("nacl"). Element symbols must start with a capital letter.
  • Unknown element: the symbol is not one the calculator knows. Check for typos such as "Cl" typed as "CL", which is read as C plus an unknown L. Elements after lawrencium (103) are not in its table.
  • Hydrate too light: CuSO4·5H2O gives 177.6220 because the 5 after the dot is ignored and only one H2O is counted. Write it as CuSO4(H2O)5 to get 249.6820.
  • Small differences from your textbook: the last decimal can differ from other sources. CO2 is 44.0090 here and 44.010 in some tables, because tables round atomic weights differently. Use the same table throughout one problem.
  • Square brackets: use round parentheses for groups. A number after a closing square bracket is not applied as a multiplier.

Molar mass and why it matters

Molar mass bridges the microscopic world of atoms and the macroscopic world of laboratory measurements. You cannot count individual molecules, but you can weigh grams of a substance. Knowing the molar mass lets you convert between grams and moles, which is the foundation of stoichiometry — calculating how much reactant you need and how much product you will get.

For example: the reaction 2H2 + O2 → 2H2O. To produce 36 grams of water (2 moles, since molar mass of H2O = 18 g/mol), you need 4 grams of H2 (2 moles times 2 g/mol) and 32 grams of O2 (1 mole times 32 g/mol).

Common molar masses

Water (H2O): 18.015 g/mol. Carbon dioxide (CO2): 44.009 g/mol. Glucose (C6H12O6): 180.156 g/mol. Sodium chloride (NaCl): 58.443 g/mol. Sulfuric acid (H2SO4): 98.077 g/mol. Ammonia (NH3): 17.031 g/mol. Calcium carbonate (CaCO3): 100.086 g/mol.

The calculator handles any formula including complex parenthetical groups like Fe2(SO4)3 (iron(III) sulfate, 399.88 g/mol) and Ca3(PO4)2 (calcium phosphate, 310.17 g/mol). Type element symbols with a capital first letter and use round parentheses for groups; write hydrates as CuSO4(H2O)5 rather than with a dot.

Molar Mass Calculator: frequently asked questions

What is molar mass?
Molar mass is the mass of one mole of a substance in grams per mole (g/mol). It equals the sum of atomic masses of all atoms in the chemical formula. One mole contains 6.022 times 10^23 particles (Avogadro's number).
What is the molar mass of water (H2O)?
H2O has molar mass 18.015 g/mol. Hydrogen (H) has atomic mass 1.008, and oxygen (O) has 15.999. Two H atoms plus one O atom: 2 times 1.008 + 15.999 = 18.015 g/mol.
What is the difference between molar mass and molecular weight?
Molar mass is expressed in g/mol and refers to one mole of a substance. Molecular weight is dimensionless (mass relative to carbon-12). Numerically they are the same — H2O molar mass is 18.015 g/mol and molecular weight is 18.015.
How do I enter a formula with parentheses?
Enter the formula as written: Ca(OH)2, Fe2(SO4)3. The calculator parses parentheses and subscripts recursively. Ca(OH)2 means one Ca plus two OH groups, giving Ca + 2O + 2H.