Element Mass % in Compound (Percent Composition) Calculator
Enter a chemical formula and an element symbol to get that element's percent by mass, a full breakdown of every element in the compound, a visual comparison, and a step-by-step solution. Handles parentheses, nesting, and hydrates (dot notation).
Background
Percent composition tells you what fraction of a compound's total mass comes from one specific element. It's the same idea whether the formula is simple (NaCl) or has nested groups and hydrate water (Al₂(SO₄)₃·18H₂O) — count every atom of the target element, multiply by its atomic weight, and divide by the total molar mass.
How to use this calculator
- Type a valid chemical formula — parentheses, nesting, and hydrates (using · or a period) are all supported.
- Enter a one- or two-letter element symbol, or click one of the quick-pick chips.
- Click Calculate Percent Composition to see the percent by mass, a visual breakdown, and the full step-by-step solution.
How this calculator works
- Parses the formula into atom counts, correctly expanding parentheses (a subscript outside a group multiplies everything inside it).
- Hydrates are split on the dot, and each part's atom counts are multiplied by its own leading coefficient before being added to the total.
- %E = (n(E) × AW(E) ÷ M) × 100%, where M is the total molar mass of the formula unit.
Formula & Equation Used
Percent by mass: %E = 100 × [n(E) × AW(E)] ÷ M
n(E): number of atoms of element E in one formula unit
AW(E): atomic weight of element E (g/mol)
M: total molar mass of the formula unit (g/mol)
Example Problems & Step-by-Step Solutions
Example 1 — Glucose
Find the percent by mass of oxygen in glucose, C₆H₁₂O₆.
- M = 6(12.011) + 12(1.008) + 6(15.999) = 180.156 g/mol
- Mass of O = 6(15.999) = 95.994 g/mol
- %O = 100 × 95.994 ÷ 180.156 ≈ 53.28%
Example 2 — Ammonium sulfate
Find the percent by mass of nitrogen in (NH₄)₂SO₄.
- M = 2(14.007) + 8(1.008) + 32.06 + 4(15.999) = 132.134 g/mol
- Mass of N = 2(14.007) = 28.014 g/mol
- %N = 100 × 28.014 ÷ 132.134 ≈ 21.20%
Example 3 — A hydrate
Find the percent by mass of oxygen in copper(II) sulfate pentahydrate, CuSO₄·5H₂O.
- Oxygen comes from two places: 4 from the sulfate, and 5 from the water — 9 oxygen atoms total.
- M ≈ 249.68 g/mol; mass of O = 9(15.999) ≈ 143.99 g/mol.
- %O = 100 × 143.99 ÷ 249.68 ≈ 57.67%.
Example 4 — Element not present
Find the percent by mass of iron in NaCl.
- Iron doesn't appear anywhere in the formula NaCl.
- Its count is 0, so its percent by mass is 0% — a valid, informative answer, not an error.
Frequently Asked Questions
Does it handle hydrates like CuSO₄·5H₂O?
Yes — use a middle dot (·) or a period (.). Each part's atom counts are multiplied by its own leading number before being added to the compound's total.
Which atomic weights are used?
Standard IUPAC-style values. If your course provides a specific data table, match those values when reporting your final answer.
What happens if the element isn't in the formula?
The calculator reports 0% — that's the correct, informative answer, not an error state.
How many decimals should I report?
The default is 2 decimal places. Adjust the setting to match your course's significant-figure guidance.