Free tool

Molecular weight calculator, molar mass of any formula.

Type a chemical formula such as H2O, Ca(OH)2 or CuSO4.5H2O, or click elements in the periodic table, and this molecular weight calculator gives the molar mass in grams per mole. It shows each element with its count, atomic weight, mass and percent by mass, the working line by line, and turns grams into moles and back. Nested brackets and hydrates work, and a charge at the end is ignored. It is a reference tool for study and lab work.

Periodic table: click an element to add it to the formula

Elements in a dimmer colour have no standard atomic weight. The mass number of their longest-lived isotope is used instead.

Grams and moles

Weights: IUPAC CIAAW abridged standard atomic weights 2024, checked 26 Oct 2026. Capital letters matter: Co is cobalt, CO is carbon monoxide.

Worked out in your browser. Nothing is sent anywhere.

Common compounds

Molar mass of the usual suspects.

Click a formula to load it into the calculator above. Values use the same atomic weights as the calculator.

Guide

How to calculate molecular weight, with worked examples.

A molecular weight calculator adds up the atomic weights of every atom in a chemical formula to give its molar mass, in grams per mole (g/mol). Water, H2O, has two hydrogen atoms and one oxygen atom, so its molar mass is 2 × 1.008 + 15.999 = 18.015 g/mol. The numbers are the same whether you call it molecular weight, molecular mass, formula weight or molar mass for study purposes: the calculation is the same. This one handles brackets, hydrates and long formulas, and shows how much of the total each element makes up.

How to use the molecular weight calculator

  1. Type a formula into Chemical formula, such as Ca(OH)2. Or click elements in the periodic table to build one.
  2. Use the bracket and dot buttons for brackets and for the dot in a hydrate. Back removes the last character and Clear empties the box.
  3. Read the big card for the molar mass. Under it, the table lists each element, the number of atoms, the atomic weight, the mass it adds and its percent by mass. The working line shows the sum.
  4. Pick Decimals to show 2, 3 or 4 decimal places.
  5. To convert, type an Amount and choose grams or moles. The card shows the other one.
  6. Use a compound from the list below the tool to load a formula in one click. Copy result copies one line and Copy link a link that opens with your formula.

How formulas are read

  • An element symbol starts with a capital letter and may have one small letter: Co is cobalt, CO is carbon and oxygen.
  • A number after a symbol or a closing bracket multiplies it. Ca(OH)2 means one calcium, two oxygen and two hydrogen.
  • Round (), square [] and curly {} brackets can be nested, as in [Fe(CN)6].
  • A hydrate is written with a dot, a middle dot or a star: CuSO4.5H2O, CuSO4·5H2O and CuSO4*5H2O are the same. The number in front of the water multiplies that whole part.
  • A charge at the end is ignored, because the mass of the electrons is far too small to show. Write it as SO4^2- or with a space, SO4 2-. A bare NH4+ works too. A number between a closing bracket and the sign, as in [Fe(CN)6]3-, is read as part of the charge. A bare SO42- cannot be told from a count of 42 oxygens, so use the caret.

Worked examples

Calcium hydroxide, Ca(OH)2. The bracket holds one oxygen and one hydrogen, and the 2 doubles them. Calcium is 40.078, two oxygens are 31.998 and two hydrogens are 2.016. The total is 74.092 g/mol.

Copper sulfate pentahydrate, CuSO4.5H2O. The CuSO4 part is 63.546 + 32.06 + 4 × 15.999 = 159.602. Five waters are 5 × 18.015 = 90.075. Together they are 249.677 g/mol. The page shows the combined Hill formula, CuH10O9S, because it adds every atom.

Glucose, C6H12O6. Carbon is 6 × 12.011 = 72.066, hydrogen is 12 × 1.008 = 12.096 and oxygen is 6 × 15.999 = 95.994. The total is 180.156 g/mol. By mass that is 40.00 percent carbon, 6.71 percent hydrogen and 53.28 percent oxygen.

From grams to moles. 36 g of water is 36 ÷ 18.015 = 1.998 mol. In the other direction, 2 mol of NaCl is 2 × 58.44 = 116.88 g.

Checked against a published source

These results were compared with the molecular weights PubChem lists for the same compounds (checked 26 Oct 2026). The first decimals match. The second can differ by a hundredth because PubChem rounds and may use different atomic weights.

CompoundFormulaThis pagePubChem
WaterH2O18.01518.015
Sodium chlorideNaCl58.44058.44
GlucoseC6H12O6180.156180.16
Calcium hydroxideCa(OH)274.09274.09
Calcium carbonateCaCO3100.086100.09
Sulfuric acidH2SO498.07298.08
AmmoniaNH317.03117.031
EthanolC2H5OH46.06946.07
SucroseC12H22O11342.297342.30
Potassium permanganateKMnO4158.032158.034

Where the atomic weights come from

The atomic weights are the abridged standard atomic weights 2024 of the IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW), read at ciaaw.org on 26 Oct 2026. For fourteen elements the true standard weight is a range, because their isotope mix differs between samples: hydrogen, lithium, boron, carbon, nitrogen, oxygen, magnesium, silicon, sulfur, chlorine, argon, bromine, thallium and lead. For those the page uses the single abridged value that CIAAW prints, which is the one used in textbooks. For high-precision work, use the range from CIAAW for your material.

Technetium, promethium and every element after bismuth except thorium, protactinium and uranium have no standard atomic weight, because none of their isotopes is stable or common enough. For them the page uses the mass number of the longest-lived isotope, taken from the CIAAW list of radioactive elements (checked 26 Oct 2026). Technetium and meitnerium are ties on that list, and the page uses 98 and 278. The result card tells you when this happens. Treat those results as approximate.

Common problems

  • "Not an element symbol" usually means a small letter where a capital belongs, such as h2o.
  • An unmatched bracket gets its own message with the bracket that is missing.
  • Isotope labels, bonds, and ionic charges in the middle of a formula are not supported. Type the plain formula.

This is a reference tool for study, labs and homework, not a replacement for a safety data sheet. For related maths, try the scientific calculator and the percentage calculator.

Questions

Good to know.

How do you calculate molecular weight?

Multiply the atomic weight of each element by the number of its atoms in the formula and add them. Water is 2 × 1.008 + 15.999 = 18.015 g/mol.

What is the molecular weight of water?

18.015 g/mol, from two hydrogens at 1.008 and one oxygen at 15.999. It is often rounded to 18.

What is the difference between molecular weight and molar mass?

Molecular weight is the mass of one molecule in atomic mass units. Molar mass is the mass of one mole in g/mol. The number is the same, so this page gives one value for both.

How do I enter a hydrate like CuSO4.5H2O?

Type a dot, a middle dot or a star between the parts, then the number and the water: CuSO4.5H2O. The number multiplies the whole part after the dot.

Can I use brackets in a formula?

Yes. Round, square and curly brackets work and can be nested, for example Ca3(PO4)2 or [Fe(CN)6].

What is percent by mass?

The share of the total molar mass that one element supplies. In water, hydrogen is 2.016 of 18.015, which is 11.19 percent, and oxygen is 88.81 percent.

How do I convert grams to moles?

Divide the grams by the molar mass. 36 g of water is 36 ÷ 18.015 = 1.998 mol. Type the grams under Amount and the page does it for you.

Why does my answer differ slightly from a textbook?

Books round atomic weights differently. This page uses the IUPAC abridged values, so the second or third decimal can differ from another source.

Does it work for elements like plutonium?

Yes, but those elements have no standard atomic weight. The page uses the mass number of the longest-lived isotope and marks the result as approximate.