What this calculator does
Find out what share of a compound's weight comes from each element. That's its percent composition: what part of every gram comes from each element. Water is about 11% hydrogen and 89% oxygen by mass. That's true even though it has twice as many hydrogen atoms as oxygen atoms. Each oxygen atom is roughly sixteen times heavier.
Type a formula, and the calculator works out the molar mass, the weight of one mole of the compound. (A mole is a chemist's counting unit for atoms.) Then it finds each element's share of that weight, with the largest share first. A second mode covers the other everyday meaning of mass percent. That's how much of a solution's weight is the dissolved substance, as in a 5% salt solution by weight.
Where it's used
Why this math matters outside the classroom:
- Fertilizer labels. Gardeners comparing fertilizers can work out that urea, CO(NH₂)₂, is about 46.6% nitrogen by mass.
- Water. Students find that water is about 11.2% hydrogen and 88.8% oxygen by mass.
- Metal ores. Metallurgists rate ores by metal content, so iron(III) oxide, Fe₂O₃, is about 69.9% iron.
- Sugar solutions. A solution of 10 g of sugar in 90 g of water is 10 ÷ 100 = 10% sugar by mass.
- Identifying compounds. Chemists compare measured element percentages with a formula's calculated ones to check a new compound's identity.
How to use it
- Choose the mode: elements in a compound, or a solute in a solution.
- For a compound, type its formula with the right capital letters, for example C6H12O6 or Ca3(PO4)2.
- For a solution, enter the mass of the solute (what's dissolved). Then enter either the mass of the solvent (what it's dissolved in) or the total mass of the solution. Use the same unit for both.
- Read the percentages, the breakdown table and the steps.
What the inputs mean
- Chemical formula
- Capital letters matter: Co is cobalt, but CO is carbon plus oxygen. Brackets and hydrate dots are supported.
- Mass of solute
- The substance that is dissolved, such as salt or sugar.
- Mass of solvent
- The substance doing the dissolving, usually water. The solution mass is solute plus solvent.
Formula and method
mass % of element = (atoms × atomic weight) ÷ molar mass × 100 mass % of solute = solute mass ÷ (solute mass + solvent mass) × 100
For a compound, each element adds its number of atoms times its atomic weight (the weight of one of its atoms, on the chemist's scale). The molar mass is the total of all those. Divide each element's part by that total to get a fraction, then multiply by 100 to make it a percent. The percentages always add up to 100.
For a solution, you divide by the mass of the whole solution, not just the solvent. Since it compares two masses, any mass unit works, as long as both use it.
Worked example
What is the percent composition of glucose, C6H12O6?
- Molar mass: 6 × 12.011 + 12 × 1.008 + 6 × 15.999 = 180.156 g/mol.
- Carbon: 72.066 ÷ 180.156 × 100 = 40.002%.
- Hydrogen: 12.096 ÷ 180.156 × 100 = 6.714%.
- Oxygen: 95.994 ÷ 180.156 × 100 = 53.284%.
Result: Glucose is 53.284% oxygen, 40.002% carbon and 6.714% hydrogen by mass.
Understanding the result
Two compounds with the same ratio of atoms have the same percent composition. Glucose (C6H12O6) and formaldehyde (CH2O) both come out at about 40% carbon. So percent composition alone gives only the simplest ratio of atoms (the empirical formula). It can't tell you the actual molecule (the molecular formula).
In the solution mode, 15 g of solute in 185 g of water is 7.5% by mass. That's not the same as 7.5% by volume or 7.5 g per 100 mL. Those are other common ways to state concentration (how strong a solution is).
Assumptions and limitations
- Atomic weights are the official short-form (abridged) IUPAC values. They're for elements as found in nature, with their natural mix of isotopes (atom versions of slightly different weight).
- In the solution mode, the solute and solvent masses are in the same unit, and the solute is fully dissolved.
- The calculator works from a formula to percentages. Going the other way, from measured percentages to an empirical formula, is a different calculation.
- Mass percent (w/w) can't be converted to molarity or w/v percent without the solution's density.
- Elements without a standard atomic weight use a mass number (the count of particles in the atom's center) instead. The results flag this.
Frequently asked questions
Is percent composition the same as mass percent?
For a compound, yes: percent composition usually means the mass percent of each element. Mass percent is also used for mixtures and solutions. That's why this calculator has a second mode for a solute in a solution.
Why do hydrogen percentages look so small?
Hydrogen is the lightest element, with an atomic weight of about 1.008. So even many hydrogen atoms add little mass. In glucose, 12 of the 24 atoms are hydrogen, but they make up only about 6.7% of the mass.
What is the difference between w/w, w/v and v/v percent?
w/w is the mass of solute per mass of solution, which this calculator works out. w/v is grams of solute per 100 mL of solution. v/v is the volume of solute per volume of solution. They agree only in special cases. One is a weak (dilute) water solution, where 100 mL weighs close to 100 g.
Do the percentages always add up to exactly 100?
The unrounded values do. When each percentage is rounded for display, the total can be off by a few hundredths. That's normal rounding error.
How this calculator is checked
Method: Element mass fraction from atom counts and IUPAC abridged atomic weights; solution mass percent = m(solute)/m(solution) × 100. The calculation is covered by automated tests with known reference values and edge cases. Last updated 2026-10-18. Found a problem? Tell us.
Embed this calculator
Put this Percent Composition Calculator on your own website or blog for free. Paste this code where you want it to appear: