Molar mass calculator

Type a formula like CaCO3 or CuSO4·5H2O. Shows the molar mass in g/mol and a table of mass by element. Runs on your device.

Molar masses of common compounds

Computed by this tool from the abridged CIAAW atomic weights, to 3 decimal places.

FormulaNameMolar mass (g/mol)
H2OWater18.015
CO2Carbon dioxide44.009
NaClSodium chloride (table salt)58.440
C6H12O6Glucose180.156
CaCO3Calcium carbonate100.086
H2SO4Sulfuric acid98.072
NaOHSodium hydroxide39.997
NH3Ammonia17.031
CH4Methane16.043
HClHydrogen chloride36.458
O2Oxygen gas31.998
N2Nitrogen gas28.014
C2H5OHEthanol46.069
KMnO4Potassium permanganate158.032
CuSO4·5H2OCopper(II) sulfate pentahydrate249.677

Atomic weights: CIAAW abridged standard values (ciaaw.org), based on the Atomic Weights 2021 report.

How it works

  1. Type a chemical formula
  2. Choose the number of decimal places
  3. Read the molar mass and the table by element

How the molar mass of a formula is worked out

The molar mass of a compound is the sum of the atomic weights of all its atoms, in grams per mole (g/mol). Water, H2O, has 2 hydrogen atoms and 1 oxygen atom: 2 × 1.008 + 15.999 = 18.015 g/mol. Calcium carbonate, CaCO3, is 40.078 + 12.011 + 3 × 15.999 = 100.086 g/mol. The tool reads the formula, counts the atoms of each element, multiplies each count by the atomic weight and adds the results. The table under the answer shows each step: the element, its number of atoms, its atomic weight, its share of the mass in g/mol and its mass percent. In CaCO3, calcium is 40.04% of the mass, carbon 12.00% and oxygen 47.96%.

Brackets, hydrates and several formulas

Subscripts multiply the symbol before them, and a number after a closing bracket multiplies everything inside it. Ca(OH)2 has 1 calcium, 2 oxygen and 2 hydrogen atoms, and K4[Fe(CN)6] has 4 potassium, 1 iron, 6 carbon and 6 nitrogen atoms. Round, square and curly brackets can be nested and must match. A hydrate is written with a dot, a middle dot or an asterisk: CuSO4·5H2O, CuSO4.5H2O and CuSO4*5H2O all mean copper sulfate with five waters, and their molar mass is 249.677 g/mol. The number in front of the water multiplies the whole part after the dot. To compare compounds, type several formulas separated by commas or semicolons, for example NaCl, KCl, CaCl2. Each gets its own answer, and the table lists every formula.

Capital letters, charges and errors

Element symbols are case-sensitive. Co is cobalt, but CO is carbon and oxygen, and the tool reads exactly what you type. A symbol that does not exist, such as Xx or Hn, stops with a message that names it and says how symbols are written. A bracket that is not closed, a bracket closed with the wrong kind, a subscript of 0 and an empty box also give a message and no answer. A charge written with a caret or at the end after a letter, such as Na+, SO4^2- or OH-, is ignored, because the mass of the electrons is far below the digits shown. A charge written without a caret after a number, such as SO42-, is refused as ambiguous: it could mean SO4 with a 2- charge or SO42. Remove it or write SO4^2-.

Where the atomic weights come from

The weights are the abridged standard atomic weights of CIAAW (the IUPAC commission on atomic weights), from its table at ciaaw.org based on the Atomic Weights 2021 report, rounded as in the IUPAC periodic table. Some elements, such as carbon, oxygen, chlorine and sulfur, have no single weight because their isotope mix varies in nature. CIAAW publishes a range for them, and this tool uses the conventional single value: 12.011 for carbon, 15.999 for oxygen, 35.45 for chlorine and 32.06 for sulfur. Elements without a standard weight, such as technetium or plutonium, use the mass number of their longest-lived isotope, shown in brackets in the table, like [98] for technetium. Other textbooks round differently, so your course answer may differ in the last digit, for example 58.44 against 58.443 for NaCl. Use the decimal places your course asks for.

Frequently asked questions

What is the molar mass of CaCO3?

100.086 g/mol. Calcium is 40.078, carbon is 12.011 and three oxygen atoms add 3 × 15.999 = 47.997. Added up that is 100.086, which many textbooks round to 100.09 or 100.1 g/mol.

What is the molar mass of H2O and CO2?

Water, H2O, is 18.015 g/mol (2 × 1.008 + 15.999). Carbon dioxide, CO2, is 44.009 g/mol (12.011 + 2 × 15.999). Choose 2 decimal places for 18.02 and 44.01.

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

Type a dot, a middle dot or an asterisk between the parts and put the count before the water: CuSO4·5H2O, CuSO4.5H2O or CuSO4*5H2O. All three give 249.677 g/mol, which is 159.602 for CuSO4 plus 5 × 18.015 for the water.

Why does Co give a different answer from CO?

Element symbols are case-sensitive. Co is one cobalt atom, 58.933 g/mol. CO is carbon plus oxygen, 28.010 g/mol. Write the first letter as a capital and any second letter as a small one.

What is the difference between molar mass and molecular weight?

Molar mass is in g/mol and molecular weight is a ratio with no unit, but for school work the numbers are the same: water is 18.015 g/mol and has a molecular weight of 18.015. For ionic compounds like NaCl (58.440), the term formula mass is often used instead.

How do I get moles from grams?

Divide the mass by the molar mass. 50 g of NaCl is 50 ÷ 58.44 = 0.856 mol. To go the other way, multiply moles by molar mass: 0.5 mol of CaCO3 weighs 0.5 × 100.086 = 50.043 g.