Percent Composition Calculator
Calculate the percent composition of each element in a compound from its atom counts.
Covers up to five elements with all 118 atomic masses.
Updated August 24, 2026
Introduction
Percent composition is the share of a compound's total mass that comes from each element. When a fertilizer label reads 28-0-6, those numbers are percent compositions by mass — 28% of the weight is nitrogen and 6% is potash. This calculator works the same way: you enter the elements and atom counts from a chemical formula, and it shows how much of the molecular weight each element contributes, both as a mass in atomic mass units (amu) and as a percentage.
You can build a compound from up to five elements. Pick each element from the dropdown on the right of its input, type the number of atoms of that element in one molecule, and the calculator instantly returns the element masses, the molecular weight, and the percent composition of every element — plus a pie chart that makes the proportions easy to compare at a glance.
Who is this for? Students checking stoichiometry homework, lab workers preparing solutions of known composition, and anyone who needs the mass percentage of an element without working through each atomic weight by hand.
How to use
Pick the first element from the dropdown on the right of the input — for example, Hydrogen (H).
Enter the number of atoms of that element in one molecule of the compound. For water (H₂O), Hydrogen gets 2.
Repeat for each element in the formula. For water, add Oxygen (O) with 1 atom. You can use up to five element slots.
Read the results: the molecular weight, each element's mass in the compound, and its percent composition. The pie chart shows the same proportions visually.
Worked example — water (H₂O)
- Select Hydrogen (H) as the 1st element, atoms 2.
- Select Oxygen (O) as the 2nd element, atoms 1.
The calculator reports hydrogen at 11.19% and oxygen at 88.81% of the total mass.
Calculation method
The calculator works in three steps. First, the mass of each element in one molecule is the number of its atoms multiplied by its atomic mass:
The molecular weight is the sum of all element masses:
Finally, each element's percent composition is its mass divided by the molecular weight, expressed as a percentage:
Where:
- — number of atoms of element i in one molecule
- — atomic mass of element i (amu)
- — mass of element i in the compound (amu)
- — molecular weight of the compound (amu)
The atomic masses used here are the standard atomic weights recommended by the CIAAW (Commission on Isotopic Abundances and Atomic Weights), the body that maintains these values for IUPAC. They are weighted averages that account for the natural isotopic distribution of each element, so the molecular weight you get is the average mass per molecule for a naturally occurring sample. To explore how atomic mass is derived from protons and neutrons, see the Atomic Mass Calculator.
amu or g/mol? The molecular weight is reported in atomic mass units (amu), which is numerically identical to the molar mass in g/mol. So 18.015 amu for water is the same number as 18.015 g/mol — you can use it directly in mole conversions. If you want the molar mass of a compound built from its formula, the Molar Mass Calculator returns it in g/mol with a per-element breakdown.
Real-world examples
Sulfuric acid — H₂SO₄
One of the most widely produced industrial chemicals. Two hydrogen, one sulfur, and four oxygen atoms.
The calculator shows sulfur at 32.69% and oxygen at 65.25% of the mass — useful when estimating how much sulfur a given mass of acid contains.
Table sugar — C₁₂H₂₂O₁₁
Sucrose. Twelve carbon, twenty-two hydrogen, and eleven oxygen atoms.
Carbon makes up 42.11% of sugar's mass, hydrogen 6.48%, and oxygen 51.41%. These are the numbers behind the common claim that “100 g of sugar contains about 42 g of carbon.”
Tips & best practices
Write the formula first
Count the atoms from the chemical formula before entering them. A common slip is forgetting parentheses — Ca(OH)₂ has two oxygen and two hydrogen atoms, not one of each.
Mass % is not atom %
Percent composition is by mass, not by atom count. In water, hydrogen is two of three atoms (67% of atoms) but only 11% of the mass, because oxygen atoms are much heavier. Don't confuse the two.
Percentages should sum to 100%
The displayed percentages always add up to about 100%. If yours don't, check that you selected the right elements and atom counts — a quick built-in sanity check.
Use it to find an empirical formula
Divide each percent composition by the element's atomic mass, then scale the results to whole numbers — that gives the simplest whole-number ratio of atoms, the empirical formula.
Limitations
- •Up to five element entries can be used at once. Compounds with more than five distinct elements cannot be entered in a single calculation.
- •The calculator uses standard atomic weights, which are averages over natural isotopic abundances. The exact mass of a specific isotope (for example, carbon-12 at exactly 12.000) will differ slightly.
- •This tool covers neutral formulas. For ions, the charge does not change the mass because electrons are negligible, so you can enter the atoms as they appear in the formula.
- •Results are for educational and planning use. For laboratory work, verify against your own measurements and the atomic weights your institution uses.
Frequently asked questions
Why do the percentages not add up to exactly 100%?
The displayed values are rounded for readability, so they can sum to 99.9% or 100.1%. The underlying calculation uses full precision — the tiny discrepancy is only a display artifact.
Is molecular weight the same as molar mass?
They are numerically equal but use different units. Molecular weight is the mass of a single molecule in atomic mass units (amu); molar mass is the mass of one mole in g/mol. The number is the same, so you can use the result directly in mole conversions.
Can I use this for ions or hydrates?
Yes. For an ion like SO₄²⁻, enter Sulfur (1) and Oxygen (4) — the charge does not affect the mass. For a hydrate like CuSO₄·5H₂O, treat the dot as addition: enter Copper (1), Sulfur (1), Oxygen (4 + 5 = 9), and Hydrogen (10).
Where do the atomic masses come from?
They are the standard atomic weights maintained by the CIAAW (Commission on Isotopic Abundances and Atomic Weights), the IUPAC body that publishes these values.
Related Calculators
Percentage of a Percentage Calculator
Calculate cumulative percentages by multiplying two percentages together
Atom Calculator
Calculate atomic properties including protons, neutrons, electrons, atomic number and mass number
Electron Configuration Calculator
Get the electron configuration for any element from the periodic table. View atomic number, atomic mass, and valence electrons.
Atomic Mass Calculator
Calculate atomic mass from protons and neutrons. Get atomic mass in various units including atomic mass units (u), kilograms, and more.
Electronegativity Calculator
Calculate electronegativity difference between two elements and determine bond type (ionic, polar covalent, or nonpolar covalent).
Average Atomic Mass Calculator
Calculate the average atomic mass of an element based on the isotopes and their natural abundances.