Skip to content
thecalculatorstudio

Molecular Weight Calculator (Molar Mass of a Formula)

Type a chemical formula, with brackets and hydrate dots if you need them. You get the molar mass in grams per mole, the mass and percent of each element, and the moles in a sample if you enter its mass.

Last reviewed

Molar mass of C6H12O6

180.156 g/mol

24 atoms

Composition
ElementAtomsAtomic weightMassPercent
C Carbon612.01172.06640.00%
H Hydrogen121.008012.0966.71%
O Oxygen615.99995.99453.28%

Atomic weights are the IUPAC (CIAAW) abridged standard values, 2024. Real samples vary slightly with their isotopes, and the weights are good to about five figures.

What molecular weight means

The molecular weight of a substance, also called its molar mass or formula mass, is the mass of one mole of it in grams. It is written in grams per mole (g/mol). A mole is the amount that holds 6.02214076 × 10²³ particles (Avogadro’s number), which is why a molecule’s mass in atomic mass units and the molar mass in g/mol are, to a very close approximation, the same number.

To find it, add up the atomic weight of every atom in the formula.

Worked example: glucose, C6H12O6

Element Atoms Atomic weight Mass
Carbon (C) 6 12.011 72.066
Hydrogen (H) 12 1.0080 12.096
Oxygen (O) 6 15.999 95.994

The molar mass is 72.066 + 12.096 + 95.994 = 180.156 g/mol. By mass, carbon makes up 72.066 ÷ 180.156 = 40.00% of glucose.

More answers you can check:

  • Water, H2O: 2 × 1.0080 + 15.999 = 18.015 g/mol.
  • Carbon dioxide, CO2: 12.011 + 2 × 15.999 = 44.009 g/mol.
  • Table salt, NaCl: 22.990 + 35.45 = 58.440 g/mol.
  • Acetic acid, CH3COOH: 24.022 + 4.032 + 31.998 = 60.052 g/mol, the figure used in the molarity example in the OpenStax Chemistry textbook. The molarity calculator works that example through.

Brackets and hydrates

A count after a closing bracket multiplies everything inside it. In Ca(OH)2 there is one calcium and two OH groups: 40.078 + 2 × (15.999 + 1.0080) = 40.078 + 34.014 = 74.092 g/mol. Brackets can nest: Al2(SO4)3 is two aluminium and three sulfate groups, giving 53.964 + 96.18 + 191.988 = 342.132 g/mol. K4[Fe(CN)6] nests a cyanide group inside an iron complex: 368.345 g/mol.

A hydrate is a salt with water locked into its crystal. It is written with a dot: CuSO4.5H2O is one CuSO4 plus five H2O. The calculator adds them: 159.602 + 5 × 18.015 = 249.677 g/mol. You can also paste the middle dot (·) or an asterisk, or type subscript digits such as H₂O.

Capital letters matter

An element symbol is one capital letter, sometimes followed by one small letter. Co is cobalt (58.933 g/mol), but CO is carbon monoxide (28.010 g/mol). If you type everything in lower case, the calculator cannot tell where one element ends and the next begins, so it asks you to use capitals.

From grams to moles

Moles = mass ÷ molar mass. For 36.03 g of water, 36.03 ÷ 18.015 = 2.000 mol. For 25.2 g of acetic acid, 25.2 ÷ 60.052 = 0.4196 mol. Type the sample mass in the second box and the calculator gives the moles. To go from moles to a concentration, use the molarity calculator. For the mass of a known volume of a material, see the density calculator.

Percent composition

The percent composition says how much of the mass comes from each element: the element’s total mass divided by the molar mass. For water, hydrogen is 2.016 ÷ 18.015 = 11.19% and oxygen is 15.999 ÷ 18.015 = 88.81%. The shares add up to 100%, within rounding.

How accurate are the atomic weights?

The weights come from the International Union of Pure and Applied Chemistry (IUPAC) Commission on Isotopic Abundances and Atomic Weights, which publishes an abridged table to about five significant figures. Chlorine is 35.45 because natural chlorine is a mix of two isotopes, and that mix varies a little from one source to another. The tabulated value is the best figure for normal materials. Round the answer to the precision of your data (see the significant figures calculator).

Elements with no stable or long-lived isotope have no standard atomic weight. These are technetium, promethium, and the elements from polonium to actinium and from neptunium onwards. The calculator names the element and declines to guess.

Common mistakes

  • Using the atomic number. The number above the element in a periodic table is the atomic number, not the weight.
  • Forgetting to multiply the bracket. In Ca(OH)2, both O and H are counted twice.
  • Leaving out the water of a hydrate. CuSO4 and CuSO4.5H2O differ by 90.075 g/mol.
  • Mixing up CO and Co, or CS and Cs (caesium).
  • Reporting too many digits. A molar mass built from five-figure weights is good to about five figures.

How it is calculated

The formula is read from left to right, with brackets and hydrate dots, to count the atoms of each element. Each count is multiplied by that element’s standard atomic weight from the CIAAW 2024 table, and the products are added in exact decimal arithmetic, so there is no floating-point error. Percentages are each element’s mass divided by the total.

Frequently asked questions

What is molecular weight, and how is it calculated?

The mass of one mole of a substance in grams, found by adding the atomic weight of every atom in the formula. Water, H2O, has two hydrogens and one oxygen: 2 × 1.0080 + 15.999 = 18.015 g/mol.

How do I enter brackets and hydrates?

Use (), [] or {} for groups, with the count after the closing bracket: Ca(OH)2, Al2(SO4)3 or K4[Fe(CN)6]. For a hydrate, put a dot between the parts, as in CuSO4.5H2O, which is one CuSO4 and five H2O.

Why do capital letters matter?

A symbol is a capital letter, sometimes followed by one small letter. Co is cobalt, but CO is carbon and oxygen, with a very different mass: 58.933 against 28.010 g/mol. Typing nacl rather than NaCl cannot be read.

How do I turn grams into moles?

Divide the mass by the molar mass. 36.03 g of water is 36.03 ÷ 18.015 = 2 mol. Enter the mass of your sample in the second box and the calculator does this for you.

Where do the atomic weights come from?

They are the abridged standard atomic weights published by IUPAC's Commission on Isotopic Abundances and Atomic Weights (CIAAW), 2024, to about five significant figures. They are averages for normal materials, so a sample with unusual isotopes can differ slightly.

Why does it refuse some elements?

Technetium, promethium, and the elements from polonium to actinium and from neptunium upwards have no stable or long-lived isotope, so they have no standard atomic weight. Their weight depends on which isotope is in the sample, and the calculator will not guess it.

Related calculators

Sources