Molecular Weight Calculator

Type a chemical formula — such as H2O, C6H12O6 or Ca(OH)2 — and get the molecular weight (molar mass) in grams per mole, along with how much each element contributes.

Quick answer: Molecular weight is the sum of the standard atomic weights of every atom in a formula, in grams per mole (g/mol). Water (H2O) is about 18.02 g/mol; glucose (C6H12O6) is about 180.16 g/mol.

The molecular weight (also called molar mass or formula weight) of a compound is the mass of one mole of it — 6.022 × 1023 molecules — expressed in grams per mole. You find it by adding up the standard atomic weight of every atom the formula contains. This tool reads your formula, including brackets and multipliers, looks up each element and returns the total, so you can weigh out the right amount for a reaction or a solution.

How the calculation works

Molecular weight = Σ (number of atoms of each element × that element's standard atomic weight)
Result is in grams per mole (g/mol).

Atomic weights come from the IUPAC standard atomic weights (for example H = 1.008, C = 12.011, O = 15.999, Na = 22.990). Brackets multiply everything inside them, so Ca(OH)2 means one calcium plus two oxygen and two hydrogen.

Worked example

Glucose is C6H12O6. Carbon: 6 × 12.011 = 72.066. Hydrogen: 12 × 1.008 = 12.096. Oxygen: 6 × 15.999 = 95.994. Adding these gives 180.156 g/mol. So one mole of glucose weighs about 180.16 grams.

Writing formulas the calculator understands

Use standard element symbols with a capital first letter (Na, Cl, Fe), followed by the count of atoms (H2, O2). Group repeated units in round or square brackets with a multiplier after them, like Ca(OH)2, Al2(SO4)3 or K4[Fe(CN)6]. Water of crystallisation written with a dot, such as CuSO4.5H2O, is added in too. Spaces are ignored.

Frequently asked questions

What is the difference between molecular weight and molar mass?
Numerically they are the same. Molecular weight is a relative figure (unitless, relative to carbon-12), while molar mass carries the unit grams per mole. For everyday chemistry you can treat them as identical.
How do I enter a formula with brackets?
Type it just as it is written, e.g. Ca(OH)2 or Al2(SO4)3. The number after a closing bracket multiplies everything inside it.
Does it handle hydrates like CuSO4·5H2O?
Yes. Write the dot as a full stop: CuSO4.5H2O. The five water molecules are included in the total.
Why is my answer slightly different from a textbook?
Standard atomic weights are periodically revised and some sources round differently. Small differences in the last decimal place are normal.

Related calculators

For general and educational use. Based on IUPAC standard atomic weights.
Written by the CalcPine team · Reviewed for accuracy · Last updated 24 July 2026 · Method: molar mass = Σ(atom count × standard atomic weight), g/mol.