Molecular Weight Calculator

Calculate the molar mass of any chemical formula in g/mol, including brackets and hydrates, with each element’s share of the mass.

Molecular weight calculator

Use capital letters for the start of each element (Co is cobalt, CO is carbon monoxide). Brackets and hydrates such as ·5H2O or *5H2O are supported.

Molar mass

Atomic weights are IUPAC standard values, abridged. For radioactive elements without a standard atomic weight, the mass number of the longest-lived isotope is used.

On this page

The molecular weight calculator works out the molar mass of any chemical formula in grams per mole, with a breakdown of how much each element contributes and its percentage by mass. Water, H₂O, has a molar mass of 18.015 g/mol: two hydrogen atoms at 1.008 each plus one oxygen atom at 15.999. Glucose, C₆H₁₂O₆, is 180.156 g/mol, and copper sulfate pentahydrate, CuSO₄·5H₂O, is 249.677 g/mol. Enter an amount in moles and the calculator also gives its mass in grams.

It handles brackets, nested brackets and hydrates, so it works for everything from simple salts to coordination compounds such as K₄[Fe(CN)₆]. It’s designed for chemistry students, teachers and laboratory staff preparing solutions or checking stoichiometry.

How to use the molecular weight calculator

  1. Type the chemical formula. Start each element symbol with a capital letter and write any second letter in lower case: Co is cobalt, but CO is carbon monoxide. Put the number of atoms after each symbol, such as H2O or C6H12O6.
  2. Use brackets for groups, such as Ca(OH)2 or Al2(SO4)3. Square brackets also work, as in K4[Fe(CN)6].
  3. Write hydrates with a dot or an asterisk, such as CuSO4·5H2O or CuSO4*5H2O.
  4. Enter an amount in moles (optional) to convert it to grams.
  5. Select Calculate. You’ll see the molar mass and a table with each element’s atom count, atomic weight, mass contribution and mass percentage.

How molar mass is calculated

The molar mass of a compound is the sum of the atomic weights of all the atoms in its formula. Each element’s atomic weight is multiplied by the number of times it appears, and the results are added together.

Worked example: glucose, C₆H₁₂O₆

  • 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 40.00% of glucose by mass, hydrogen 6.71% and oxygen 53.28%.

Worked example with brackets: Al₂(SO₄)₃

The subscript 3 after the bracket multiplies everything inside it, so the formula contains 2 aluminium, 3 sulfur and 12 oxygen atoms. That gives 2 × 26.982 + 3 × 32.06 + 12 × 15.999 = 342.132 g/mol.

Worked example with a hydrate: CuSO₄·5H₂O

The “·5H₂O” means five water molecules are bound in each formula unit of the crystal. The anhydrous part, CuSO₄, has a molar mass of 159.602 g/mol, and five waters add 5 × 18.015 = 90.075 g/mol, for a total of 249.677 g/mol. When preparing a solution from the blue crystals, use the hydrate’s molar mass, not the anhydrous one.

Molar mass, molecular weight and formula mass

These terms are often used interchangeably, with small differences in meaning:

  • Molar mass is the mass of one mole of a substance, in grams per mole (g/mol).
  • Molecular weight, or relative molecular mass, is the same number without units, relative to one twelfth of the mass of a carbon-12 atom.
  • Formula mass is used for ionic compounds such as NaCl, which form lattices rather than discrete molecules.
  • Molecular mass of a single molecule is given in daltons (Da) or atomic mass units (u). One mole of molecules with a mass of 18.015 Da has a mass of 18.015 g.

Where atomic weights come from

Atomic weights are published by the International Union of Pure and Applied Chemistry (IUPAC). They are averages that take into account the natural mix of isotopes of each element on Earth. Chlorine, for example, is about 76% chlorine-35 and 24% chlorine-37, giving an average atomic weight of about 35.45. Because isotope ratios vary slightly between sources, IUPAC gives some elements, such as hydrogen, carbon and oxygen, as intervals, with conventional values for everyday use. This calculator uses the abridged standard values found in most textbooks. Radioactive elements without a stable isotope mix, such as technetium and plutonium, are shown with the mass number of their longest-lived isotope.

Using molar mass in calculations

  • Grams to moles: moles = mass ÷ molar mass. 36.03 g of water is 36.03 ÷ 18.015 = 2.000 mol.
  • Moles to grams: mass = moles × molar mass. 0.5 mol of glucose is 0.5 × 180.156 = 90.078 g.
  • Solutions: combine with volume to find molarity. The molarity calculator does this for you.
  • Percent composition: the mass percentages in the results table are useful for elemental analysis and for working out empirical formulas.
  • Stoichiometry: convert reactant masses to moles, use the balanced equation’s ratios, then convert back to grams of product.

Avogadro’s number and the mole

A mole is a fixed number of particles: exactly 6.02214076 × 10²³, known as Avogadro’s number. The molar mass links this huge number to something you can weigh. Because a water molecule has a mass of about 18.015 daltons, 6.022 × 10²³ water molecules weigh about 18.015 grams. That means a single 18 g sip of water contains about 600,000,000,000,000,000,000,000 molecules. Working in moles lets chemists count particles by weighing them.

Empirical and molecular formulas

Mass percentages can be used in reverse to find a formula. Suppose an analysis shows a compound is 40.00% carbon, 6.71% hydrogen and 53.28% oxygen. In 100 g there are 40.00 ÷ 12.011 = 3.33 mol of C, 6.71 ÷ 1.008 = 6.66 mol of H and 53.28 ÷ 15.999 = 3.33 mol of O, a ratio of 1 : 2 : 1. The empirical formula is CH₂O, with a formula mass of about 30.03. If another measurement shows the molar mass is about 180 g/mol, the molecular formula has 180 ÷ 30.03 ≈ 6 empirical units, giving C₆H₁₂O₆, which is glucose.

Molar mass and gases

For gases, molar mass is linked to density. At 0 °C and 1 atmosphere, one mole of an ideal gas occupies about 22.4 litres, so a gas’s density in grams per litre at those conditions is roughly its molar mass divided by 22.4. Carbon dioxide, at 44.009 g/mol, is therefore about 1.96 g/L at 0 °C, heavier than air, whose average molar mass is about 28.97 g/mol. Helium, at 4.003 g/mol, is about seven times lighter than air, which is why helium balloons float.

Large molecules

Biologists usually express the masses of proteins and DNA in kilodaltons (kDa), where 1 kDa is 1,000 g/mol. A typical protein might be 50 kDa, meaning one mole of it weighs about 50 kg. For such large molecules, the molar mass is calculated from the sequence of amino acids or nucleotides rather than typed as a single formula.

Common molar masses

CompoundFormulaMolar mass (g/mol)
WaterH₂O18.015
Carbon dioxideCO₂44.009
Sodium chlorideNaCl58.440
Calcium hydroxideCa(OH)₂74.092
Sulfuric acidH₂SO₄98.072
GlucoseC₆H₁₂O₆180.156
Copper sulfate pentahydrateCuSO₄·5H₂O249.677

Values from other sources can differ in the second or third decimal place because they use slightly different atomic weights. For most laboratory work, that difference is far smaller than weighing errors.

Common mistakes

  • Wrong capitals: CO (carbon monoxide, 28.010 g/mol) and Co (cobalt, 58.933 g/mol) are completely different. The calculator follows the capitals you type.
  • Forgetting the bracket multiplier: in Ca(OH)₂, there are two oxygen and two hydrogen atoms, not one of each.
  • Ignoring water of crystallisation: many salts are sold as hydrates, which weigh considerably more per mole than the anhydrous form.
  • Mixing up charges: ions such as SO₄²⁻ have essentially the same molar mass as the neutral group, because electrons are very light. Leave charges out of the formula.

Related calculations

You may also find the mass calculator useful to calculate mass from density, force or weight, while the density calculator lets you calculate density from mass and volume.

Frequently asked questions

Multiply each element's atomic weight by the number of its atoms in the formula and add the results. H₂O is 2 × 1.008 + 15.999 = 18.015 g/mol.

180.156 g/mol for C₆H₁₂O₆.

58.44 g/mol: 22.990 for sodium plus 35.45 for chlorine.

Use a dot or an asterisk before the water, such as CuSO4·5H2O or CuSO4*5H2O.

They have the same number. Molar mass has units of g/mol, while molecular weight is a relative value without units.

Sources round atomic weights differently. The differences are usually in the second or third decimal place.

Divide the mass in grams by the molar mass. 36.03 g of water is 2 moles.

Yes. Round and square brackets are supported, including nested ones such as K4[Fe(CN)6].

The share of the compound's mass that comes from each element. Carbon is 40.00% of glucose by mass.

6.02214076 × 10²³, the exact number of particles in one mole. It links the molar mass in grams to the mass of individual molecules.

Convert each percentage to moles per 100 g, find the simplest whole-number ratio to get the empirical formula, then scale it up to match the measured molar mass.

Dry air has an average molar mass of about 28.97 g/mol, mostly from nitrogen and oxygen.

No. Electrons are so light that charges barely change the molar mass, so enter the formula without them.