Molecular Weight Calculator

Calculate molecular weight and molar mass of chemical compounds

Capital letters start an element. Use brackets for groups, Ca(NO3)2, and a dot for hydrates, CuSO4·5H2O.

Try:

Molar mass of H₂O

18.015 g/mol

3 atoms per formula unit. The molecular weight is the same number without units.

Composition by element

Mass contribution of each element
ElementAtomsAtomic massMass% of total
Oxygen115.99915.99988.81%
Hydrogen21.0082.01611.19%
Total318.015100%

Each element links to its full data. Percentages are the percent composition by mass — the same numbers a percent composition calculator gives.

Convert grams and moles

Mass
1 g
Amount
0.0555 mol
Particles
3.343 × 10²²

Atomic masses here come from the same IUPAC dataset as our interactive periodic table — look up any element's atomic mass or charge.

How it works

Molecular weight (molar mass) is the mass of one mole of a substance, found by adding up the atomic weights of every atom in its formula. It converts between grams and moles, the link between what you weigh out and what reacts.

Molar mass

Molar mass = Σ (atomic weight × atom count)        moles = grams ÷ molar mass
atomic weight
from the periodic table (g/mol)
atom count
number of each element in the formula

Worked example

  • Water, H₂O
  • H ≈ 1.008, O ≈ 16.00
  1. 2 × 1.008 + 1 × 16.00

Molar mass of water ≈ 18.02 g/mol.

Good to know

  • “Molecular weight” and “molar mass” are used interchangeably; the value is the same number in g/mol.
  • One mole is 6.022 × 10²³ particles (Avogadro's number).
  • Knowing molar mass lets you convert a weighed sample to moles for reactions and concentrations.

Related Calculators

Frequently Asked Questions

How is molecular weight calculated?

Sum the atomic masses of every atom in the formula. For water (H₂O): 2 × 1.008 + 15.999 ≈ 18.02 g/mol. Subscripts multiply the preceding element, and the atomic masses come from the periodic table.

What's the difference between molecular weight and molar mass?

They're numerically equal but conceptually different: molecular weight is the relative mass of one molecule in atomic mass units (amu), while molar mass is the mass of one mole of the substance in g/mol. In practice the terms are used interchangeably.

How do I handle parentheses and hydrates in formulas?

Multiply everything inside parentheses by the subscript that follows: Ca(OH)₂ contains one Ca, two O, and two H. Hydrates like CuSO₄·5H₂O add the water's mass times its coefficient — five waters add about 90.08 g/mol.

How do I convert between grams and moles?

Moles = mass ÷ molar mass, and mass = moles × molar mass. With NaCl (58.44 g/mol), 117 g is almost exactly 2 moles. This conversion underlies nearly every stoichiometry and solution-preparation calculation.

Why aren't atomic masses whole numbers?

Periodic-table masses are weighted averages over an element's naturally occurring isotopes. Chlorine is about 35.45 because natural chlorine is roughly 76% Cl-35 and 24% Cl-37 — no single atom has that mass, but a mole of natural chlorine effectively does.