CalculatorsConvertersAbout UsContact

Molar Mass Calculator

Type a chemical formula to get its molar mass (molecular weight) in g/mol, with every element's share, the working and the moles in a sample.

  • Free to use
  • No sign-up
  • Formulas stay in your browser

Last updated:

Find the Molar Mass of a Formula

Try one:
g
mol
Decimals
Molar mass of C₆H₁₂O₆
180.156 g/mol
The same number is the molecular weight in u (amu, Da). Hill formula: C₆H₁₂O₆.
  • Molar mass180.156 g/mol
  • In kg/mol0.180156
  • Atoms in the formula24
  • Elements3
  • Moles in 1 g0.005551 mol
  • Largest shareOxygen 53.28%

Breakdown by element

  • Carbon 40.00%
  • Hydrogen 6.71%
  • Oxygen 53.28%
ElementAtomsAtomic massSubtotal (g/mol)Mass %
Carbon (C)612.01172.06640.00%
Hydrogen (H)121.00812.0966.71%
Oxygen (O)615.99995.99453.28%
Total24180.156100%

The working: 6 × 12.011 + 12 × 1.008 + 6 × 15.999 = 180.156 g/mol

Your sample, 5 g of C₆H₁₂O₆, is 0.02775 mol, or about 1.671 × 10²² molecules.

Atomic masses are the abridged standard atomic weights for elements 1 to 92. Your course may round slightly differently, which can change the last digit.

About Molar Mass Calculator

The molar mass of a substance is the mass of one mole of it, in grams per mole (g/mol). Add up the atomic mass of every atom in the formula to get it.

Molar mass = Σ (atoms × atomic mass)

How to Type a Formula

  • Start every element with a capital letter: Co is cobalt, CO is carbon monoxide
  • Brackets work, even nested: Ca(OH)2 and K4[Fe(CN)6]
  • Use a dot for water of crystallisation: CuSO4·5H2O
  • Leave charges out: write SO4, not SO4 with a 2− charge

Same Number, Different Names

NameUnit
Molar massg/mol
Molecular weightu (no unit in textbooks)
Formula massu, for ionic salts

For water all three are about 18.015.

Molar Masses of Common Compounds

Water, salt, glucose and other substances you meet most often. Click a formula to open it in the calculator.

SubstanceFormulaMolar mass (g/mol)
Water18.015
Carbon dioxide44.009
Sodium chloride (table salt)58.440
Glucose180.156
Ammonia17.031
Methane16.043
Sulfuric acid98.072
Sodium hydroxide39.997
Ethanol46.069
Acetic acid60.052
Sodium bicarbonate84.006
Calcium carbonate100.086
Sucrose342.297
Aspirin180.159
Caffeine194.194
Hydrogen gas2.016
Oxygen gas31.998
Nitrogen gas28.014
Hydrogen peroxide34.014

Worked out with the same atomic masses as the calculator.

Atomic Masses of the Elements

The molar mass of an element is its atomic mass in g/mol. Type to find an element, and click a symbol to open it in the calculator.

No.ElementSymbolAtomic mass (g/mol)
1Hydrogen1.008
2Helium4.0026
3Lithium6.94
4Beryllium9.0122
5Boron10.81
6Carbon12.011
7Nitrogen14.007
8Oxygen15.999
9Fluorine18.998
10Neon20.18
11Sodium22.99
12Magnesium24.305
13Aluminium26.982
14Silicon28.085
15Phosphorus30.974
16Sulfur32.06
17Chlorine35.45
18Argon39.948
19Potassium39.098
20Calcium40.078

For elements with no stable isotope, such as technetium and promethium, the value is the mass number of a long-lived isotope, as in most tables.

Try an Example

Pick one to fill in the calculator and see its answer.

SubstanceFormulag/mol
Calcium hydroxide74.092
Aluminium sulfate342.132
Potassium hexacyanoferrate368.345
Copper(II) sulfate pentahydrate249.677

Click a formula to put it into the calculator.

Brackets and Hydrates

How the calculator reads a formula, as the atoms it counts:

You typeIt counts
Ca(OH)21 Ca, 2 O, 2 H
Al2(SO4)32 Al, 3 S, 12 O
K4[Fe(CN)6]4 K, 1 Fe, 6 C, 6 N
CuSO4·5H2O1 Cu, 1 S, 9 O, 10 H

A number after a bracket multiplies the whole group. A number before a dot, like the 5 in 5H2O, multiplies the whole part after it.

Good to know

  • Molar mass, molecular weight and formula mass give the same number. Only the unit and the name change.
  • g/mol tells you the grams in one mole, which is 6.022 × 10²³ particles.
  • Capital letters matter. Write every element symbol exactly: Co is cobalt, CO is carbon monoxide.
  • It uses standard atomic weights, which are averages over the isotopes found in nature, not the mass of a single isotope.

What is included

  • Molar mass in g/mol and kg/mol
  • Breakdown by element with mass percent and a share bar
  • The working shown step by step
  • Grams to moles to molecules for a sample
  • Brackets, nested brackets and hydrates
  • Common compounds, the elements 1 to 92, copy link and print

Important to know

Your formulas stay in your own browser and are never sent anywhere. The atomic masses are the abridged standard values, so they can differ from your textbook in the last digit. Check the table your course uses for graded work.

Use this free molar mass calculator, also known as a molecular weight calculator, to find the molar mass of any chemical formula in grams per mole. Type a formula such as H2O, NaCl, C6H12O6, Ca(OH)2 or CuSO4·5H2O and you get the molar mass in g/mol, the mass percent of every element with a share bar, the working shown step by step, and the Hill formula. Add a sample in grams or moles to see the amount in moles, the mass and the number of molecules. Brackets, nested brackets and hydrates all work. Tables list the molar mass of common compounds and the atomic masses of the elements 1 to 92. It is free and instant, and your formulas stay in your browser.

What is molar mass?

The molar mass of a substance is the mass of one mole of it, in grams per mole (g/mol). One mole is 6.022 × 10²³ particles (Avogadro's number), so the molar mass links the mass you weigh on a balance to the number of particles you have. For an element it equals the atomic mass from the periodic table. For a compound you add up the atomic masses of all the atoms in its formula. Molecular weight is the same number, so this is also a molecular weight calculator.

How to calculate molar mass

  1. Write down the formula and count the atoms of each element.
  2. Multiply each atomic mass by the number of atoms.
  3. Add the results together.
Example: sulfuric acid, H₂SO₄
2 × 1.008 + 32.06 + 4 × 15.999 = 98.072 g/mol

Other examples: water (H₂O) is 18.015 g/mol, table salt (NaCl) is 58.44 g/mol, glucose (C₆H₁₂O₆) is 180.156 g/mol and calcium hydroxide, Ca(OH)₂, is 74.092 g/mol. The calculator shows this working under every answer, so you can check each step.

Molar mass, molecular weight and formula mass

The three names give the same number. Molar mass is written in g/mol. Molecular weight (relative molecular mass) is measured in unified atomic mass units, u, which are also called amu or daltons (Da), and many textbooks write it with no unit. Formula mass is the name used for ionic salts such as NaCl, which are not made of separate molecules. For water all three are about 18.015.

How to type a formula

  • Write element symbols with a capital letter first, then a lowercase letter if there is one. Co is cobalt, but CO is carbon monoxide.
  • Write the number of atoms straight after the symbol: H2SO4.
  • Use brackets for groups, and a number after the bracket multiplies the whole group: Ca(OH)2, Al2(SO4)3. Square brackets work too, as in K4[Fe(CN)6].
  • For a hydrate, separate the parts with a dot, a middle dot or a star: CuSO4·5H2O is copper sulfate pentahydrate at 249.677 g/mol, made of 159.602 g/mol of CuSO₄ and 5 × 18.015 = 90.075 g/mol of water.
  • Leave charges out. An ion has almost the same mass as its atoms, because an electron weighs very little.

The molar mass of an element

For a single element the molar mass is its atomic mass in g/mol: carbon is 12.011, hydrogen 1.008 and oxygen 15.999. Gases such as hydrogen, oxygen and nitrogen exist as two-atom molecules, so write them as H2, O2 and N2, which gives 2.016, 31.998 and 28.014 g/mol. The table of the elements on this page lists the values for elements 1 to 92, and you can click a symbol to open it in the calculator.

From grams to moles to molecules

Once you know the molar mass, moles = mass ÷ molar mass, and mass = moles × molar mass. Enter a sample mass or an amount in moles to see the other one and the number of molecules, which is the moles times 6.022 × 10²³. For instance, 36.03 g of water is 36.03 ÷ 18.015 = 2 moles, or about 1.204 × 10²⁴ molecules. The table also gives the mass percent of each element, which is the share of the total mass that comes from it: hydrogen makes up 11.19% of water. To turn moles and volume into a concentration, use the Molarity Calculator.

Which atomic masses are used?

The calculator uses the abridged standard atomic weights for elements 1 to 92, hydrogen to uranium, rounded the way most textbooks do. They are averages over the isotopes found in nature, not the mass of one isotope. Elements with no stable isotope, such as technetium and promethium, are shown with the mass number of a long-lived isotope. Your course may round slightly differently, which can change the last digit, so use the table your course gives you for graded work.

View All Calculators

Frequently Asked Questions

How do I calculate molar mass?

Add up the atomic masses of all the atoms in the formula. For H2SO4 that is 2 × 1.008 + 32.06 + 4 × 15.999 = 98.072 g/mol. Type the formula in the calculator to do it automatically and see the working.

What is the molar mass of water?

Water is H2O, so its molar mass is 2 × 1.008 + 15.999 = 18.015 g/mol. Hydrogen makes up 11.19% of that mass and oxygen the other 88.81%.

What is the difference between molar mass and molecular weight?

They have the same number. Molar mass is written in g/mol. Molecular weight, or relative molecular mass, is measured in u (also called amu or Da), and many textbooks write it with no unit. For water both are about 18.015.

How do I find the molecular weight of a compound?

Type its chemical formula, for example C6H12O6 for glucose, and press Calculate Molar Mass. You get 180.156 g/mol, which is also the molecular weight in u. By hand, multiply each atomic mass by the number of atoms and add the results.

Can I use brackets and hydrates in the formula?

Yes. Use brackets such as Ca(OH)2 or Al2(SO4)3, nested ones such as K4[Fe(CN)6], and a dot for water of crystallisation such as CuSO4·5H2O. A dot, a middle dot or a star all work.

What does the dot in CuSO4·5H2O mean?

It shows water molecules attached to the compound: five of them here. The molar mass is the CuSO4 part (159.602 g/mol) plus 5 × 18.015 = 90.075 g/mol of water, which is 249.677 g/mol in total.

Why does capitalisation matter?

Element symbols start with a capital letter, and a second letter, if there is one, is lowercase. Co is cobalt but CO is carbon and oxygen. Typing nacl instead of NaCl gives an error, because the calculator cannot tell where one element ends.

How do I find the molar mass of an element like carbon or hydrogen?

The molar mass of an element is its atomic mass in g/mol: carbon is 12.011 and hydrogen 1.008. Type the symbol, or click it in the elements table. Hydrogen gas is H2, which is 2.016 g/mol, and oxygen gas O2 is 31.998 g/mol.

How do I convert grams to moles?

Divide the mass in grams by the molar mass. For example, 36.03 g of water is 36.03 ÷ 18.015 = 2 moles. Enter the mass in the sample box to see the moles and the number of molecules.

How many molecules are in a sample?

Multiply the moles by Avogadro's number, 6.022 × 10²³. Two moles of water is about 1.204 × 10²⁴ molecules. The calculator shows this when you enter a sample in grams or moles.

Which atomic masses does it use?

The abridged standard atomic weights for elements 1 to 92 (hydrogen to uranium), rounded the way most textbooks do. Your course may use slightly different values, which can change the last digit.

Why are some atomic masses whole numbers?

Elements with no stable isotope, such as technetium (98) and promethium (145), have no natural average, so tables list the mass number of a long-lived isotope instead.

Does it work with ions or charges?

It works out the molar mass from the atoms in the formula and ignores charges, so write ions without the charge, for example SO4 for sulfate. The mass of the few electrons gained or lost is too small to matter here.

What is a Hill formula?

It is the standard order chemists use to list a formula: carbon first, then hydrogen, then the other elements from A to Z. With no carbon, all elements go from A to Z. For example, CuSO4·5H2O in Hill order is CuH10O9S.

What is the molar mass of air?

Dry air is a mixture, mostly nitrogen and oxygen, so it has no single formula. Its average molar mass is about 28.97 g/mol. You can work out a pure gas, such as N2 at 28.014 g/mol or O2 at 31.998 g/mol, by typing it in.

Are my formulas saved or shared?

No. The calculation happens in your browser, and what you enter is not stored or sent to any server. A link you copy keeps the formula after the # sign, which browsers never send to a server.