How do you find the molar mass of a compound?
Count the atoms of each element in the formula, multiply each count by that element's standard atomic weight, and add the results. The total is the mass of one mole in grams. Water, H2O, is 2 × 1.0080 + 15.999 = 18.015 g/mol. Table salt, NaCl, is 58.44 g/mol, glucose, C6H12O6, is 180.16 g/mol and calcium carbonate, CaCO3, is 100.09 g/mol.
The calculator does the counting for you, including brackets like Ca(OH)2, nested brackets like K4[Fe(CN)6] and hydrates like CuSO4·5H2O, which you can also type as CuSO4*5H2O. It uses the IUPAC abridged standard atomic weights, shows every step of the sum, and converts the grams you weigh into moles and molecules. For the method written out by hand, with four worked examples, read how to calculate molar mass step by step.
Key results from the calculator
- Water is 88.8% oxygen by mass, even though two of its three atoms are hydrogen. Hydrogen is so light that it makes up only 11.2% of the mass.
- 10 g of water is 0.5551 mol, about 3.34 × 10²³ molecules.
- Water of crystallisation counts. CuSO4·5H2O is 249.68 g/mol, while anhydrous CuSO4 is 159.60 g/mol. Weigh out the blue crystals using the anhydrous value and you are short by 36%.
- Capital letters matter. Co is cobalt (58.933 g/mol); CO is carbon monoxide (28.010 g/mol). The calculator refuses lower-case input and suggests the formula you most likely meant.
Six compounds people look up most
Each section gives the numbers the calculator shows for that compound and has a button that loads it, with a typical sample mass on the balance.
Molar mass of water, H2O
18.015 g/molTwo hydrogens at 1.0080 and one oxygen at 15.999 give 18.015 g/mol. Most textbooks round this to 18.02 or simply 18 g/mol, and for school problems 18 is fine.
With 10 g on the balance you have 0.5551 mol. A mole of water is 18.02 g, which is about 18 mL, a little more than a tablespoon, and it holds 6.022 × 10²³ molecules.
Molar mass of sodium chloride, NaCl
58.44 g/molSodium 22.990 plus chlorine 35.45 gives 58.44 g/mol. Chlorine's atomic weight is quoted only to 35.45 because its two isotopes vary slightly in natural samples, which is why NaCl has two decimals, not three.
Salt is 39.3% sodium by mass. That is the number behind food labels: 1 g of salt carries about 0.39 g of sodium. NaCl is ionic, so the calculator's particle count means formula units, not molecules.
Molar mass of glucose, C6H12O6
180.16 g/molSix carbons (72.066), twelve hydrogens (12.096) and six oxygens (95.994) add to 180.16 g/mol.
Glucose is 40.0% carbon and 53.3% oxygen by mass. Notice that hydrogen has the most atoms (12 of 24) and the smallest share (6.7%).
Molar mass of calcium carbonate, CaCO3
100.09 g/molCalcium 40.078, carbon 12.011 and three oxygens make 100.086 g/mol, which rounds to 100.09. Chemistry teachers love it because 100 g is almost exactly one mole.
It is 40.0% calcium by mass, the figure behind calcium supplements: a 1,250 mg tablet of calcium carbonate supplies about 500 mg of calcium.
A hydrate: copper(II) sulfate pentahydrate, CuSO4·5H2O
249.68 g/molThe dot means five water molecules are locked into every formula unit of the crystal, and they count. CuSO4 is 159.60 g/mol; add 5 × 18.015 and you get 249.68 g/mol.
Type it with a middle dot, an asterisk (CuSO4*5H2O) or a full stop (CuSO4.5H2O). The water is 36.1% of the crystal's mass, which is what you lose when you heat blue crystals to the white anhydrous powder.
Molar mass of caffeine, C8H10N4O2
194.19 g/molEight carbons, ten hydrogens, four nitrogens and two oxygens give 194.19 g/mol. The 0.2 g on the balance, about the caffeine in two cups of brewed coffee, is 0.00103 mol.
That is still about 6.2 × 10²⁰ molecules. Small masses in milligrams still hold astronomically many molecules, which is why chemists count in moles.
Molar masses of common compounds
| Compound | Formula | Molar mass (g/mol) | Largest share by mass |
|---|---|---|---|
| Water | H2O | 18.015 | O 88.8% |
| Carbon dioxide | CO2 | 44.009 | O 72.7% |
| Oxygen gas | O2 | 31.998 | O 100.0% |
| Nitrogen gas | N2 | 28.014 | N 100.0% |
| Methane | CH4 | 16.043 | C 74.9% |
| Ammonia | NH3 | 17.031 | N 82.2% |
| Ethanol | C2H5OH | 46.069 | C 52.1% |
| Hydrochloric acid | HCl | 36.46 | Cl 97.2% |
| Sulfuric acid | H2SO4 | 98.07 | O 65.3% |
| Sodium hydroxide | NaOH | 39.997 | Na 57.5% |
| Sodium chloride | NaCl | 58.44 | Cl 60.7% |
| Calcium carbonate | CaCO3 | 100.086 | O 48.0% |
| Calcium hydroxide | Ca(OH)2 | 74.092 | Ca 54.1% |
| Potassium permanganate | KMnO4 | 158.032 | O 40.5% |
| Glucose | C6H12O6 | 180.16 | O 53.3% |
| Sucrose | C12H22O11 | 342.30 | O 51.4% |
| Copper(II) sulfate pentahydrate | CuSO4·5H2O | 249.68 | O 57.7% |
Molar masses from the IUPAC CIAAW abridged standard atomic weights (2024), rounded to the decimal place the atomic weight uncertainties support. Values in textbooks may differ in the last digit because they use older tables or round each atomic weight first.
How the calculator works
The formula is read left to right. A capital letter starts an element symbol, an optional small letter finishes it, and the number after it is the count (no number means 1). A number after a closing bracket multiplies everything inside the bracket, and brackets can be nested: in K4[Fe(CN)6] the 6 applies to both C and N.
A middle dot, an asterisk or a full stop followed by a number starts a new part, as in a hydrate. The leading number of that part multiplies all of it: CuSO4·5H2O adds 10 H and 5 O. A charge at the end, such as SO4^2- or NH4+, is ignored, because the mass of the missing or extra electrons is about 0.00055 g/mol each, far below the precision of the atomic weights.
Each element count is multiplied by its standard atomic weight from the IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW) abridged table, and the products are summed. Mass percent is each product divided by the total. The answer is rounded to the decimal place the atomic weight uncertainties allow, which is why water shows 18.015 but salt shows 58.44.
For the conversion, moles are grams divided by molar mass, and the number of particles is moles times the Avogadro constant, 6.02214076 × 10²³ per mole, which is exact by definition since 2019.
What the model leaves out
- Isotope labels. Deuterium (D) and specific isotopes such as ¹³C are not accepted. The calculator uses natural isotopic mixtures, which is what standard atomic weights describe.
- Radioactive elements. Technetium, promethium and every element from polonium up apart from thorium, protactinium and uranium have no standard atomic weight. The calculator uses the mass number of the most stable isotope instead, shown in square brackets and marked with an asterisk.
- Natural variation. Lithium, boron, sulfur, chlorine and a few others vary between sources, so IUPAC quotes them with fewer digits. A sample of lithium from a battery supplier can differ from the 6.94 average in the second decimal.
- Structure. The calculator counts atoms, so isomers such as ethanol and dimethyl ether (both C2H6O) have the same molar mass. Condensed formulas like CH3COOH work because the counts simply add up.
Common misconceptions
"Molar mass and molecular weight are different numbers." They are the same number. Molecular weight (relative molecular mass) has no unit; molar mass is the same value in g/mol.
"The element with the most atoms has the biggest share." Mass share depends on atomic weight. Hydrogen has two of water’s three atoms but only 11.19% of its mass.
"CO and Co are the same thing typed differently." Capitals change the chemistry. CO is carbon monoxide, 28.010 g/mol; Co is cobalt, 58.933 g/mol.
Frequently asked questions
What is the molar mass of water?
18.015 g/mol, from 2 × 1.0080 for hydrogen plus 15.999 for oxygen. Most textbooks round it to 18.02 g/mol, and 18 g/mol is fine for quick estimates.
How do I calculate molar mass from a chemical formula?
Count the atoms of each element, multiply each count by the atomic weight from the periodic table, and add the products. A number after a bracket multiplies everything inside it. The total is in grams per mole.
How do I include water of crystallisation in a hydrate?
Add the water molecules as a separate part: CuSO4·5H2O is CuSO4 plus 5 × H2O, which is 159.60 + 5 × 18.015 = 249.68 g/mol. In the calculator you can type the dot as *, · or a full stop.
How do I convert grams to moles?
Divide the mass in grams by the molar mass in g/mol. 10 g of water is 10 ÷ 18.015 = 0.5551 mol. To go from moles to grams, multiply by the molar mass instead.
Which atomic weights does this molar mass calculator use?
The IUPAC CIAAW abridged standard atomic weights (2024 table), quoted to five significant figures where natural variation allows. For radioactive elements with no standard atomic weight, it uses the mass number of the most stable isotope.
Keep learning
How to Calculate Molar Mass Step by Step
Calculate molar mass from any chemical formula: count atoms, multiply by atomic weights, add. Worked examples for water, Ca(OH)2, glucose and a hydrate.
How Much Energy Is in 1 Gram of Matter? E = mc² Worked
One gram of mass is 9 × 10¹³ J, about 21 kilotons of TNT. Why bombs convert under 0.1% of their fuel, plotted from a fitted binding-energy curve.
A bigger kettle is not the problem. Heating extra water is
A reproducible Python model separates water volume, kettle power and assumed efficiency to show what changes the energy used for a cup of hot water.
Is Wood more rare than Diamonds?
In a world obsessed with material wealth and luxury, diamonds often take the spotlight as the epitome of value and desirability.