Molecular weight calculator
Type a chemical formula to get its molecular weight (molar mass) in g/mol, a table of each element’s mass and mass percent, and optionally the number of moles in a given mass. Handles brackets and hydrates such as Ca(OH)2 and CuSO4·5H2O.
Case matters: Co is cobalt, CO is carbon monoxide. Hydrates: CuSO4·5H2O (or CuSO4.5H2O).
| Element | Atoms | Atomic weight | Mass | 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% |
Show the working, step by step
Add each element’s atomic weight times the number of atoms of it in the formula.
Ca: 1 × 40.078 = 40.078 O: 2 × 15.999 = 31.998 H: 2 × 1.008 = 2.016
Sum the masses.
74.092 g/mol
Atomic weights are the abridged standard values; heavy or unusual elements are not included.
How molecular weight is calculated
M = Σ (number of atoms of each element × its atomic weight)
For glucose, C6H12O6: 6 × 12.011 + 12 × 1.008 + 6 × 15.999 = 72.066 + 12.096 + 95.994 = 180.156 g/mol. Brackets multiply everything inside them: in Ca(OH)2 the 2 applies to O and H, giving 40.078 + 2 × (15.999 + 1.008) = 74.092. A hydrate is added as a separate piece: CuSO4·5H2O is 159.602 for the salt plus 5 × 18.015 = 90.075 for the water, 249.677 in total.
Mass percent composition
Each element’s share of the total is its mass in the formula divided by the molar mass. In water, oxygen is 15.999 ÷ 18.015 = 88.8% by mass and hydrogen 11.2%. Percent composition is how an unknown compound is identified from lab data, and the table above gives it for any formula you enter.
From grams to moles
moles = mass ÷ molar mass. 58.44 g of table salt (NaCl, 58.44 g/mol) is exactly one mole, about 6.022 × 10²³ formula units. Use this to convert recipes, solutions and reaction quantities between grams and moles. For molarity, dilution or pH, the chemistry calculator builds on the same numbers, and the ideal gas law calculator turns moles of a gas into a volume.
Common mistakes
- Mixing up Co (cobalt) and CO (carbon monoxide): capitals matter.
- Forgetting that a subscript after a bracket multiplies every atom inside it.
- Leaving the water out of a hydrate; the dot means “plus”, not “times”.
- Using a rounded atomic weight in a long calculation: round at the end.
Common questions
What is the difference between molecular weight and molar mass?
They are the same number. Molecular weight is a relative figure (grams per mole divided by 1), molar mass is the mass of one mole in g/mol. For water both are 18.015. Ionic compounds such as NaCl are properly said to have a formula weight, but the calculation is identical.
How do I enter a formula with brackets or a hydrate?
Type brackets as normal: Ca(OH)2 is one calcium, two oxygens and two hydrogens. For a hydrate use a dot or the middle dot: CuSO4·5H2O adds five waters to copper sulfate. Square brackets work too: K4[Fe(CN)6].
Why does capitalisation matter?
Element symbols start with a capital and an optional lowercase letter, so Co is cobalt but CO is carbon monoxide, and Cl is chlorine while CL is not an element. The calculator reads the formula exactly as typed and tells you when a symbol is not recognised.
How many moles are in a given mass?
Divide the mass in grams by the molar mass. 36 g of water is 36 ÷ 18.015 ≈ 2.00 mol. Enter the optional mass and the calculator shows the mole count.
Which atomic weights does it use?
Abridged standard atomic weights to three or four decimals (H 1.008, C 12.011, N 14.007, O 15.999 and so on) for 57 common elements. Heavy or synthetic elements are not included, and results can differ in the last digit from a table that uses more decimals.
Related calculators
-
Chemistry calculator
Molarity, dilution, pH and more.
-
Ideal gas law calculator
PV = nRT for any unknown.
-
Percentage calculator
Mass percent as a share.
-
Unit converter
Grams, kilograms and pounds.