Percent composition calculator

This percent composition calculator gives the mass percent of every element in a compound. Example: glucose (C6H12O6) is 40 % carbon by mass.

Source: IUPAC CIAAW – Abridged Standard Atomic Weights (Atomic Weights 2021, Revision 2024). Updated: .

For example H2O, Ca(OH)2, C6H12O6 or CuSO4·5H2O. Mind the capital letters.
g
Use 0 for no sample; otherwise the table shows how many grams of each element are present.
My ToolboxYour inputs are saved in this browser only.

Result

Result
w(C) = 40 % · w(H) = 6.71 % · w(O) = 53.28 %
All representations
ElementCountPartial massMass percentIn the sample
C – Carbon672.066 g/mol40 %20 g
H – Hydrogen1212.096 g/mol6.71 %3.36 g
O – Oxygen695.994 g/mol53.28 %26.64 g
Total180.156 g/mol100 %50 g
Calculation steps
  • M(C₆H₁₂O₆) = 180.156 g/mol.
  • w(C) = 6 · 12.011 g/mol / 180.156 g/mol = 40 %.
  • w(H) = 12 · 1.008 g/mol / 180.156 g/mol = 6.71 %.
  • w(O) = 6 · 15.999 g/mol / 180.156 g/mol = 53.28 %.
Mass percentages use IUPAC atomic weights (CIAAW, Atomic Weights 2021, rev. 2024). They add up to 100 %. For hydrates (·5H2O) the water of crystallisation is included.

How it is calculated

The percent composition of a compound states what share of the total mass each element contributes. It follows from the chemical formula and the atomic weights and is used for purity checks, for working out a formula, or for fertiliser calculations.

Formula

w(element) = number of atoms · atomic weight / molar mass of the compound · 100 %. The molar mass M is the sum of all atomic weights in the formula. The mass percentages of all elements add up to 100 %. For a sample of mass m, the sample contains m · w / 100 grams of that element.

Worked example

Glucose, C6H12O6: the molar mass is M = 6 · 12.011 + 12 · 1.008 + 6 · 15.999 = 180.156 g/mol. This gives w(C) = 40 %, w(H) = 6.71 % and w(O) = 53.28 %. A 50 g sample contains 20 g carbon, 3.36 g hydrogen and 26.64 g oxygen. Water (H2O, M = 18.015 g/mol) is 11.19 % hydrogen and 88.81 % oxygen by mass; table salt (NaCl) is 39.34 % sodium and 60.66 % chlorine.

Frequently asked questions

How do you calculate the percent composition of a compound?

Divide atom count times atomic weight of each element by the molar mass and multiply by 100. For glucose this gives 40 % carbon.

What is the difference between mass percent and mole percent?

Mass percent refers to grams, mole percent to the number of atoms or particles. In water 11.19 % of the mass is hydrogen, but two thirds of the atoms are.

How do I find the grams of an element in a sample?

Sample mass times mass percent divided by 100. For 50 g of glucose that is 20 g carbon.

Sources and legal basis

As of: · Editorial policy

Related tools