Chemistry · INTERACTIVE LAB

Molar mass calculator: formula and worked examples

Calculate molar mass from a chemical formula, with atom counts and worked examples for water, carbon dioxide and salts.

Local computationExplained methodNo account

Before you start

Try H2O, CO2, NaCl, Ca(OH)2 or Al2(SO4)3. Parentheses and integer subscripts are supported.

The answer and the path to it
  1. 01Inputs
  2. 02Model
  3. 03Check
What this model can do

Common elements listed in the tool only; approximate atomic masses. No isotopes, charges, hydrates, reaction balancing or leading coefficients.

More tools: ChemistryPrepare an AI self-test

How to calculate molar mass from a chemical formula

Add each element’s atomic molar mass multiplied by its atom count in the formula. The result is in g/mol. A subscript after parentheses multiplies every atom inside that group.

M = Σ (atom count × atomic molar mass)

Examples you can check in the tool
CaseInputs or expansionExplained result
C1 × 12.01112.011 g/mol
H2O2 × 1.008 + 15.99918.015 g/mol
CO212.011 + 2 × 15.99944.009 g/mol
NaCl22.990 + 35.4558.440 g/mol
Ca(OH)240.078 + 2 × 15.999 + 2 × 1.00874.092 g/mol

For carbon, C gives about 12.011 g/mol; CO2 also contains two oxygen atoms and has a different molar mass. Case matters: Co is cobalt, whereas CO is carbon monoxide. Type H2O with the digit 2, without spaces or a leading coefficient. Values are approximate: use your exercise’s supplied atomic masses if they differ.

How do mass and molar mass differ?

Sample mass m is measured in g. Molar mass M relates that mass to amount of substance n: n = m / M. For example, 36.030 g of water corresponds to 36.030 / 18.015 = 2 mol in this model. The tool expands a formula; it does not balance reactions or handle isotopes or hydrates.

CIAAW · Reference atomic weights; tool values rounded for exercises

Use concentrations in a dilution

Calculate dilution factor with worked exercises