Percent Composition Calculator

Quick answer

The percent composition calculator finds the mass percentage of every element in a compound from its chemical formula, draws a pie chart of the composition and, for a sample of known mass, tells you how many grams of each element it contains.

Examples: H2O, NaHCO3, (NH4)2SO4, Fe2O3, C12H22O11

Symbol or name – leave empty to show the first element

Mass percent of the chosen element
65.254 %
Mass of that element in the sample
65.2541
Composition by mass
H 2.06 % · S 32.69 % · O 65.25 %
Molar mass of the compound
98.072 g/mol
Composition table
Element Atoms Mass (g/mol) Mass % Mass in sample (g) ─────────────────────────────────────────────────────────────────── H (Hydrogen) 2 2.016 2.056 % 2.0556 S (Sulfur) 1 32.06 32.69 % 32.6903 O (Oxygen) 4 63.996 65.254 % 65.2541 Total 7 98.072 100 % 100
Composition pie chart

Percent composition (also called percentage composition by mass) tells you what fraction of a compound’s mass comes from each element. It is the same for every sample of a pure compound, no matter how large: water is always 11.19% hydrogen and 88.81% oxygen by mass, whether you have a drop or an ocean. That makes it a fingerprint of the compound and the starting point for working out an empirical formula from a laboratory analysis.

To compute it, take the mass that each element contributes to one mole of the compound – the atomic weight times the number of atoms – and divide by the molar mass. In sulfuric acid, H₂SO₄ (98.07 g/mol), the four oxygen atoms contribute 64.00 g/mol, so oxygen accounts for 65.25% of the mass even though it is only four of the seven atoms.

Enter the formula, optionally the element you are interested in and the mass of your sample. The table lists atoms, mass contributions and percentages for every element, and the pie chart shows the split at a glance – handy for fertiliser nitrogen content, metal content of ores or checking a combustion analysis.

How to use the Percent Composition Calculator

  1. Chemical formula — Examples: H2O, NaHCO3, (NH4)2SO4, Fe2O3, C12H22O11
  2. Element of interest (optional) — Symbol or name – leave empty to show the first element
  3. Sample mass (optional)

Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.

How it works

The formula is broken into elements; each atom count is multiplied by the IUPAC standard atomic weight. Dividing each contribution by the total molar mass and multiplying by 100 gives the mass percentages, which always add up to 100%.

Worked example

Sulfuric acid, H₂SO₄: M = 2 × 1.008 + 32.06 + 4 × 15.999 = 98.072 g/mol. Hydrogen: 2.016 ÷ 98.072 = 2.06%; sulfur: 32.06 ÷ 98.072 = 32.69%; oxygen: 63.996 ÷ 98.072 = 65.25%. A 100 g sample therefore contains 2.06 g of H, 32.69 g of S and 65.25 g of O.

Percent composition of common compounds

Compound Formula Composition by mass
Water H₂O H 11.19% · O 88.81%
Carbon dioxide CO₂ C 27.29% · O 72.71%
Sodium chloride NaCl Na 39.34% · Cl 60.66%
Sodium bicarbonate NaHCO₃ Na 27.37% · H 1.20% · C 14.30% · O 57.14%
Iron(III) oxide Fe₂O₃ Fe 69.94% · O 30.06%
Urea CO(NH₂)₂ C 20.00% · O 26.64% · N 46.65% · H 6.71%

Tips

  • Type formulas with normal capitals and numbers, e.g. Ca(OH)2 or CuSO4·5H2O – brackets and hydrates work.
  • Atomic masses are IUPAC standard atomic weights; radioactive elements use the mass number of their longest-lived isotope.
  • Electronegativity values are on the Pauling scale.
  • Everything is calculated in your browser.

Common mistakes to avoid

  • Writing CO (carbon monoxide) when you mean Co (cobalt) – capitals matter.
  • Forgetting to multiply the bracket contents by the subscript after the bracket.
  • Mixing up atomic number (protons) and mass number (protons + neutrons).

Formula

Mass % of element = (nᵢ × Aᵢ ÷ M) × 100 · M = Σ (nᵢ × Aᵢ) · mass of element in sample = sample mass × mass % ÷ 100

Worked example

Inputs — Chemical formula: H2SO4; Element of interest (optional): O; Sample mass (optional): 100 g.
Results — Mass percent of the chosen element = 65.254 %; Mass of that element in the sample = 65.2541; Composition by mass = H 2.06 % · S 32.69 % · O 65.25 %; Molar mass of the compound = 98.072 g/mol; Composition table = Element Atoms Mass (g/mol) Mass % Mass in sample (g)
───────────────────────────────────────────────────────────────────
H (Hydrogen) 2 2.016 2.056 % 2.0556
S (Sulfur) 1 32.06 32.69 % 32.6903
O (Oxygen) 4 63.996 65.254 % 65.2541
Total 7 98.072 100 % 100.

Key terms

Percent composition
The mass percentage of each element in a compound.
Mass fraction
The mass of one component divided by the total mass (percent composition ÷ 100).
Molar mass
The mass of one mole of the compound, the sum of all atomic contributions.

Frequently asked questions

What is the percent composition of water?

Hydrogen 2 × 1.008 ÷ 18.015 = 11.19% and oxygen 15.999 ÷ 18.015 = 88.81%.

What is the percent composition of sulfuric acid?

H₂SO₄ (98.072 g/mol) is 2.06% hydrogen, 32.69% sulfur and 65.25% oxygen by mass.

How much carbon is in table sugar?

Sucrose, C₁₂H₂₂O₁₁ (342.30 g/mol), contains 12 × 12.011 = 144.13 g/mol of carbon, which is 42.11% of its mass.

What is the nitrogen content of ammonium nitrate and urea?

NH₄NO₃ is 35.0% nitrogen and urea, CO(NH₂)₂, is 46.65% nitrogen – that is why urea is the most concentrated solid nitrogen fertiliser.

Is percent composition by mass the same as by atoms?

No. Water is 66.7% hydrogen by number of atoms but only 11.2% by mass, because hydrogen atoms are so light.

Do the percentages always add up to 100%?

Yes for a correct formula (small differences come only from rounding). In lab analyses that do not add up, the missing part is often oxygen, which is usually found by difference.

How do I get a formula back from percentages?

Divide each percentage by the atomic weight and find the smallest whole-number ratio – use the empirical formula calculator.

What formula does the Percent Composition Calculator use?

Mass % of element = (nᵢ × Aᵢ ÷ M) × 100 · M = Σ (nᵢ × Aᵢ) · mass of element in sample = sample mass × mass % ÷ 100.

Sources

  1. OpenStax – Chemistry 2e
  2. IUPAC Commission on Isotopic Abundances and Atomic Weights – Standard atomic weights
  3. LibreTexts Chemistry

Cite this calculator

Speedy Calculator. (2026). Percent Composition Calculator. Speedy Calculator. https://speedycalculator.com/calculators/chemistry/percent-composition/