home / Other / molecular weight calculator

Molecular Weight Calculator

The Molecular Weight Calculator is a free online tool that works out the molar mass of any chemical formula, showing how each element contributes and what percentage of the total it represents. It also converts between grams and moles for that compound. No sign-up needed.

Enter a formula such as H2O, C6H12O6, Ca(OH)2 or CuSO4ยท5H2O.

grams (optional)

Related: Molarity Calculator | Mass Calculator

What Molar Mass Is

Molar mass is the mass of one mole of a substance, in grams per mole. It is found by adding the atomic masses of every atom in the formula.

Molar mass = Σ (atomic mass × number of atoms)

For water, H2O: 2 × 1.008 + 1 × 15.999 = 18.015 g/mol. One mole of water — 6.022 × 1023 molecules — weighs 18 grams, which is about a tablespoon.

The Mole

A mole is simply a count, like a dozen: exactly 6.02214076 × 1023 particles, a figure known as Avogadro's number. Since 2019 it has been a defined constant rather than something measured.

The point of the mole is that it links the invisible scale of atoms to the scale of a laboratory balance. Chemical equations tell you the ratio in which molecules react; the mole converts that ratio into grams you can weigh out.

Writing Formulas

FormulaMeaningMolar mass
H2OWater18.015
NaClTable salt58.44
C6H12O6Glucose180.156
CaCO3Calcium carbonate100.087
Ca(OH)2Calcium hydroxide — brackets multiply the group74.09
CuSO4·5H2OCopper sulfate pentahydrate — the dot means loosely bound water249.68
C8H10N4O2Caffeine194.19
C9H8O4Aspirin180.16
C2H5OHEthanol46.07

Capitalisation matters. CO is carbon monoxide; Co is cobalt. An element symbol is always a capital letter, optionally followed by a single lower-case letter.

Brackets and Hydrates

A subscript after brackets multiplies everything inside: Ca(OH)2 contains one calcium, two oxygens and two hydrogens.

A middle dot indicates a hydrate — water molecules held in the crystal structure. CuSO4·5H2O is copper sulfate with five waters per formula unit, and those waters count toward the molar mass. Heating drives them off, turning the blue crystals white and reducing the mass to 159.6 g/mol.

Atomic Mass and Isotopes

Atomic masses on the periodic table are weighted averages across an element's natural isotopes. Chlorine's 35.45 reflects a mixture of roughly 76% chlorine-35 and 24% chlorine-37; no individual chlorine atom weighs 35.45.

This is why molar masses carry decimals, and why the values are periodically revised as measurements improve. For most laboratory work four significant figures is ample.

Working With Moles

To findFormula
Moles from massn = mass ÷ molar mass
Mass from molesmass = n × molar mass
Number of moleculesN = n × 6.022 × 1023
Concentrationc = n ÷ volume in litres
Volume of an ideal gas at STPV = n × 22.4 L

Percentage Composition

The share each element contributes to the total mass is useful for identifying an unknown compound and for calculating yields. In glucose, C6H12O6, carbon accounts for 40.0% of the mass, hydrogen 6.7% and oxygen 53.3% — and any sugar with that same ratio shares its empirical formula, CH2O.

That is the distinction between empirical and molecular formulas: the empirical formula gives the simplest whole-number ratio, while the molecular formula gives the actual count. Glucose (C6H12O6) and formaldehyde (CH2O) have identical percentage composition and very different properties.

Frequently Asked Questions

Is molecular weight the same as molar mass?

Numerically yes, though strictly molecular weight is dimensionless — a ratio against carbon-12 — while molar mass carries units of g/mol. In practice the terms are used interchangeably.

Why does my formula fail to parse?

Usually capitalisation. Write NaCl, not NACL or nacl. Also check that brackets are balanced and that every symbol is a real element.

How do I handle a hydrate?

Write it with a dot: CuSO4.5H2O or CuSO4·5H2O. Both forms are accepted, and the waters are included in the total.

How many molecules are in a gram?

Divide the mass by the molar mass to get moles, then multiply by 6.022 × 1023. One gram of water contains about 3.3 × 1022 molecules.