Chemistry & Chemical Engineering Moles, Mass & Chemical Formulas IUPAC standard atomic weights (abridged, 2021)

Percent Composition Calculator

This calculator breaks a chemical formula into the mass percent contributed by each element, so you can check a CHN elemental analysis report, read a fertiliser grade, or work out how much iron a given mass of ore actually contains. Enter the formula, pick the element you care about, and you get its mass percent, the grams it supplies per 100 g of compound, and the grams in whatever sample mass you type. Nested brackets and hydrate dots are read correctly, and the percentages always sum to 100.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
Chemical formulaCase matters: Co is cobalt, CO is carbon monoxide. Use a dot for hydrates, as in CuSO4.5H2O.(NH4)2SO4
Element of interestThe one element you want highlighted; every element still appears in the table below.N
Sample massLeave at 100 g to read percentages directly as grams; change it to size a real batch.100 g

It returns

  • Mass percent of the chosen element — Mass of that element in one mole of compound, divided by the molar mass.
  • Grams of that element in your sample
  • Molar mass of the compound
  • Atoms of that element per formula unit
  • Mass of that element per mole of compound

The formula

%X=100nXAr,XM
mX=%X100msample

In plain text: %X = 100 × (nₓ × Aᵣ,ₓ) / M

  • %XMass percent of element X in the compound (%)
  • nₓAtoms of X in one formula unit (count)
  • Aᵣ,ₓStandard atomic weight of X (g/mol)
  • MMolar mass of the whole compound (g/mol)

The denominator is the molar mass of the entire formula unit, including any water of crystallisation. Percentages over all elements sum to exactly 100.

Updated Category Moles, Mass & Chemical Formulas Verified against published test cases Reading time 9 min

What percent composition tells you

Percent composition is the fraction of a compound's mass supplied by each element. It answers a practical question: if you buy a tonne of this material, how many kilograms of the element you actually want are in the bag? A 50 kg bag of ammonium sulfate is 21.2% nitrogen, so it delivers 10.6 kg of nitrogen — which is exactly what the 21-0-0 grade printed on the bag means.

The quantity runs in two directions, and both matter. Going forward, from a formula to percentages, is what this page does; it gives you the theoretical composition of a pure substance. Going backward, from measured percentages to a formula, is the job of the empirical formula calculator. Analytical chemists use both in the same afternoon: they measure the composition of a new compound by combustion analysis, derive a candidate formula, then compute that formula's theoretical composition and check that the two agree.

Percent composition is also a purity check. If a sample of what should be calcium carbonate assays 38.1% calcium rather than the theoretical 40.04%, roughly 5% of the mass is something else. That single comparison is the basis of a great deal of quality control in the mineral, cement and fertiliser industries.

The formula, and the denominator people get wrong

Multiply the number of atoms of the element by its standard atomic weight to get the mass that element contributes to one mole of compound. Divide by the molar mass of the whole formula unit. Multiply by 100.

The numerator is straightforward as long as you count every occurrence of the element. In ammonium sulfate, (NH₄)₂SO₄, nitrogen appears inside a bracket with subscript 2, so there are two nitrogen atoms, not one. In sodium hydrogen carbonate, NaHCO₃, hydrogen appears once; in ammonium carbonate, (NH₄)₂CO₃, it appears eight times.

The denominator is where errors hide, and there is one specific trap: water of crystallisation belongs in the denominator. Copper(II) sulfate pentahydrate is 25.45% copper, but the anhydrous salt is 39.81% copper. Both numbers are correct for their own substance. If your reagent bottle says pentahydrate and you use the anhydrous percentage, you will under-deliver copper by more than a third. Whenever a compound can be hydrated, decide which substance you actually have before you compute anything.

Because every element's contribution is divided by the same total, the percentages sum to exactly 100. That is a free arithmetic check — if the table below does not add to 100, something has been mis-parsed.

Worked example: nitrogen in ammonium sulfate

Ammonium sulfate, (NH₄)₂SO₄, is sold as a 21-0-0 nitrogen fertiliser. Verify the grade.

  1. Count the atoms. The bracket subscript 2 doubles everything inside: 2 nitrogen and 8 hydrogen. Outside it, 1 sulfur and 4 oxygen.
  2. Nitrogen contribution. 2 × 14.007 = 28.014 g/mol.
  3. Hydrogen contribution. 8 × 1.008 = 8.064 g/mol.
  4. Sulfur contribution. 1 × 32.06 = 32.06 g/mol.
  5. Oxygen contribution. 4 × 15.999 = 63.996 g/mol.
  6. Molar mass. 28.014 + 8.064 + 32.06 + 63.996 = 132.134 g/mol.
  7. Percent nitrogen. 100 × 28.014 ÷ 132.134 = 21.20%.

That matches the printed grade, which is rounded down to 21. Now size a real application: to apply 40 kg of nitrogen per hectare you need 40 ÷ 0.2120 = 188.7 kg of ammonium sulfate per hectare. The same arithmetic on urea, CO(NH₂)₂ at 46.65% N, would need only 85.7 kg — which is why urea dominates bulk nitrogen shipping even though ammonium sulfate also supplies 24.26% sulfur that urea does not.

How to read the result

Compare against the theoretical value for the substance you believe you have. In synthetic chemistry the accepted criterion for reporting a new compound is agreement between measured and calculated carbon, hydrogen and nitrogen percentages to within 0.4 percentage points. A carbon result well below the calculated value usually means residual solvent or water; a nitrogen result above it often means a retained ammonium salt.

For minerals, the percentage is the theoretical grade of the pure mineral, not of the ore. Pure hematite, Fe₂O₃, is 69.94% iron; a shipped iron ore assaying 62% Fe is therefore about 89% hematite by mass with the balance silica and alumina. The gap between mineral grade and ore grade is the entire business of beneficiation.

For anything you will dissolve, convert the percentage into what you actually need. Grams of element wanted, divided by the mass fraction, gives grams of compound to weigh. From there the molarity calculator takes you to a solution of known concentration, and the dilution calculator to a working strength.

Theoretical composition of compounds people look up

Mass percent of the named element, computed from IUPAC abridged atomic weights.
CompoundFormulaElementMolar mass (g/mol)Mass percent
WaterH₂OO18.01588.81%
AmmoniaNH₃N17.03182.24%
UreaCH₄N₂ON60.05646.65%
Ammonium nitrateNH₄NO₃N80.04335.00%
Ammonium sulfate(NH₄)₂SO₄N132.13421.20%
Carbon dioxideCO₂C44.00927.29%
GlucoseC₆H₁₂O₆C180.15640.00%
Calcium carbonateCaCO₃Ca100.08640.04%
HematiteFe₂O₃Fe159.68769.94%
MagnetiteFe₃O₄Fe231.53172.36%
Copper(II) sulfate, anhydrousCuSO₄Cu159.60239.81%
Copper(II) sulfate pentahydrateCuSO₄·5H₂OCu249.67725.45%
Sodium chlorideNaClNa58.44039.34%
Potassium chlorideKClK74.54852.45%

The two copper sulfate rows show why the hydrate state must be settled before any composition figure is used.

Where percent composition calculations go wrong

  • Ignoring the hydrate. The waters count in the denominator, and they can be a third of the mass. Anhydrous and hydrated forms give genuinely different percentages for the same element.
  • Missing atoms inside brackets. A subscript outside a bracket multiplies everything within it. (NH₄)₂SO₄ has two nitrogens and eight hydrogens.
  • Confusing elemental percent with oxide percent. Fertiliser labels quote phosphorus as P₂O₅ and potassium as K₂O, not as the elements. A 0-46-0 phosphate is 46% P₂O₅, which is only 20.1% elemental phosphorus.
  • Comparing a mineral grade to an ore grade. The formula gives the composition of the pure mineral. Real ore is a mixture and always assays lower.
  • Using mass percent where mole percent is meant. Gas mixtures and alloy phase diagrams are often quoted in mole or atom percent, which for elements of different atomic weight is a different number entirely.
  • Assuming a percentage proves identity. Compounds with the same empirical formula share the same composition: formaldehyde CH₂O, acetic acid C₂H₄O₂ and glucose C₆H₁₂O₆ are all 40.00% carbon.

Related methods and when to use them instead

Percent composition is one leg of a triangle. The second leg is the empirical formula, which converts measured percentages back into an atom ratio. The third is the molar mass, which turns that ratio into a molecular formula once you know how heavy the molecule is. Any two of the three determine the position of the third.

In the laboratory the measurement itself is usually combustion analysis: a milligram of sample is burned in oxygen, the carbon dioxide and water produced are weighed or measured by thermal conductivity, and carbon and hydrogen percentages follow directly. Nitrogen comes from the same instrument; oxygen is normally reported by difference rather than measured, which is why an oxygen percentage from CHN data carries every other element's error.

Two conventions are worth knowing because they look like percent composition and are not. Weight percent in a solution divides solute mass by total solution mass and has nothing to do with a formula. Atom percent counts atoms rather than mass, and for a compound of light and heavy elements the two diverge sharply: water is 88.81% oxygen by mass but only 33.3% oxygen by atom count.

Finally, note what this calculation cannot see. It uses average atomic weights, so an isotopically enriched sample will not match. It assumes the substance is pure and stoichiometric, which many minerals are not — natural olivine, for instance, varies continuously between magnesium and iron end members and has no single percent composition at all.

Frequently asked questions

How do I calculate percent composition by mass?

Divide the mass one element contributes to a mole of compound by the compound's molar mass, then multiply by 100. Count every atom of that element in the formula, including those inside brackets, and include any water of crystallisation in the molar mass on the bottom. Repeating the calculation for each element gives a set of percentages that must add to 100.

What percentage of nitrogen is in my fertiliser?

Enter the compound formula and set the element to N. Urea, CH₄N₂O, is 46.65% nitrogen; ammonium nitrate is 35.00%; ammonium sulfate is 21.20%. To convert a target application rate into product mass, divide the nitrogen you want by the mass fraction — 40 kg of N from ammonium sulfate needs 40 ÷ 0.2120 = 188.7 kg of product.

Why do the phosphorus and potassium numbers on a bag not match this calculator?

Because fertiliser labelling in most of the world quotes phosphorus as P₂O₅ and potassium as K₂O rather than as the elements themselves — a convention inherited from nineteenth-century gravimetric analysis. Enter P2O5 or K2O as the formula to reproduce a label figure, and enter the actual compound to get the elemental percentage. The elemental value is always lower: P₂O₅ is 43.64% phosphorus.

Does the water in a hydrate count?

Yes, fully, in the denominator. Copper(II) sulfate pentahydrate is 25.45% copper against the anhydrous salt's 39.81%, because the five waters add 90.075 g/mol of mass that carries no copper. Enter the hydrate exactly as your reagent bottle labels it. Getting this wrong is the most common single-figure error in preparative work.

Can two different compounds have the same percent composition?

Yes, whenever they share an empirical formula. Formaldehyde (CH₂O), acetic acid (C₂H₄O₂) and glucose (C₆H₁₂O₆) are all 40.00% carbon, 6.71% hydrogen and 53.28% oxygen. Composition alone therefore cannot identify a compound — you also need the molar mass, from mass spectrometry or a colligative measurement, to pick the right multiple.

How close should measured and calculated percentages be?

Within about 0.4 percentage points for carbon, hydrogen and nitrogen is the criterion most journals apply to combustion analysis of a new compound. A larger gap usually means an impurity with a systematic signature: low carbon with high hydrogen suggests retained water, while everything low by a similar proportion suggests inorganic ash or residual salt.

Why does my chosen element show a dash instead of zero?

Because the element is not in the formula at all, and a mass percent for something absent is undefined rather than zero in any useful sense — reporting 0% would suggest you measured it and found none. Check the table beneath the results for the elements the formula actually contains, and check your capitalisation: N is nitrogen, Na is sodium.

Is mass percent the same as mole percent?

No, and the difference is large whenever the elements have different atomic weights. Water is 88.81% oxygen by mass but only 33.3% by atom count, because two of its three atoms are hydrogen and hydrogen is light. Chemical formulae are ratios of atoms; balances measure mass. This calculator reports mass percent, which is what elemental analysis and commercial assays use.

References