Molecular Weight Calculator

Find the molecular weight (molar mass) of a compound from its chemical formula. View atom counts, each element’s contribution, and percentage composition by mass.

Enter a chemical formula

Use correct capitalization. Type subscripts as ordinary numbers, for example H2O. Parentheses and square brackets are supported.

Calculations use abridged standard atomic weights for common elements. Results are approximate and may vary slightly by reference table.

Your result

Molecular weight / molar mass
18.015 g/mol
Formula: H₂O
Total atoms3
Elements2

Element contribution

ElementAtomsAtomic weightMass contributionMass %
H21.0082.01611.190%
O115.99915.99988.810%
H: 2 × 1.008 = 2.016; O: 1 × 15.999 = 15.999

What is molecular weight?

Molecular weight is the sum of the atomic weights of the atoms represented by a chemical formula. For practical chemistry calculations, it is often used interchangeably with molar mass, which is expressed in grams per mole (g/mol). For ionic compounds such as sodium chloride, “formula mass” is the more precise term, but the addition method is the same.

Formula used

Molar mass = Σ (number of atoms of each element × its atomic weight)

For water (H₂O): (2 × 1.008) + (1 × 15.999) = 18.015 g/mol.

How to use this calculator

  1. Enter the chemical formula with element symbols correctly capitalized.
  2. Use numbers for subscripts, such as C6H12O6 for glucose.
  3. Use parentheses or square brackets for grouped atoms, such as Ca(OH)2.
  4. Choose the number of decimal places and select Calculate weight.
  5. Review the total molar mass and the contribution from each element.

Examples of molecular weight

CompoundFormulaApprox. molar mass
WaterH₂O18.015 g/mol
Carbon dioxideCO₂44.009 g/mol
Sodium chlorideNaCl58.440 g/mol
GlucoseC₆H₁₂O₆180.156 g/mol
Sulfuric acidH₂SO₄98.072 g/mol
Calcium hydroxideCa(OH)₂74.092 g/mol

Frequently asked questions

Is molecular weight the same as molar mass?

They are often used interchangeably in everyday chemistry. Strictly, relative molecular mass is dimensionless, while molar mass has units such as g/mol.

How do I enter subscripts?

Type the subscript as a normal number: write H2O instead of H₂O and C6H12O6 instead of C₆H₁₂O₆.

Can I use brackets?

Yes. Parentheses and square brackets can group atoms, and a number after the closing bracket multiplies the whole group. For example, Ca(OH)2 contains one calcium, two oxygen, and two hydrogen atoms.

Does this support hydrates?

Yes. Use a dot or middle dot to separate the hydrate part, for example CuSO4·5H2O. The number after the dot multiplies the following formula.

Why might another calculator show a slightly different answer?

Atomic weights may be rounded differently across reference tables. This tool uses a practical set of abridged standard atomic weights, so small differences can occur.