Math & Statistics

Molar Mass Calculator

Type a chemical formula to get its molar mass in g/mol, a breakdown of every element with its mass percent, and a quick grams to moles converter. Brackets, nested groups and hydrates such as CuSO4·5H2O are supported.

Free, runs in your browserUpdated October 2026IUPAC standard atomic weights (2024)
Element symbols are case-sensitive: Co is cobalt, CO is carbon monoxide. Use ( ) or [ ] for groups. For hydrates, use a dot, a star or a middle dot, as in CuSO4·5H2O.
Examples
Molar mass of –
–
Atoms per formula unit–
Elements–
Moles–
Formula units–
ElementAtomsAtomic massMassMass %

Molar mass calculator diagram: glucose C6H12O6 summed from atomic weights gives 180.156 g/mol
How the Molar Mass Calculator works: Molar mass in g/mol with a full element breakdown.

How to use the molar mass calculator

How to use the molar mass calculator: type a chemical formula, add an amount and unit, then read the molar mass
Numbered steps on the Molar Mass Calculator. Follow them in order.
  1. Type a chemical formula. Symbols are case-sensitive, and brackets and hydrates work.
  2. Optionally enter an amount to convert between grams and moles.
  3. Choose the unit: grams, milligrams, kilograms, moles or millimoles.
  4. Read the molar mass in g/mol, then the mass percent of each element below.

Type a chemical formula and the molar mass appears in grams per mole, together with a table showing how many atoms of each element there are, each element's contribution and its mass percent. Element symbols are case-sensitive, exactly as on the periodic table: Co is cobalt, while CO is carbon monoxide.

Groups in round or square brackets are multiplied by the number after them, so Ca(OH)2 contains two O and two H, and K4[Fe(CN)6] contains six C and six N. For hydrates, separate the water with a dot, a star or a middle dot, as in CuSO4·5H2O or CuSO4*5H2O. A trailing charge such as SO4^2- is ignored, because electrons add almost no mass. Enter an amount in grams or moles to convert between them.

Molar mass formula

M = Σ (number of atoms of element × standard atomic weight)
moles n = mass m ÷ M    mass m = n × M
particles = n × NA, NA = 6.02214076 × 1023 mol−1

The molar mass in g/mol has the same number as the relative molecular mass (molecular weight) in atomic mass units, which is why the two terms are often used interchangeably.

Worked example: glucose

Glucose is C6H12O6.

  • Carbon: 6 × 12.011 = 72.066
  • Hydrogen: 12 × 1.008 = 12.096
  • Oxygen: 6 × 15.999 = 95.994
  • Total: 72.066 + 12.096 + 95.994 = 180.156 g/mol

Carbon makes up 72.066 ÷ 180.156 = 40.0% of the mass. A 10 g sample contains 10 ÷ 180.156 = 0.0555 mol, or about 3.34 × 1022 molecules.

Hydrate example

For CuSO4·5H2O, add the anhydrous salt and five waters: 63.546 + 32.06 + 4 × 15.999 = 159.602 for CuSO4, plus 5 × 18.015 = 90.075 for the water, for a total of 249.677 g/mol.

Molar masses of common compounds

CompoundFormulaMolar mass (g/mol)
WaterH2O18.015
Carbon dioxideCO244.009
Sodium chlorideNaCl58.440
Sulfuric acidH2SO498.072
Calcium hydroxideCa(OH)274.092
GlucoseC6H12O6180.156

Atomic weight data

The calculator uses the standard atomic weights published by the IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW), including the 2024 revisions for gadolinium, lutetium and zirconium. Some elements, such as hydrogen, carbon and oxygen, have an interval rather than a single value because their isotope mix varies in nature. For those, the IUPAC abridged conventional values are used, for example 1.008 for hydrogen and 12.011 for carbon. Elements with no stable isotopes, such as technetium and radon, use the mass number of their longest-lived isotope.

Notes

Results are shown to three decimal places, which matches the precision of most textbook and laboratory work. Isotopically labeled compounds (for example deuterium, D) are not supported. Mass percent assumes the formula as written, so for a hydrate it includes the water.

Frequently asked questions

How do you calculate molar mass?

Multiply the number of atoms of each element by its atomic weight from the periodic table and add the results. For water, 2 × 1.008 + 15.999 = 18.015 g/mol.

What is the difference between molar mass and molecular weight?

Molar mass is the mass of one mole of a substance in g/mol. Molecular weight is the mass of one molecule in atomic mass units. They have the same numerical value.

How do I convert grams to moles?

Divide the mass in grams by the molar mass. For 36 g of water, 36 ÷ 18.015 = 2.0 mol. To go from moles to grams, multiply by the molar mass.

How do I enter a hydrate?

Put a dot, star or middle dot between the salt and the water, with the number of water molecules in front: CuSO4·5H2O, MgSO4*7H2O or CaCl2.2H2O.

Why are element symbols case-sensitive?

Because capital letters mark the start of each symbol. Co means cobalt, but CO means one carbon and one oxygen atom, and the two have very different masses.