Understanding the percent composition calculator — concept and principle
This calculator parses a chemical formula and gives the molar mass, the mass percent of each element and how many grams of each element a sample contains. It handles brackets and hydrates. Chemistry students use it for stoichiometry, empirical-formula problems and checking lab results.
How it is calculated
Molar mass M = Σ (n × A)
Mass percent of element X = n_X × A_X ÷ M × 100
Grams of X in a sample = sample mass × percent ÷ 100
- A are IUPAC abridged standard atomic weights (C 12.011, H 1.008, O 15.999 …).
- Brackets multiply everything inside; a hydrate dot adds whole water molecules.
The principle
A chemical formula fixes the ratio of atoms. Multiplying each atom count by its atomic weight gives that element's share of the formula's mass, and dividing by the total gives its percent. Because every sample of a pure compound has the same composition (the law of definite proportions), these percentages apply to any amount of it.
Worked example
Default inputs: C₆H₁₂O₆ (glucose), sample 25 g.
- M = 6 × 12.011 + 12 × 1.008 + 6 × 15.999 = 180.156 g/mol; 3 elements, 24 atoms.
- C: 72.066 ÷ 180.156 = 40.002%, so 10 g in 25 g.
- H: 12.096 ÷ 180.156 = 6.714%, so 1.679 g.
- O: 95.994 ÷ 180.156 = 53.284%, so 13.321 g.
How to read the result
The percentages add up to 100%. Comparing measured percentages from elemental analysis with calculated values checks whether a compound is pure or confirms its formula. Going the other way, percent composition can be turned into an empirical formula.
Common mistakes
- Misreading subscripts or brackets, such as Ca(OH)₂.
- Forgetting the water in a hydrate like CuSO₄·5H₂O.
- Using rounded atomic weights and expecting exact matches.
- Writing element symbols with wrong capitals (Co is cobalt; CO is carbon monoxide).
Frequently asked questions
What percent of glucose is carbon?
About 40.0% by mass.
How do I enter a hydrate?
Use a dot, for example CuSO4·5H2O or CuSO4*5H2O.
Why do percentages from different tables differ slightly?
They use slightly different atomic weights.
Can I get an empirical formula from percentages?
Yes: divide each percent by its atomic weight and find the simplest whole-number ratio.
Sources: OpenStax, Chemistry 2e (2019), section 3.2 "Determining Empirical and Molecular Formulas" · IUPAC abridged standard atomic weights