Molar Mass and Molecular Weight Calculator

Parse a chemical formula to calculate approximate molar mass, relative formula mass, and elemental mass percentages.

Molar mass and molecular weight from a chemical formula

Formula mass is the sum of the average atomic masses for every atom represented in a chemical formula. Its numerical value is approximately equal to molar mass in g/mol when the same atomic-weight convention is used.

For covalent substances, formula mass is commonly called molecular mass. For ionic compounds, formula mass is preferable because the solid is described by formula units rather than discrete molecules.

How to calculate molecular weight

  1. Enter a formula: Use case-sensitive element symbols, positive integer subscripts, and parentheses where needed.
  2. Calculate: Parse the formula and sum the atomic-weight contributions.
  3. Review composition: Check element counts, g/mol contributions, and mass percentages.
  4. Confirm conventions: Use isotope-specific or supplier values when average atomic weights are not appropriate.

Formula and variables

Multiply each element’s representative atomic weight by its subscript, then sum all contributions.

M = Σ(nᵢAᵣ,ᵢ); mass %ᵢ = nᵢAᵣ,ᵢ/M × 100%
MMolar mass
Sum of elemental mass contributions (g/mol)
nᵢElement count
Number of atoms of element i in the formula (dimensionless)
Aᵣ,ᵢRelative atomic mass
Representative average atomic weight for element i (dimensionless)

Water molar mass

Calculate H₂O using representative atomic weights H = 1.008 and O = 15.999.

Formula
H₂O
  1. M = 2(1.008) + 1(15.999)
  2. M = 18.015 g/mol

Result: The approximate molar mass is 18.015 g/mol.

Oxygen contributes about 88.81% and hydrogen about 11.19% by mass.

Understanding your results

Atomic-weight conventions determine precision

Standard atomic weights can be intervals because natural isotopic composition varies. The calculator uses one representative rounded value per element.

  • Element symbols are case-sensitive.
  • Parenthetical groups are multiplied by the following subscript.
  • Percent contributions should total approximately 100%, subject to rounding.
  • Bracketed mass numbers for elements without stable isotopes are representative, not standard atomic weights.

Assumptions

  • The formula is neutral notation supported by the parser.
  • Representative average atomic weights are suitable for the material.
  • Every subscript is a positive whole number.

Limitations

  • Does not parse hydrate dots, charges, leading coefficients, isotope labels, variable composition, polymers, or nested square brackets.
  • Does not distinguish structural isomers or verify chemical plausibility.
  • Static rounded atomic weights may differ from isotope-specific, interval, or supplier-reported molar masses.

Common mistakes

  • Changing element-symbol capitalization.
  • Omitting parentheses around a repeated polyatomic group.
  • Calling an ionic formula unit a molecule.
  • Reporting more precision than the atomic weights and sample composition justify.

Practical use cases

Chemistry coursework

Calculate formula mass and percent composition from a valid formula.

Mole conversions

Supply an approximate molar mass for subsequent grams-to-moles calculations.

Frequently asked questions

Are molecular weight and molar mass the same?

They are closely related and usually numerically equal, but relative molecular mass is dimensionless while molar mass is expressed in g/mol.

Can I enter parentheses?

Yes. Formulas such as Ca(OH)2 are supported.

Why might a supplier list a different value?

Differences can reflect hydration, purity, counterions, isotopic composition, or more precise atomic-weight conventions.

Sources and review

Reviewed 2026-07-13.

Continue with calculators that answer nearby questions and help compare the next step.