Molecular Weight Calculator

Enter a chemical formula to calculate its molecular weight (molar mass) in g/mol. Supports parentheses, e.g. Ca(OH)₂.

Chemical Formula

Molecular Weight
18.0150 g/mol
Formula: H2O

Element Breakdown

SymbolElementCountAtomic WtContribution%
HHydrogen21.00802.016011.2%
OOxygen115.999015.999088.8%
Total18.0150100%

Common Molecular Weights

CompoundFormulaMW (g/mol)
WaterH2O18.015
Carbon DioxideCO244.01
Salt (NaCl)NaCl58.443
Sulfuric AcidH2SO498.079
GlucoseC6H12O6180.16
EthanolC2H5OH46.068
AmmoniaNH317.031
MethaneCH416.043

Lena has weighed out 90 g of glucose and her lab sheet asks for moles. Daniel needs 1.461 g of sodium chloride to make 250 mL of a 0.100 M solution. Both answers start from one number, the molar mass of the compound, which is just the atomic weights of every atom in the formula added together. Enter C6H12O6 or NaCl here and you get grams per mole plus a table showing how much mass each element contributes.

Adding up atoms: the molar mass sum

Molecular weight M = Σ (atomic weight × atom count), taken over every element in the formula. Subscripts give the counts, and an element with no subscript counts once. A number after a closing parenthesis multiplies everything inside it, so Ca(OH)2 contains 1 Ca, 2 O and 2 H.

Once you have M, the two conversions you usually need are moles = mass ÷ M and mass = moles × M. The atomic weights used here are the conventional values to three or four significant decimals, for example H 1.008, C 12.011, O 15.999, Na 22.990 and Cl 35.453. They are averages over natural isotope mixtures, which is why the result is a molar mass in g/mol and not the mass of one specific molecule.

Worked example, Ca(OH)2. Calcium contributes 40.078. Oxygen contributes 2 × 15.999 = 31.998. Hydrogen contributes 2 × 1.008 = 2.016. The total is 40.078 + 31.998 + 2.016 = 74.092 g/mol, displayed as 74.0920. Mass percents come out at 54.1% Ca, 43.2% O and 2.7% H. A 7.4 g sample is then 7.4 ÷ 74.092 = 0.0999 mol.

How to Use This Calculator

  1. Type the formula into the Formula box. Capitalization matters: each element starts with a capital letter and any second letter is lowercase.
  2. Use parentheses for groups, as in (NH4)2SO4 or Mg3(PO4)2. Nested groups work too.
  3. Or click one of the chips under the box (H2O, CO2, NaCl and so on) to load a common compound.
  4. Read the molecular weight in g/mol, shown to four decimals.
  5. Open the Element Breakdown table to see each element's count, atomic weight, contribution and percentage of the total.

Frequently Asked Questions

Why do CO and Co give different answers?

Case tells the parser where one element ends. CO is carbon plus oxygen at 28.0100 g/mol; Co is the single element cobalt at 58.9330. If you type everything lowercase, such as nacl, no element is recognized and you will see 0.0000 g/mol.

Can it handle hydrates like CuSO4·5H2O?

Not with the dot. The parser skips the dot and the coefficient, so CuSO4·5H2O returns 177.6220, which is wrong. Write the water as a group instead: CuSO4(H2O)5 gives 249.6820 g/mol.

What does 'Unknown element(s)' mean?

The built-in table has 58 elements, not the whole periodic table. Tungsten (W), for instance, is missing, so WO3 gets that error. Check for a typo first, then for a rarer element.

Is molecular weight the same as molar mass or formula mass?

The numbers are identical. Molecular weight is the older name for covalent molecules, formula mass is the term usually used for ionic compounds like NaCl, and molar mass is the same value expressed in g/mol.

How many digits should I carry into my own work?

Match your balance. Atomic weights for some elements are now published by IUPAC as ranges, so the third or fourth decimal can differ between textbooks. Rounding the molar mass to one or two decimals is fine for most lab arithmetic.