Relative Formula Mass

Molecular Weight Calculator

Enter a chemical formula. The calculator gives its molar mass, molecular weight, atom count, and element composition.

1

Enter a chemical formula

Use the correct uppercase and lowercase letters in each element symbol. Examples are H2O and NaCl.
Select a compound. The calculator enters its formula and calculates the result.
Examples
2

Your result

Enter a chemical formula

For example: H2O, NaCl, or Ca(OH)2.

Molecular weight vs molar mass vs molecular mass

MW means molecular weight: the sum of the atomic weights of all atoms in a molecule. Molecular mass and molar mass give the same number with different units.

A mass of 18.015 u for one water molecule equals 18.015 g for one mole of water molecules.

TermUnitWhat it describesWater
Molecular weight (MW)g/mol or DaSum of atomic weights in one molecule18.015
Molecular massu or DaMass of one molecule18.015 u
Molar mass (M)g/molMass of one mole of the substance18.015 g/mol
Formula massuSame sum for ionic compounds such as NaCl58.44 u for NaCl

Calculate molecular weight by hand

Molecular weight = Σ (number of atoms × atomic weight)

  1. Write the chemical formula, for example C6H12O6.
  2. Count the atoms of each element. Multiply out brackets and hydrate water.
  3. Multiply each atom count by the atomic weight of the element in g/mol.
  4. Add the results. The sum is the molecular weight in g/mol.

Molecular weight examples

CompoundFormulaCalculationMolecular weight (g/mol)
WaterH2O2 × 1.008 + 15.99918.015
Carbon dioxideCO212.011 + 2 × 15.99944.009
GlucoseC6H12O66 × 12.011 + 12 × 1.008 + 6 × 15.999180.156
Sodium chlorideNaCl22.990 + 35.4558.44
Sulfuric acidH2SO42 × 1.008 + 32.06 + 4 × 15.99998.072
Calcium hydroxideCa(OH)240.078 + 2 × (15.999 + 1.008)74.092

Molecular weight of hydrates and complex salts

Treat each part after a dot as a separate unit with its own coefficient. Treat each bracket as a group, then add everything.

Example 1

Copper(II) sulfate pentahydrate, CuSO4·5H2O

  1. CuSO4 = 63.546 + 32.06 + 4 × 15.999 = 159.602 g/mol.
  2. 5 H2O = 5 × 18.015 = 90.075 g/mol.
  3. 159.602 + 90.075 = 249.677 g/mol.

Answer: 249.677 g/mol

Example 2

Potassium alum, K2SO4·Al2(SO4)3·24H2O

  1. K2SO4 = 2 × 39.098 + 32.06 + 4 × 15.999 = 174.252 g/mol.
  2. Al2(SO4)3 = 2 × 26.982 + 3 × (32.06 + 4 × 15.999) = 342.132 g/mol.
  3. 24 H2O = 24 × 18.015 = 432.360 g/mol.
  4. 174.252 + 342.132 + 432.360 = 948.744 g/mol.

Answer: 948.744 g/mol

Example 3

Hexaamminecobalt(III) chloride, [Co(NH3)6]Cl3

  1. Co = 58.933 g/mol.
  2. 6 NH3 = 6 × (14.007 + 3 × 1.008) = 102.186 g/mol.
  3. 3 Cl = 3 × 35.45 = 106.350 g/mol.
  4. 58.933 + 102.186 + 106.350 = 267.469 g/mol.

Answer: 267.469 g/mol

Grams, moles, and molecules

moles = mass (g) ÷ molecular weight (g/mol)

mass (g) = moles × molecular weight (g/mol)

molecules = moles × 6.02214076 × 10^23 (the Avogadro constant)

Example: 36.0 g of water is 36.0 ÷ 18.015 = 2.00 mol, or 1.20 × 10^24 molecules. Use the converter below each result for these steps.

Molecular weight of DNA, RNA, and proteins

Biomolecules are long chains with thousands of atoms. Enter their sequence instead of a formula in a sequence calculator.

Atomic weight data

Average atomic weights come from the PubChem periodic table (snapshot 2026-08-28). Exact isotope masses come from NIST Atomic Weights and Isotopic Compositions, version 2.4.1.

IUPAC gives the atomic weight of some elements as a range, because their isotope ratios vary in nature. The table shows the single value this calculator uses for each.

ElementIUPAC rangeValue used here
H1.00784 to 1.008111.008
Li6.938 to 6.9976.94
B10.806 to 10.82110.81
C12.0096 to 12.011612.011
N14.00643 to 14.0072814.007
O15.99903 to 15.9997715.999
Mg24.304 to 24.30724.305
Si28.084 to 28.08628.085
S32.059 to 32.07632.06
Cl35.446 to 35.45735.45
Ar39.792 to 39.96339.9
Br79.901 to 79.90779.904
Tl204.382 to 204.385204.383
Pb206.14 to 207.94207

Embed this calculator

Teachers and course sites can embed the calculator for free. Copy this code into any web page.

Add ?formula=CuSO4.5H2O to the address to open the calculator with a formula.

<iframe src="https://chemcalculator.com/molecular-weight-calculator?embed=1" title="Molecular Weight Calculator" width="100%" height="640" loading="lazy" style="border:0"></iframe>

How to calculate molecular weight

  1. Enter the chemical formula.
  2. Use the correct uppercase and lowercase letters for each element symbol.
  3. If the formula has a group, use parentheses or brackets.
  4. If the formula has water of hydration, put a dot before the water.
  5. If the formula has an isotope label or an ionic charge, include it.
  6. Select Calculate.

Molecular weight formula

M = Σ(nᵢ × Aᵢ)

SymbolMeaningUnit
nᵢnumber of atoms for element iatoms
Aᵢatomic mass for element iu
Mmolecular weightu

Worked example

For water, the formula is H2O. The H2O formula has two hydrogen atoms and one oxygen atom. The calculation is (2 x 1.0080) + (1 x 15.999). The molar mass is 18.015 g/mol.

Chemical formula formats

Enter the chemical formula. The calculator reads groups, hydrates, isotope labels, and ionic charges.

FormatEnterExample compound
Simple formulaC6H12O6Glucose
ParenthesesCa(OH)2Calcium hydroxide
Nested groupsK4[Fe(CN)6]Potassium ferrocyanide
HydrateCuSO4.5H2OCopper sulfate pentahydrate
Charged ion[Fe(CN)6]3-Ferricyanide

Molecular weight and molar mass

For one chemical formula, molecular weight and molar mass have the same numerical value. Molecular weight uses the unit u or Da. Molar mass uses the unit g/mol. Monoisotopic mass uses one specified isotope of each element. The monoisotopic mass can be different from the average molecular weight.

Common mistakes

  • Do not enter a compound name in the Chemical formula field.
  • Use the correct uppercase and lowercase letters. CO is carbon monoxide. Co is cobalt.
  • Use a dot before the water in a hydrate.

Frequently asked questions

Do molecular weight and molar mass have the same value?

Yes. The numbers are equal for the same chemical formula. Molecular weight uses u or Da. Molar mass uses g/mol.

Can the calculator read hydrates and isotope labels?

Yes. Use a dot before the water in a hydrate. Put the isotope number before the element symbol.

Does capitalization matter in a chemical formula?

Yes. Element symbols are case-sensitive. CO is carbon monoxide. Co is cobalt.

Can I use parentheses and brackets?

Yes. Use parentheses or brackets for a group. Examples are Ca(OH)2 and [Fe(CN)6]3-.

What is monoisotopic mass?

Monoisotopic mass uses the exact mass of one isotope for each element. The calculator uses the most abundant isotope unless the formula specifies an isotope.

Which atomic masses does the calculator use?

The calculator uses average atomic masses for all 118 elements. The PubChem data set gives these masses. NIST data gives exact isotope masses.

What is MW in chemistry?

MW means molecular weight. It is the sum of the atomic weights of all atoms in a molecule, given in g/mol or Da.

How do you calculate the molecular weight of a hydrate?

Add the mass of the salt and the mass of the water. For CuSO4·5H2O, 159.602 + 5 × 18.015 = 249.677 g/mol.

Can I type a lowercase formula such as co2?

Yes. The calculator suggests a corrected formula, such as CO2 or Co2. It does not change your input without asking.

Can I enter a compound name or CAS number?

Yes. Enter a common name such as water or a CAS number such as 7732-18-5. The calculator shows the formula it used.

How do I get the m/z of an ion?

Write the charge with a caret, such as SO4^2-. Open the advanced details for the ion m/z, adduct ions, and the isotope pattern.

Atomic mass data

The table contains data for all 118 elements. The calculator uses average atomic masses for natural elements. It uses listed isotope masses for radioactive elements.

Complete table for 118 elements
Atomic numberElementSymbolAtomic mass (u)
1HydrogenH1.0080
2HeliumHe4.00260
3LithiumLi6.94
4BerylliumBe9.012183
5BoronB10.81
6CarbonC12.011
7NitrogenN14.007
8OxygenO15.999
9FluorineF18.998
10NeonNe20.180
11SodiumNa22.990
12MagnesiumMg24.305
13AluminumAl26.982
14SiliconSi28.085
15PhosphorusP30.974
16SulfurS32.06
17ChlorineCl35.45
18ArgonAr39.9
19PotassiumK39.098
20CalciumCa40.078
21ScandiumSc44.95591
22TitaniumTi47.867
23VanadiumV50.9415
24ChromiumCr51.996
25ManganeseMn54.93804
26IronFe55.845
27CobaltCo58.93319
28NickelNi58.693
29CopperCu63.546
30ZincZn65.38
31GalliumGa69.723
32GermaniumGe72.63
33ArsenicAs74.92159
34SeleniumSe78.97
35BromineBr79.904
36KryptonKr83.80
37RubidiumRb85.468
38StrontiumSr87.62
39YttriumY88.90584
40ZirconiumZr91.22
41NiobiumNb92.90637
42MolybdenumMo95.95
43TechnetiumTc96.90636
44RutheniumRu101.1
45RhodiumRh102.9055
46PalladiumPd106.42
47SilverAg107.868
48CadmiumCd112.41
49IndiumIn114.818
50TinSn118.71
51AntimonySb121.760
52TelluriumTe127.6
53IodineI126.90
54XenonXe131.29
55CesiumCs132.9054520
56BariumBa137.33
57LanthanumLa138.9055
58CeriumCe140.116
59PraseodymiumPr140.90766
60NeodymiumNd144.24
61PromethiumPm144.91276
62SamariumSm150.4
63EuropiumEu151.964
64GadoliniumGd157.25
65TerbiumTb158.92535
66DysprosiumDy162.500
67HolmiumHo164.93033
68ErbiumEr167.26
69ThuliumTm168.93422
70YtterbiumYb173.05
71LutetiumLu174.9667
72HafniumHf178.49
73TantalumTa180.9479
74TungstenW183.84
75RheniumRe186.207
76OsmiumOs190.2
77IridiumIr192.22
78PlatinumPt195.08
79GoldAu196.96657
80MercuryHg200.59
81ThalliumTl204.383
82LeadPb207
83BismuthBi208.98040
84PoloniumPo208.98243
85AstatineAt209.98715
86RadonRn222.01758
87FranciumFr223.01973
88RadiumRa226.02541
89ActiniumAc227.02775
90ThoriumTh232.038
91ProtactiniumPa231.03588
92UraniumU238.0289
93NeptuniumNp237.048172
94PlutoniumPu244.06420
95AmericiumAm243.061380
96CuriumCm247.07035
97BerkeliumBk247.07031
98CaliforniumCf251.07959
99EinsteiniumEs252.0830
100FermiumFm257.09511
101MendeleviumMd258.09843
102NobeliumNo259.10100
103LawrenciumLr266.120
104RutherfordiumRf267.122
105DubniumDb268.126
106SeaborgiumSg269.128
107BohriumBh270.133
108HassiumHs269.1336
109MeitneriumMt277.154
110DarmstadtiumDs282.166
111RoentgeniumRg282.169
112CoperniciumCn286.179
113NihoniumNh286.182
114FleroviumFl290.192
115MoscoviumMc290.196
116LivermoriumLv293.205
117TennessineTs294.211
118OganessonOg295.216

Sources