StatGardenREF. DESK
Calculators/Chemistry/Molecular Weight Calculator
Chemistry

Molecular Weight Calculator

Molecular weight of a chemical formula, summing standard atomic weights for each element present.

Published 27 August 2026

What this calculator does

A molecular weight calculator works out the mass of one mole of a compound, in grams per mole, directly from its chemical formula. Water, H2O, has a molecular weight of about 18.015 g/mol because it is made of two hydrogen atoms at roughly 1.008 g/mol each and one oxygen atom at roughly 15.999 g/mol, added together.

This is the everyday chemistry calculation behind converting between grams and moles, working out reaction stoichiometry, or preparing a solution of a known molar concentration. It starts from the formula itself, reading off each element and its subscript, which is a different starting point from working backwards to a molar mass from gas-law measurements of pressure, volume and temperature.

The formula

FormulaMolecular weight = sum of (atomic weight × subscript) for every element in the formula

The formula is read element by element: each capital letter (optionally followed by one lowercase letter) is an element symbol, and any digits immediately after it are the number of atoms of that element. The atomic weight of each element, taken from the standard periodic table, is multiplied by its count and the results are added together. This calculator handles simple formulas without parentheses, such as H2O, NaCl, CaCO3 or C6H12O6.

TermMeaning
Molecular weightThe mass of one mole of the compound, in grams per mole, found by summing atomic weights across the formula.
Atomic weightThe standard average mass of one atom of an element, in grams per mole, as published for that element.
SubscriptThe number written after an element symbol showing how many atoms of it appear in the formula; no number means one atom.

The inputs explained

FieldWhat to enter
Chemical formula (e.g. H2O, NaCl, C6H12O6)Type the chemical formula exactly as written, with capital letters starting each element symbol, such as H2O, NaCl or C6H12O6. Formulas with parentheses are not supported.

When to use it

Converting between grams and moles

Molecular weight is the conversion factor between the mass of a sample and the number of moles it contains, which is the starting point for almost every stoichiometry calculation.

Preparing a solution of known concentration

Making up a solution to a target molarity requires knowing how many grams of the compound correspond to one mole, which is exactly what molecular weight provides.

Checking a formula by hand

Working out a molecular weight by hand from a table of atomic weights is easy to get wrong through a missed subscript or a transposed digit; recalculating it here is a quick check.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

What is the molecular weight of some common compounds?

The same calculation applied to a handful of common compounds.

A few everyday formulas
FormulaMolecular weight
H2O18.015 g/mol
NaCl58.440 g/mol
CO244.009 g/mol
C6H12O6180.156 g/mol
CaCO3100.086 g/mol
Glucose, C6H12O6, comes out heavier than the others here mainly because it contains six carbon atoms, each contributing about 12.011 g/mol on its own.

Questions

What is the difference between molecular weight and molar mass?

In practice the two terms are used interchangeably for most purposes: both describe the mass of one mole of a substance in grams per mole. Some texts reserve "molecular weight" for a technically dimensionless ratio, but the numeric value quoted is the same.

Why does this calculator not support parentheses?

Formulas with grouped subscripts, such as Ca(OH)2, need the group repeated by its own multiplier before summing, which this calculator does not parse. For those formulas, expand the group by hand first, for example writing Ca(OH)2 as CaO2H2, before entering it.

How is this different from the molar mass of a gas calculator?

The molar mass of a gas calculator works backwards to a molar mass from measured pressure, volume, temperature and mass, using the ideal gas law, without needing to know the formula. This calculator instead starts from a known chemical formula and sums atomic weights directly.

Why are atomic weights not whole numbers?

A published atomic weight is a weighted average across an element's naturally occurring isotopes, each with a slightly different mass and a different natural abundance, which is why chlorine, for example, averages to about 35.45 rather than a whole number.

If you are working from measured gas properties rather than a known formula, see the molar mass of a gas calculator.