Percent Composition Calculator

Calculate the percent composition by mass of each element in a compound.

Science % by mass 9 presets molar mass
Rate this calculator · 5.0 (1)

Percent Composition Calculator

Element-by-element % by mass · 9 presets

Instructions — Percent Composition Calculator

Percent composition tells you what fraction of a compound's mass comes from each element. For water (H2O), 11.2% of the mass is hydrogen and 88.8% is oxygen.

  1. Pick a preset compound from the dropdown, or start with the default H2O and edit the rows.
  2. Each row: element symbol, number of atoms, and atomic mass in g/mol. The calculator multiplies n × m for each element and sums them.
  3. Add or remove rows with the + button and × icon.
  4. Results show molar mass of the compound and the percent contribution of each element with a visual bar.

Formulas

Percent composition by mass:

$$ \%_{element} = \frac{n \times A_r}{M_r} \times 100 $$

  • n = number of atoms of the element in one formula unit
  • Ar = atomic mass of the element (g/mol)
  • Mr = molar mass of the compound (g/mol)

Molar mass of the compound: $$ M_r = \sum_i n_i \times A_{r,i} $$

Sum of all percent compositions must equal 100% (within rounding). For water: 11.2% + 88.8% = 100%.

Reference

Compositions of common compounds:

CompoundMr (g/mol)% composition
Water (H2O)18.02H 11.19%, O 88.81%
Carbon dioxide (CO2)44.01C 27.29%, O 72.71%
Ammonia (NH3)17.03N 82.24%, H 17.76%
Glucose (C6H12O6)180.16C 40.00%, H 6.71%, O 53.29%
Sodium chloride (NaCl)58.44Na 39.34%, Cl 60.66%
Calcium carbonate (CaCO3)100.09Ca 40.04%, C 12.00%, O 47.96%
Sulfuric acid (H2SO4)98.08H 2.06%, S 32.69%, O 65.25%
Methane (CH4)16.04C 74.87%, H 25.13%

Use: percent composition is the first step in solving for an empirical formula from elemental analysis data.

Article — Percent Composition Calculator

Percent composition calculator: mass fractions of elements

Percent composition is the mass of each element in a compound divided by the compound's total molar mass, multiplied by 100. Water is 11.19% hydrogen and 88.81% oxygen by mass. Calculate each element by formula: % = (n × Ar ÷ Mr) × 100, where n is the number of atoms, Ar the atomic mass, and Mr the molar mass of the compound.

Mass percentages are how chemists describe what is actually in a substance. A pharmaceutical label that lists 90% active ingredient is a mass percentage. A steel alloy that is 0.5% carbon is a mass percentage. The percent composition of a pure compound is fixed by its chemical formula: pure CO2 is always 27.29% carbon and 72.71% oxygen, whether the sample weighs a milligram or a metric ton.

What is percent composition?

Percent composition by mass is the fraction of a compound's total mass that comes from each element. For a compound with formula AxByCz, calculate the mass of each element (count × atomic mass), sum them to get the molar mass, then divide each contribution by the total.

The unit is percent (%) by mass. All percentages add up to 100% for the compound. If your numbers do not, either an element is missing from your formula or the atomic masses have been rounded too aggressively.

Did you know

The human body is 65% oxygen, 18% carbon, 10% hydrogen, and 3% nitrogen by mass. Those four elements plus calcium and phosphorus account for over 99% of body mass. The rest is iron, sulfur, sodium, potassium, and a handful of trace minerals.

The percent composition formula

The full formula in working form:

Percent composition formula
%_X = (n_X × A_X) ÷ M_r × 100 per element
M_r = Σ n_i × A_i molar mass
Σ %_i = 100% conservation check

The conservation check (sum of percentages = 100) is the easiest way to spot errors. If your sum is 95% or 105%, you have either miscounted atoms in the formula or used the wrong atomic mass for one element. A common slip is treating chlorine as 35 instead of 35.453.

How to calculate percent composition

The procedure is the same for every compound. Pick a formula, list each element with its atom count, look up atomic masses from the periodic table, multiply, and sum. Then divide each element's mass contribution by the total and multiply by 100.

For glucose C6H12O6: carbon contributes 6 × 12.011 = 72.066. Hydrogen contributes 12 × 1.008 = 12.096. Oxygen contributes 6 × 15.999 = 95.994. Total molar mass: 72.066 + 12.096 + 95.994 = 180.156 g/mol. Percentages: C = 40.00%, H = 6.71%, O = 53.29%. Sum: 100.00%.

Percent composition examples

Example 1: Carbon dioxide CO2. Molar mass = 12.011 + 2 × 15.999 = 44.009 g/mol. Carbon: 12.011 ÷ 44.009 × 100 = 27.29%. Oxygen: 31.998 ÷ 44.009 × 100 = 72.71%.

Example 2: Calcium carbonate CaCO3. Molar mass = 40.078 + 12.011 + 3 × 15.999 = 100.086 g/mol. Calcium: 40.04%, carbon: 12.00%, oxygen: 47.96%. CaCO3 is limestone, eggshells, and antacid tablets — all the same composition.

Example 3: Sulfuric acid H2SO4. Molar mass = 2 × 1.008 + 32.06 + 4 × 15.999 = 98.08 g/mol. Hydrogen: 2.06%, sulfur: 32.69%, oxygen: 65.25%.

  • H2O H 11.19%, O 88.81%
  • NH3 N 82.24%, H 17.76%
  • CH4 C 74.87%, H 25.13%
  • CO2 C 27.29%, O 72.71%
  • NaCl Na 39.34%, Cl 60.66%
  • C6H12O6 C 40.00%, H 6.71%, O 53.29%
  • CaCO3 Ca 40.04%, C 12.00%, O 47.96%
  • KMnO4 K 24.74%, Mn 34.76%, O 40.50%

From percent composition to empirical formula

The reverse calculation lets you find a compound's empirical formula from elemental analysis. Take the percent composition, assume a 100 g sample (so percentages become grams), convert each mass to moles by dividing by the atomic mass, then divide all mole values by the smallest. The result is the simplest whole-number ratio of atoms.

Example: a compound is 40.0% C, 6.7% H, and 53.3% O. Moles: C = 3.33, H = 6.65, O = 3.33. Divide by smallest (3.33): C = 1, H = 2, O = 1. Empirical formula is CH2O, the formula of formaldehyde — or one-sixth of glucose. The molecular formula could be CH2O, C2H4O2, C6H12O6, or any multiple, depending on the molar mass.

Empirical vs. molecular formula

Two compounds with the same empirical formula have the same percent composition. Acetic acid (C2H4O2) and glucose (C6H12O6) both reduce to CH2O and are both 40.0% C, 6.7% H, 53.3% O. You cannot tell them apart from composition alone; you need a molar mass too.

Common percent composition mistakes

The most common error is missing atoms in compounds with parentheses. Ca(NO3)2 has 1 calcium, 2 nitrogens, and 6 oxygens — not 1 calcium, 1 nitrogen, and 3 oxygens. Read the subscript outside the parenthesis as a multiplier for everything inside.

The second mistake is using integer atomic masses (H = 1, C = 12, O = 16) instead of the actual IUPAC values (1.008, 12.011, 15.999). For high-precision work the difference matters: glucose comes out 40.00% C with precise masses or 40.0% with rounded ones.

H₂O
Water
H 11.2%
O 88.8%
CO₂
Carbon dioxide
C 27.3%
O 72.7%

Where percent composition matters

Quality control: drug manufacturers test active ingredient mass fraction against label values. A 500 mg acetaminophen tablet should contain 500 mg ± 5% of the molecule (not the powder mass). Combustion analysis: burning a hydrocarbon and weighing the CO2 and H2O products gives the percent C and H in the original sample, which leads to the empirical formula.

Metallurgy: stainless steel grades are defined by mass percent (304 stainless is 18% Cr and 8% Ni). Mineralogy: ore grades are reported as mass percent of metal (a 2% copper ore yields 20 kg copper per ton of rock). Each field has a different precision standard, but the math is the same.

Tip

If two percentages must sum to 100% and one is hard to measure, calculate the easier one and subtract. For an iron oxide that is x% iron and (100-x)% oxygen, weighing the iron after reduction is faster than collecting the released oxygen.

Where to find atomic masses

The most authoritative source is the IUPAC Commission on Isotopic Abundances and Atomic Weights, which publishes updated values every two years. NIST maintains a free reference periodic table with the same values. For routine work, the standard atomic weights in a high-school or college textbook are accurate to four significant figures, which is enough for percent compositions that go to two decimal places.

FAQ

% by mass of an element = (n × Ar ÷ Mr) × 100, where n is the number of atoms in one formula unit, Ar is the atomic mass, and Mr is the molar mass of the compound.
First find the molar mass of the compound by summing n × Ar for each element. Then divide the mass contribution of each element by the total molar mass and multiply by 100. The percentages should sum to 100%.
H2O has a molar mass of 18.015 g/mol. Hydrogen: 2 × 1.008 = 2.016, giving 11.19%. Oxygen: 1 × 15.999 = 15.999, giving 88.81%. Total checks: 11.19 + 88.81 = 100%.
Atomic masses are rounded values, and your calculator rounds each percent independently. A small residual like 99.99% or 100.01% is normal. Anything more than 0.1% off suggests you missed an atom or used the wrong atomic mass.
Assume 100 g of compound. Convert each element's mass to moles by dividing by its atomic mass. Divide all mole values by the smallest. The resulting ratio gives the empirical formula. Round only if very close to an integer.
They are the same concept expressed differently. Mass fraction is a decimal between 0 and 1; percent composition is 100 times the mass fraction. Water is 0.888 mass fraction oxygen or 88.8% oxygen by mass.
No. The percent composition of a compound is fixed by its formula. One gram of water and one ton of water are both 88.81% oxygen by mass.
Use the most recent IUPAC standard atomic weights, found on the NIST periodic table. Common abbreviated values: H = 1.008, C = 12.011, N = 14.007, O = 15.999, Na = 22.990, Cl = 35.453.