Skip to content
Omnikalc

Percent composition calculator: what share of a compound's mass is each element?

Choose the elements and the number of atoms in the formula to get the molar mass, the mass percent of each element and the mass of an element in a sample.

Updated on
Your inputs

Value out of range

Value out of range

Value out of range

Value out of range

g

Value out of range

Results

Molar mass of the compound

180.156 g/mol

Mass percent of element 1
40.00 %
Mass percent of element 2
6.71 %
Mass percent of element 3
53.28 %
Mass percent of element 4
0.00 %
Mass of element 1 in the sample
10.000 g
Check: sum of the percentages
100.0 %

Chemists often need to know how much of a compound’s mass is a given element, for purity checks, fertiliser labels and stoichiometry. The percent composition calculator takes up to four elements and their number of atoms, and gives the molar mass, the mass percent of each element, the mass of element 1 in a sample and a check that the percentages sum to 100 %.

How the calculation works

  • Pick up to four elements of the compound from the lists and enter the number of atoms of each in the formula. The calculator uses their atomic masses.
  • Leave an element on None with 0 atoms if the compound has fewer than four elements.
  • Optionally enter the mass of a sample to get the mass of element 1 it contains.
  • The molar mass is the sum of atoms × atomic mass, and the mass percent of each element is (atoms × atomic mass) ÷ molar mass × 100.

Example

For glucose, C₆H₁₂O₆, choose C with 6 atoms, H with 12 and O with 6. The molar mass is 6 × 12.011 + 12 × 1.008 + 6 × 15.999 = 180.156 g/mol. Carbon is 72.066 ÷ 180.156 = 40.00 %, hydrogen is 6.71 % and oxygen is 53.28 %. A 25 g sample of glucose contains 10.0 g of carbon. For water, H₂O, hydrogen is 11.19 % and oxygen 88.81 %.

Why it matters

Percent composition is the link between a chemical formula and a mass you can weigh. It is used to compare fertilisers by nitrogen content, to check the purity of a sample, and to find the formula of an unknown compound from analysis data.

Good to know

The atomic masses are standard values rounded to three decimals, so results match textbook answers but may differ in the last digit from tables that use other rounding. The calculator does not parse formulas, so enter the number of atoms of each element yourself and include all the atoms of hydrates.

The mass percent calculator works with solutions, the mole fraction calculator describes mixtures, and the molarity calculator turns mass into concentration.

Frequently asked questions

What is percent composition?

Percent composition, or mass percent composition, gives the share of the total mass of a compound that comes from each element. It is calculated from the formula and the atomic masses, and the percentages of all the elements add up to 100 %.

How do I use percent composition to find a formula?

Run the calculation backwards: assume 100 g of the compound so that each percentage is a mass in grams, divide each mass by the atomic mass to get moles, then divide by the smallest number of moles. The ratio gives the empirical formula, which you can scale up using the molar mass.

Why do the percentages sum to 100 % but not always exactly?

Atomic masses are rounded, and the percentages are rounded to two decimals, so the sum shown by hand can be 99.99 % or 100.01 %. The calculator keeps full precision internally, so the true sum is exactly 100 %.

Can I use it for hydrates and salts?

Yes. Count every atom in the full formula. For copper(II) sulfate pentahydrate, CuSO₄·5H₂O, enter Cu 1, S 1, O 9 and H 10. The water of hydration is part of the formula mass.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.