Percent composition tells you how a compound’s mass is shared among its elements: how much iron is in an ore, how much nitrogen a fertilizer supplies, or how much sodium is in a spoonful of salt. This calculator works in both directions. Give it a formula and it returns the mass percent of each element, or give it percentages from a lab analysis and it finds the empirical formula, and the molecular formula if you know the molar mass.
How to use the percent composition calculator
- Under What do you want to do?, choose Formula → percent by mass or Percentages → empirical formula.
- In formula mode, type the Chemical formula (case matters:
Cois cobalt,COis carbon monoxide). Optionally enter a Sample mass in g, mg, kg, lb, oz or metric tons to split it into the mass of each element. - In empirical mode, list one element per line in Element and percent (or grams), such as
C 40.00. Add the Molar mass of the compound if you know it, to get the molecular formula. - Formula mode shows a percentage for each element, a donut chart and, with a sample mass, a table of element masses. Empirical mode shows the formula in Hill order (C, then H, then alphabetical), the whole-number ratio and a table of every step.
Each element may appear only once in the list, and every amount must be greater than zero.
Percent composition formula
nE is the number of atoms of element E in the formula, AE its atomic weight and M the molar mass of the compound.
Worked example: iron in hematite
Fe2O3: M = 2 × 55.845 + 3 × 15.999 = 159.687 g/mol
Fe: 111.69 ÷ 159.687 × 100 = 69.943% · O: 47.997 ÷ 159.687 × 100 = 30.057%
A 10 g sample therefore holds 6.994 g of iron and 3.006 g of oxygen.
From percentages to an empirical formula
The reverse problem comes from elemental analysis, which reports mass percentages. The calculator follows the classic textbook method:
- Assume a 100 g sample, so each percentage becomes grams.
- Divide each mass by its atomic weight to get moles.
- Divide every mole value by the smallest one.
- If the ratios are not close to whole numbers, multiply them all by the smallest factor (up to 12) that brings each within 0.1 of a whole number.
- If a molar mass is given, divide it by the empirical formula mass and multiply every subscript by the rounded result.
C 40.00%, H 6.71%, O 53.29%
Moles: C 40.00 ÷ 12.011 = 3.330 · H 6.71 ÷ 1.008 = 6.657 · O 53.29 ÷ 15.999 = 3.331
Divide by 3.330: C 1, H 1.999, O 1 → empirical formula CH2O (30.026 g/mol)
With a molar mass of 180.16 g/mol: 180.16 ÷ 30.026 = 6 → molecular formula C6H12O6
When the ratios are not whole numbers
Iron oxide with Fe 69.94% and O 30.06% gives 1.252 mol Fe and 1.879 mol O. Dividing by the smallest gives 1 : 1.5, which is not a formula yet. Multiplying both by 2 gives 2 : 3, so the oxide is Fe₂O₃. Likewise, a hydrocarbon with C 81.71% and H 18.29% gives 1 : 2.667, and multiplying by 3 gives C₃H₈ (propane).
| Ratio ends in about | Multiply by |
|---|---|
| .5 | 2 |
| .33 or .67 | 3 |
| .25 or .75 | 4 |
| .2, .4, .6 or .8 | 5 |
Do not simply round 1.5 to 2 or 2.67 to 3; that gives a different compound. If no small multiplier fits, the calculator notes that the data may contain a measurement error or a missing element.
Element content of everyday compounds
| Compound | Formula | Element of interest | Mass % |
|---|---|---|---|
| Ammonia | NH₃ | Nitrogen | 82.244 |
| Urea | CO(NH₂)₂ | Nitrogen | 46.646 |
| Ammonium nitrate | NH₄NO₃ | Nitrogen | 34.999 |
| Ammonium sulfate | (NH₄)₂SO₄ | Nitrogen | 21.201 |
| Wüstite | FeO | Iron | 77.731 |
| Magnetite | Fe₃O₄ | Iron | 72.360 |
| Table salt | NaCl | Sodium | 39.339 |
The salt row explains a nutrition-label rule of thumb: a gram of salt contains about 393 mg of sodium.
Combustion analysis data
Organic compounds are often analyzed by burning them and weighing the CO₂ and H₂O produced. Convert those to element masses first: grams of C = grams of CO₂ × 12.011 ÷ 44.009, and grams of H = grams of H₂O × 2.016 ÷ 18.015. Enter the results as grams. Any oxygen in the sample is the original mass minus the carbon and hydrogen.
To get a molar mass with a full atom-by-atom table, use the molar mass calculator.
Frequently asked questions
How do I calculate the percent composition of a compound?
Multiply each element's atom count by its atomic weight, divide by the molar mass of the whole compound and multiply by 100. In Fe2O3, iron contributes 2 × 55.845 = 111.69 g/mol out of 159.687 g/mol, which is 69.943%.
How do I find an empirical formula from percentages?
Treat the percentages as grams in a 100 g sample, divide each by the element's atomic weight to get moles, divide all of them by the smallest, and round, multiplying first by 2, 3 or another small number if the ratios end in fractions such as .5 or .33.
How is the molecular formula different from the empirical formula?
The empirical formula is the smallest whole-number ratio of atoms, such as CH2O. The molecular formula is a whole-number multiple of it. Dividing the measured molar mass by the empirical formula mass gives the multiple: 180.16 ÷ 30.026 = 6, so the molecule is C6H12O6.
What if my percentages do not add up to 100?
Usually an element was not measured directly, most often oxygen. Add it as 100 minus the sum of the others. The calculator flags totals between 50 and 150 that miss 100 by more than 1.5 points; other totals are assumed to be grams.
Can I enter grams instead of percentages?
Yes. Only the ratios matter, so grams of each element from an analysis work just as well. For combustion analysis, first convert the grams of CO2 and H2O to grams of carbon and hydrogen.