Percentage Composition by Mass Calculator for Any Formula
What fraction of this compound is the element you care about?
Build the formula from element dropdowns and subscripts, say which element you are asking about, and the page returns its percentage by mass — along with the grams of compound you would have to weigh out to get ten grams of that element. The stacked bar shows the whole composition at once, which is how you catch a mis-read bracket before you trust the number.
Percentage by mass of one element
ammonium nitrate NH4NO3 — nitrogen 2, hydrogen 4, oxygen 3 — asking about the nitrogen in the first slot
One division, and the only hard part is reading your own formula
- subscript × Ar
- the mass that one element brings to a formula unit. For nitrogen in ammonium nitrate that is 2 × 14.007 = 28.014, counting BOTH nitrogens — the one in the ammonium and the one in the nitrate
- M
- the molar mass of the whole formula unit, the sum over every slot. Get it wrong and every percentage is wrong by the same factor, which is why the page prints it
- % X
- the percentage by mass. Also called the mass fraction when written as a decimal, and sometimes w/w. It is independent of how much you have: a milligram of ammonium nitrate is 35.00 per cent nitrogen and so is a tonne
- Σ% = 100
- the free self-check. Four shares of one total must add to a hundred, so if the printed sum is not 100.00 something is wrong with the page rather than with your chemistry
- 100 / %X
- how many grams of compound carry one gram of the element — the practical form of the answer. For 35.00 per cent nitrogen it is 2.857 g of fertiliser per gram of nitrogen, and that is the number an agronomist actually uses
Worked example
ammonium nitrate NH4NO3 — nitrogen 2, hydrogen 4, oxygen 3 — asking about the nitrogen in the first slot
SPLIT THE FORMULA CAREFULLY. NH4NO3 contains two nitrogen atoms, four hydrogens and three oxygens. The two nitrogens are in different places chemically — one is the ammonium ion, one is the nitrate ion — but a mass calculation cannot tell them apart and does not need to, so they go in one slot with a subscript of 2.
MASS OF EACH ELEMENT PER MOLE. Nitrogen: 2 × 14.007 = 28.014 g. Hydrogen: 4 × 1.0080 = 4.032 g. Oxygen: 3 × 15.999 = 47.997 g.
MOLAR MASS. 28.014 + 4.032 + 47.997 = 80.043 g/mol. Worth noting that oxygen contributes more than nitrogen does, even though there is one fewer oxygen atom than there are hydrogen and nitrogen atoms combined.
DIVIDE AND MULTIPLY BY 100. Nitrogen: 100 × 28.014 / 80.043 = 35.00%. That is the number printed on the sack, and it is the highest nitrogen content of any straight solid fertiliser in common use — which is exactly why ammonium nitrate is the one that gets made in such quantity.
AND THE OTHER TWO, because they are free and they are the check. Hydrogen: 100 × 4.032 / 80.043 = 5.04%. Oxygen: 100 × 47.997 / 80.043 = 59.96%. 35.00 + 5.04 + 59.96 = 100.00.
TURN IT INTO SOMETHING USABLE. To get 10.00 g of nitrogen you need 1000 / 35.00 = 28.57 g of ammonium nitrate. Compare urea, CO(NH2)2, at 46.65 per cent nitrogen: 21.44 g. That difference — roughly a third less material for the same nitrogen — is the whole commercial argument between the two fertilisers, and it comes out of this one division.
Nitrogen in the common fertilisers, and why the percentages differ so much
| Fertiliser | Slots to type | Molar mass | % nitrogen | Grams needed for 10 g of N |
|---|---|---|---|---|
| Urea, CO(NH2)2 | N 2, H 4, C 1, O 1 | 60.056 | 46.65% | 21.44 g |
| Ammonium nitrate, NH4NO3 | N 2, H 4, O 3 | 80.043 | 35.00% | 28.57 g |
| Ammonium sulfate, (NH4)2SO4 | N 2, H 8, S 1, O 4 | 132.134 | 21.20% | 47.17 g |
| Potassium nitrate, KNO3 | K 1, N 1, O 3 | 101.102 | 13.85% | 72.18 g |
| Calcium nitrate, Ca(NO3)2 | Ca 1, N 2, O 6 | 164.086 | 17.07% | 58.57 g |
| Ammonia, NH3 (the gas itself) | N 1, H 3 | 17.031 | 82.24% | 12.16 g |
Percentage by mass, and the three places it goes wrong
Percentage composition by mass is one division: the mass one element brings to a formula unit, over the mass of the whole formula unit, times a hundred. There is nothing subtle in the arithmetic. What there is instead is a set of reliable ways to get the inputs wrong, and this page is laid out to catch them.
First: the brackets. A subscript outside a bracket multiplies everything inside it. Ammonium sulfate (NH4)2SO4 is nitrogen 2, hydrogen 8, sulfur 1, oxygen 4. Type hydrogen 4 and you get a molar mass of 128.102 instead of 132.134, and a nitrogen percentage of 21.87 instead of 21.20. Both are plausible numbers and nothing in the calculation objects, because you asked about a different compound and it answered correctly. The stacked bar is the defence: a hydrogen sliver that looks half the size you expected is visible in a way a wrong decimal is not.
Second: the water in a hydrate. The dot in CuSO4·5H2O means the crystal carries five water molecules per formula unit, and they count towards the mass like everything else. The hydrated salt is 249.677 g/mol against the anhydrous 159.602, so its copper content is 25.45 per cent rather than 39.82. In a school laboratory this is the difference between a titration that works and one that is 36 per cent out, and the blue crystals and the white powder sit on the same shelf.
Third, and most interesting: mass share is not atom share. These are different questions and a badly worded one can mean either. In ammonium nitrate the hydrogen is four of the nine atoms — 44 per cent of the atoms — and 5.04 per cent of the mass. The page gives you both rows so the ambiguity is visible rather than fatal. If a question asks what proportion of a compound is hydrogen, it almost always means by mass, but it is worth half a second to be sure.
Why oxygen keeps winning. Read down the stacked bars of any set of inorganic salts and oxygen dominates nearly all of them: 60 per cent of ammonium nitrate, 58 per cent of calcium nitrate, 48 per cent of calcium carbonate, 65 per cent of sulfuric acid. Oxygen is not heavy — 15.999 against sulfur’s 32.06 and calcium’s 40.078 — but it arrives in threes, fours and sixes, and three light atoms outweigh one middling one. Hydrogen is the mirror image: in sucrose it is 22 of the 45 atoms and 6.5 per cent of the mass. Carrying those two expectations in your head makes a wrong answer on this page look wrong immediately.
The practical form of the answer is the reciprocal. “35 per cent nitrogen” is a fact; “28.57 g of this for every 10 g of nitrogen” is a decision. The page prints both. That reciprocal is what a fertiliser price comparison, an ore grade and a dietary mineral label are all really quoting, and it is where percentage composition stops being a school exercise. Urea at 46.65 per cent nitrogen needs 21.44 g against ammonium nitrate’s 28.57 g for the same nitrogen delivered — a third less material to ship, which is most of the commercial argument between them.
This page is the exact inverse of the empirical and molecular formula calculator, and using the two together is the best check either of them offers: take the percentages this page produces, feed them into that one, and the subscripts you started with should come back out. For the molar mass on its own, with a longer element list and the mass-share diagram, use the molar mass calculator. To turn a mass of compound into moles or particles, use the mole, mass and particle count calculator. For percentage concentrations of a SOLUTION rather than a compound — w/v, w/w and v/v — that is a different quantity entirely and the laboratory side of the site owns it in the percent solution calculator.
Frequently asked questions
Does percentage composition depend on how much I have?
No, and that is the whole reason it is useful. It is a property of the compound: a milligram of ammonium nitrate is 35.00 per cent nitrogen and so is a shipping container of it. That is why the page asks only for a formula and never for a mass, and why the answer can be printed on a sack.
How do I handle a formula with brackets?
Multiply out before typing. The subscript outside the bracket multiplies every subscript inside it. (NH4)2SO4 is nitrogen 2, hydrogen 8, sulfur 1, oxygen 4 — the hydrogen is 8 because 2 × 4 = 8, and that is the single most common error on this page. Ca(NO3)2 is calcium 1, nitrogen 2, oxygen 6.
Should the water in a hydrate be included?
Yes, if your sample is the hydrate. Fold the water’s atoms into the slots: five waters add 10 hydrogens and 5 oxygens, so CuSO4·5H2O is copper 1, sulfur 1, oxygen 9, hydrogen 10. Its copper content is 25.45 per cent against the anhydrous salt’s 39.82 per cent. Which one you want depends on which bottle you are weighing from, and that is a question about your bench rather than about chemistry.
The percentage of atoms and the percentage of mass are completely different. Which does the question want?
By mass, almost always — that is the standard meaning of “percentage composition”. But the two really are different and the page prints both so you can see it: in ammonium nitrate hydrogen is 44 per cent of the atoms and 5.04 per cent of the mass. If a question gives you a mass of compound and asks for a mass of element, it wants the mass percentage.
Why does oxygen have the biggest share in nearly everything?
Because it comes in multiples. Oxygen is a light atom, lighter than every metal and lighter than sulfur, phosphorus or chlorine. But sulfates have four of it, nitrates three, phosphates four, carbonates three, and three or four light atoms outweigh one middling one. It is a counting effect rather than a weight effect, and it is worth expecting: in almost any oxo-salt, oxygen takes between 40 and 65 per cent of the mass.
Can I ask about an element that appears in two places in the formula?
Put the total in one slot. A mass calculation has no way to distinguish the nitrogen in the ammonium of NH4NO3 from the nitrogen in the nitrate, and no reason to: both weigh 14.007. So the slot takes nitrogen with a subscript of 2 and the answer, 35.00 per cent, is the total nitrogen. If you genuinely need the two contributions separately, put nitrogen in two slots with subscripts of 1 each — the molar mass is unchanged and you get two 17.50 per cent rows.
Related calculators
References
- Commission on Isotopic Abundances and Atomic Weights (CIAAW), IUPAC, Abridged Standard Atomic Weights (read 14 November 2026). The source of every atomic weight in this batch’s dropdowns. The table read was the 2024 abridged list, which is the Standard atomic weights of the elements 2021 report (Prohaska and colleagues, IUPAC Technical Report) with 2024 revisions to gadolinium, lutetium and zirconium — none of which appears here. The values are quoted exactly as that table prints them, including the trailing zeros that carry information: hydrogen is 1.0080 ± 0.0002 and neon 20.180 ± 0.001, while lead is 207.2 ± 1.1 and argon 39.95 ± 0.16 because both vary measurably between natural sources. An atomic weight is a weighted mean over the isotopes of normal terrestrial material, not a property of one atom, which is why some elements get five figures and some get four.
- IUPAC, Periodic Table of Elements and the accompanying announcement “Time to review your periodic table”, iupac.org (read 14 November 2026). Confirms that the standard atomic weights are revised on a two-year cycle and that the number on a classroom wall chart may be several revisions behind. Worth knowing before you argue with a marker about the third decimal place: for the elements on this page the differences between recent revisions are far smaller than the rounding a school question asks for, so a textbook’s 12, 14, 16, 1 and 32 will reproduce every answer here to the two significant figures a mark scheme wants.
- Bureau International des Poids et Mesures, SI base unit: mole (mol), bipm.org (read 14 November 2026). The current definition, in its own words: “One mole contains exactly 6.022 140 76 × 1023 elementary entities”, that number being the fixed numerical value of the Avogadro constant NA expressed in mol−1, so the page states the exact relation NA = 6.022 140 76 × 1023 mol−1. Since the 2019 revision the mole is defined by that count and no longer by a mass of carbon-12, so Avogadro’s number is exact by definition and carries no uncertainty at all — a change most school textbooks printed before 2019 do not yet reflect. The brochure also notes that an elementary entity may be an atom, a molecule, an ion, an electron or any other specified particle or group of particles, which is why this site always asks you what you are counting.
- COULD NOT BE READ, and nothing was substituted for it. The intended school-syllabus reference for this batch was NCERT’s own Class XI chemistry Unit 1, Some Basic Concepts of Chemistry — the chapter that introduces the mole, percentage composition, the empirical formula and the limiting reagent to most of this page’s readers. A search on 14 November 2026 returned only commercial coaching mirrors and solution sites, not the NCERT document itself, so no NCERT page, example or numbered exercise is cited anywhere in this batch and no figure here is attributed to it. Where this batch names a syllabus it names it only as context. If your class works from that chapter, its worked examples use the same definitions as these pages; the arithmetic below was derived independently from the atomic weights and the definition of the mole.
