chemistry Calculator

Percent Composition Calculator

Calculate percent composition by mass of elements in compounds.

Percent Composition Calculator

Calculate percent composition by mass of a given element in a chemical compound. Supports nested parentheses and common element symbols.

Enter a formula and element to see results.

Percent Composition by Mass

The percent composition of an element in a compound is the fraction (by mass) of that element relative to the total mass of the compound, expressed as a percentage. This calculator parses chemical formulas, computes molar masses using atomic weights, and reports the mass percent of the requested element.

It supports common formulas and nested parentheses such as Fe2(SO4)3, Mg(OH)2, and C6H12O6. If an element in the formula is not recognized, the calculator will prompt you to add its atomic weight.

How the Calculator Works

The tool follows these steps:

  1. Parse the chemical formula to determine counts of each element (handles parentheses).
  2. Multiply each element count by its atomic weight to get the contribution to molar mass.
  3. Sum contributions to obtain the molar mass of the compound.
  4. Compute percent composition: (mass of element in formula / total molar mass) × 100.
Percent = (n_element × atomic_weight_element) / (sum(n_i × atomic_weight_i)) × 100

Examples

Water — H2O

Molar mass = 2 × 1.00794 (H) + 15.9994 (O) = 18.01528 g/mol.

Percent H = (2 × 1.00794 / 18.01528) × 100 ≈ 11.19%

Percent O ≈ 88.81%

Glucose — C6H12O6

Compute contribution from C, H, and O and then percent per element.

Magnesium Hydroxide — Mg(OH)2

The parser recognizes parentheses: Mg(OH)2 has Mg=1, O=2, H=2.

Frequently Asked Questions

Q: What if my formula includes an element not listed?

A: The calculator relies on an internal table of atomic weights. If an element is not recognized, you'll see an error listing the unknown symbol(s). You can request to add that element's atomic weight to the dataset.

Q: Can I use fractional subscripts or hydrates (e.g., CuSO4·5H2O)?

A: The current parser handles integer counts and nested parentheses. For hydrates using a middle dot (·), replace the dot with a plus sign or expand the hydrate explicitly (e.g., CuSO4 + 5H2O) or enter CuSO4(H2O)5.

Q: Are results rounded?

A: Results displayed by the calculator are rounded to a sensible number of decimal places, but the PDF download includes values with greater precision where applicable.

Tips for Accurate Input

  • Use correct element symbols (capital letter followed by optional lowercase letter), e.g., Fe, Na, Cl.
  • Use parentheses for grouped units with multipliers, e.g., Al2(SO4)3.
  • Avoid stray characters — only element symbols, digits, and parentheses are supported.

Frequently Asked Questions

What if my formula includes an element not listed?

The calculator relies on an internal table of atomic weights. If an element is not recognized, you'll see an error listing the unknown symbol(s). You can request to add that element's atomic weight to the dataset.

Can I use fractional subscripts or hydrates (e.g., CuSO4·5H2O)?

The current parser handles integer counts and nested parentheses. For hydrates using a middle dot (·), replace the dot with a plus sign or expand the hydrate explicitly (e.g., CuSO4 + 5H2O) or enter CuSO4(H2O)5.

Are results rounded?

Results displayed by the calculator are rounded to a sensible number of decimal places, but the PDF download includes values with greater precision where applicable.

Meet the Expert

Prof. Marie Curie

Prof. Marie Curie

Chemistry Expert

Professor Curie is a renowned chemist specializing in analytical and organic chemistry.