Skip to main content

Percent Composition Calculator

What the calculation is

Percent composition gives the mass fraction of each element in a compound, expressed as a percentage. The formula is straightforward:

% X = (atoms of X × atomic mass of X) / molar mass of compound × 100

Apply it to every element in the formula and the percentages sum to 100. The denominator is fixed once the molar mass is computed, so each element’s percentage just measures how much of that total mass comes from its atoms.

The non-obvious part is what the numbers reveal. Glucose (C₆H₁₂O₆) has twelve hydrogens — twice as many atoms as anything else — but hydrogens are so light that they account for only 6.71% of the mass. The carbons and oxygens, fewer in count but heavier per atom, dominate. Mass percent and atom count are not the same picture.

How this calculator works

Type a formula (C6H12O6, Al2(SO4)3, CuSO4·5H2O). The parser handles parentheses, hydrate dot notation, and coefficients, then walks the element table:

  1. Compute the molar mass of the whole compound.
  2. For each element: atoms × atomic mass = mass contribution.
  3. Divide each contribution by the molar mass and multiply by 100.

The output is a table with element, atom count, mass contribution, and percent. Steps are shown for each row so you can check the arithmetic against a textbook problem.

Worked examples

H₂O — molar mass 18.015 g/mol. H: (2 × 1.008)/18.015 × 100 = 11.19%. O: (1 × 15.999)/18.015 × 100 = 88.81%.

CO₂ — molar mass 44.009 g/mol. C: (1 × 12.011)/44.009 × 100 = 27.29%. O: (2 × 15.999)/44.009 × 100 = 72.71%.

Glucose, C₆H₁₂O₆ — molar mass 180.156 g/mol. C: 40.00%, H: 6.71%, O: 53.29%. The hydrogen number is small despite there being twelve H atoms.

Al₂(SO₄)₃ — molar mass 342.151 g/mol. Al: 15.77%, S: 28.11%, O: 56.12%. The twelve oxygens (three sulfates × four O each) outweigh everything else.

Forward and reverse

The same numbers run two directions. Going forward, a known formula gives you the expected percentages — useful for verifying purity or sanity-checking a synthesis. Going backward, experimental percentages from elemental analysis give you the empirical formula: convert each percent to moles (assume a 100 g sample, divide by atomic mass), then divide by the smallest mole count to get the simplest whole-number ratio. The Empirical Formula Calculator handles that direction.

Frequently Asked Questions

What is percent composition?
Percent composition is the fraction of a compound's mass that comes from each constituent element, expressed as a percentage. For water, hydrogen is 11.19% of the mass and oxygen is 88.81% — the heavy oxygen dominates even though there are twice as many hydrogen atoms. The percentages always sum to 100 within rounding.
How do you calculate percent composition?
For each element, multiply its atomic mass by the number of atoms in the formula, divide by the molar mass of the whole compound, and multiply by 100. Repeat for every element. The denominator is the same for every row, so what you are really computing is the mass contribution of each element relative to the total.
Why is percent composition useful?
It is the link between a known formula and the experimental measurements that come out of combustion analysis or ICP-MS. When you have mass percentages from the lab, you reverse the calculation to get an empirical formula. When you already know the formula, the percentages let you check purity or compare your sample to a literature reference.
What is the difference between percent composition and percent yield?
They are unrelated. Percent composition describes what a single pure compound is made of by mass — a property of the substance itself. Percent yield is a reaction metric: actual product mass divided by theoretical maximum, times 100. One is about identity, the other is about how well a reaction performed.
Do percent compositions change with sample size?
No. Percent composition is intensive — it depends only on the formula, not on how much of the compound you have. One milligram of glucose is 40.00% carbon and so is one kilogram. This is exactly why mass percentages, rather than absolute masses, are the natural way to report composition.