Molecular Weight Calculator: Molar Mass from a Formula

Enter a chemical formula to find molar mass, total atom count and percentage composition. Nested groups and hydrate water are included. You can also convert between grams and moles using the same formula mass.

Your details

Mass and moles

Symbols are case sensitive: Co is cobalt; CO is carbon monoxide. Use integer counts, round or square brackets and ·, * or . for hydrates.

Your formula massMolar mass
18.015 g/mol
Hill-system formula
H2O
Total atom count
3
Working
2 × 1.008 (H) + 1 × 15.999 (O) = 18.015 g/mol
Element composition
ElementCountAtomic weightSubtotal (g/mol)Mass %
Hydrogen (H)21.0082.01611.19%
Oxygen (O)115.99915.99988.81%

Uses IUPAC CIAAW abridged standard atomic weights. Brackets flag isotope mass numbers where no standard weight exists. Natural isotope variation affects atomic weights. Displayed mass percentages may not total exactly 100% after rounding.

How it works

Molar mass = Σ(atom count × atomic weight). Mass % = element subtotal ÷ molar mass × 100. Moles = grams ÷ molar mass.

  • Enter the formula with correct symbol case.
  • Use brackets for repeated groups and a dot for hydrate water.
  • Read molar mass and the element composition.
  • Optionally enter grams or moles to convert the amount.

Worked example: H2O contains 2 hydrogen atoms and 1 oxygen atom. Its molar mass is 2 × 1.008 + 15.999 = 18.015 g/mol. A mass of 36.03 g is 2.000 mol.

Things to consider

  • Use Co for cobalt and CO for carbon monoxide.
  • A count after a bracket multiplies the whole group.
  • Include water of crystallisation in hydrates.
  • Use the full molar mass for further calculations.
  • This is not an isotope-specific exact-mass calculator.

Frequently asked questions

What is the difference between molecular weight, molar mass and formula mass?

Relative molecular mass, often called molecular weight, is a dimensionless ratio. Molar mass is the mass per mole, in g/mol, and is numerically approximately equal to relative molecular mass. Formula mass applies to a formula unit, including ionic solids such as NaCl, which do not consist of individual NaCl molecules.

How do I calculate molar mass from a formula?

Count each element's atoms, multiply each count by its atomic weight and add the subtotals. For H2O, 2 × 1.008 + 15.999 = 18.015 g/mol. A multiplier after parentheses or square brackets applies to every atom inside.

Why do atomic weights have decimal values?

Most standard atomic weights average the masses of naturally occurring isotopes according to their abundance. Isotope proportions can vary between samples, so some elements have an interval rather than one exact standard weight. This calculator uses CIAAW abridged or conventional values, not isotope-specific masses.

How are hydrates calculated?

A hydrate dot adds the following formula, multiplied by its leading number. CuSO4·5H2O includes one Cu, one S, nine O and ten H atoms, giving 249.677 g/mol. You can enter the separator as ·, * or a period. Periods mean hydrate separators, not decimal atom counts.

How do I calculate mass percent composition?

Divide an element's mass subtotal by the total molar mass, then multiply by 100. Oxygen contributes 31.998 g/mol to CO2, whose total is 44.009 g/mol, so oxygen is 72.71% by mass. Percentages are rounded separately to two decimal places.

How do I convert grams to moles and back?

Divide grams by molar mass to get moles. Multiply moles by molar mass to get grams. For water, 36.03 g ÷ 18.015 g/mol = 2.000 mol. The helper uses the unrounded calculated molar mass.

What do bracketed atomic weights mean?

For elements without a standard atomic weight, the table uses the IUPAC periodic table's bracketed mass number of a representative longest-lived confirmed isotope. This is a mass number, not a measured standard atomic weight. The output flags these approximate values. Naturally radioactive elements such as uranium and thorium still have standard atomic weights and use those values.

Are ion charges included in molar mass?

A final charge suffix such as ^2- in SO4^2- is ignored and noted. Atom counts remain unchanged. Electron mass is not included. Use a caret for a numbered charge to avoid confusing it with an atom count.

What is the Hill-system formula?

When carbon is present, Hill order lists C first, H second, then other symbols alphabetically. Without carbon, all symbols are alphabetical, including H. Repeated groups and hydrate components are combined into total atom counts.

Results are estimates for general information only, not financial, medical or professional advice.