Percent Composition by Mass Calculator
Find what percent of a compound's total mass comes from each element. Type a chemical formula and get every element's mass percent instantly, convert it into real grams for any sample size, and see a full step-by-step solution.
Type a chemical formula to see how much of its mass comes from each element.
Advanced: mass of each element in a real sample
See exactly how many grams of each element are in a real weighed sample of this size.
Advanced: sample size needed for a target element mass
Find out how much of the whole compound you'd need to weigh out to obtain that much of one element.
CaCO3 — Percent composition
Formula used: % element = (mass of element ÷ molar mass) × 100
100.086 g/mol
Molar mass
O (47.96%)
Highest by mass
C (12%)
Lowest by mass
3
Elements
Mass of each element in 100 g of CaCO3
| Element | Percent | Mass in sample |
|---|---|---|
| Oxygen (O) | 47.956% | 47.956 g |
| Calcium (Ca) | 40.044% | 40.044 g |
| Carbon (C) | 12.001% | 12.001 g |
Percent Composition by Mass — CaCO3
How much of the total mass each element contributes, shown to scale.
| Element | Atoms | Atomic mass | Mass contribution | Percent |
|---|---|---|---|---|
| Oxygen (O) | 3 | 15.999 g/mol | 47.997 g/mol | 47.956% |
| Calcium (Ca) | 1 | 40.078 g/mol | 40.078 g/mol | 40.044% |
| Carbon (C) | 1 | 12.011 g/mol | 12.011 g/mol | 12.001% |
Step-by-Step Percent Composition Calculation
Here's exactly how this answer was calculated, one step at a time.
Given: Formula: CaCO3
Step 1: List every element with its subscript, from the formula
Every element symbol in a formula is followed by a subscript telling you how many atoms of it are present. No subscript means 1 atom.
O: 3 atom(s), Ca: 1 atom(s), C: 1 atom(s)Step 2: Multiply the atomic mass of Oxygen (O) by its atom count
15.999 g/mol × 3 = 47.997 g/molStep 3: Multiply the atomic mass of Calcium (Ca) by its atom count
40.078 g/mol × 1 = 40.078 g/molStep 4: Multiply the atomic mass of Carbon (C) by its atom count
12.011 g/mol × 1 = 12.011 g/molStep 5: Add up every element's contribution to get the molar mass
47.997 + 40.078 + 12.011 = 100.086 g/molStep 6: Divide Oxygen's mass by the total molar mass, then multiply by 100
This is the percent composition formula: % element = (mass of element in formula ÷ molar mass of compound) × 100.
(47.997 ÷ 100.086) × 100 = 47.956%Step 7: Divide Calcium's mass by the total molar mass, then multiply by 100
This is the percent composition formula: % element = (mass of element in formula ÷ molar mass of compound) × 100.
(40.078 ÷ 100.086) × 100 = 40.044%Step 8: Divide Carbon's mass by the total molar mass, then multiply by 100
This is the percent composition formula: % element = (mass of element in formula ÷ molar mass of compound) × 100.
(12.011 ÷ 100.086) × 100 = 12.001%
Percent composition:
O 47.956%, Ca 40.044%, C 12.001%
Percent Composition by Mass Calculator: Find the % of Each Element in a Compound
This percent composition calculator tells you exactly what share of a compound's total mass comes from each element inside it. Type in a chemical formula such as H2O, CaCO3, or NH4NO3, and it works out the molar mass, splits it apart element by element, and shows you the mass percent of each one instantly, with the full working shown underneath so you can see exactly how the number was reached.
Percent composition is one of the first calculations most people meet in a chemistry class, and it keeps showing up long after that — on fertiliser bags, food labels, mineral fact sheets, and lab reports. This tool is built to answer the question quickly, whether you're checking homework, planning a lab, or just curious how much oxygen is actually inside a molecule of glucose.
What Is Percent Composition?
Percent composition by mass is simply the percentage of a compound's total mass that is made up by one particular element. Every compound is built from atoms of different elements bonded together, and each of those atoms carries its own mass. Add up the mass every atom of one element contributes, divide that by the total mass of the whole compound, and multiply by 100 — that percentage is the percent composition of that element.
It's worth noticing that percent composition is about mass, not about the number of atoms. Water, H2O, has twice as many hydrogen atoms as oxygen atoms, yet oxygen still makes up almost 89% of water's mass, because a single oxygen atom is so much heavier than a single hydrogen atom. Percent composition is what lets you see past the atom count and understand where the actual weight of a substance comes from.
The Percent Composition Formula
The formula behind this calculator is short: percent composition of an element = (mass of that element in the formula ÷ molar mass of the whole compound) × 100. The mass of the element in the formula is its atomic mass multiplied by how many atoms of it appear in one unit of the compound, and the molar mass of the whole compound is the sum of every element's contribution added together.
Take calcium carbonate, CaCO3, as a worked example. Calcium contributes about 40.08 g/mol, carbon contributes about 12.01 g/mol, and three oxygen atoms contribute about 48.00 g/mol, for a total molar mass of roughly 100.09 g/mol. Calcium's percent composition is 40.08 ÷ 100.09 × 100, which comes out to about 40.0%. This calculator runs that same division for every element automatically, so you never have to do the long division by hand.
How to Calculate Percent Composition, Step by Step
Start by writing out the chemical formula correctly, including every subscript. Then look up the atomic mass of each element from a periodic table and multiply it by how many times that element appears in the formula — that gives you each element's mass contribution. Add every one of those contributions together to get the compound's total molar mass.
Once you have the molar mass, divide each element's individual mass contribution by that total and multiply by 100. Repeat this for every element in the formula, and the percentages should add up to almost exactly 100%, with any tiny gap coming from rounding the atomic masses. This calculator handles every one of these steps for you the moment you type in a formula, and shows each one broken out separately below the result.
Why Percent Composition Matters
Percent composition connects a compound's formula, which is really just a ratio of atoms, to something you can measure with a scale. It's the reason a fertiliser bag can print numbers like 21-0-0 to tell farmers how much nitrogen it delivers, and it's the reason a food label can state how many grams of sodium are in a product made mostly of sodium chloride.
It's also the calculation that sits underneath figuring out whether a sample is pure. If you know what percent of a compound's mass should come from a given element, and a lab measurement of a real sample gives a noticeably different percentage, that's usually a sign of impurities, an error somewhere in the procedure, or a different compound than expected.
Percent Composition and Empirical Formulas
Percent composition data is also the usual starting point for finding a compound's empirical formula — the simplest whole-number ratio of atoms in a compound. If a lab report says a compound is 40.0% carbon, 6.7% hydrogen, and 53.3% oxygen by mass, chemists typically imagine a 100-gram sample, which turns each percentage directly into a mass in grams, then convert each of those masses to moles and find the smallest whole-number ratio between them.
That relationship runs in both directions. This calculator goes from a known formula to its percent composition, while the empirical formula calculator on this site runs the process in reverse, starting from percent composition or lab masses and working back to a formula. Between the two, you can move freely from formula to percentage and back again.
Turning Percentages into Real Grams for a Sample
Knowing a percentage is useful, but in a real lab you usually care about actual grams. This calculator includes an advanced option for exactly that: enter the size of a real sample, in milligrams, grams, or kilograms, and it multiplies each element's percentage by that sample size to show you precisely how many grams of each element are physically present.
This turns an abstract percentage into a number you could check against a balance reading. If you've weighed out 25 g of calcium carbonate for an experiment, this feature tells you straight away that roughly 10.0 g of that sample is calcium, without you needing to do the multiplication by hand every time you change the sample size.
Working Backward: How Much Compound Do You Need?
Sometimes the question runs the other way — you know how much of one specific element you need, and you want to know how much of the whole compound to weigh out to get it. This calculator's second advanced feature solves exactly that. Pick the element you're targeting, type in the mass you need of it, and the calculator divides that target mass by the element's percent composition to tell you the total sample size required.
This is genuinely useful outside the classroom too. If a recipe for a nutrient solution calls for a specific mass of nitrogen and you're supplying it from ammonium nitrate, or a materials process needs an exact mass of iron sourced from iron oxide, this reverse calculation tells you exactly how much of the starting compound to measure out.
Percent Composition of Common Compounds
A few compounds show up constantly in chemistry problems, so it helps to have a feel for their composition. Water, H2O, is about 11.19% hydrogen and 88.81% oxygen by mass — a good reminder that hydrogen barely registers on the mass scale even though it makes up two-thirds of the atoms. Table salt, NaCl, is about 39.34% sodium and 60.66% chlorine.
Glucose, C6H12O6, works out to about 40.00% carbon, 6.71% hydrogen, and 53.29% oxygen. Ammonium nitrate, NH4NO3, a common fertiliser, is about 35.00% nitrogen, which is exactly why it's valued as a nitrogen source for crops. You don't need to memorise any of these — typing any formula into this calculator recalculates the full breakdown in an instant.
Percent Composition with Hydrates
Some compounds are hydrates, meaning water molecules are built directly into their crystal structure, written with a dot in the formula, like CuSO4·5H2O for copper sulfate pentahydrate. This calculator reads that dot notation correctly and includes the water's hydrogen and oxygen in the overall percent composition, alongside copper and sulfur.
This matters because a hydrate and its anhydrous (water-free) form have noticeably different percent compositions, even though they contain the same core compound. Heating a hydrate to drive off its water of crystallisation is a classic lab experiment, and comparing the percent composition before and after is one way to confirm how many water molecules were actually present.
Common Mistakes to Avoid
The most frequent error is forgetting to multiply an atomic mass by its subscript before adding it into the total — treating H2O as if it only had one hydrogen atom instead of two, for instance. Another common slip is looking up the wrong atomic mass entirely, especially confusing similarly named elements. This calculator removes both risks, since it parses the formula and applies standard atomic weights automatically.
A subtler mistake is rounding too early. If you round each element's mass contribution before doing the division, small errors can stack up and the final percentages might not quite add to 100%. This calculator keeps full precision internally and only rounds for display, so the numbers you see stay as accurate as the underlying atomic mass data allows.
Percent Composition vs. Mole Fraction
It's easy to mix up percent composition with mole fraction, but they answer two different questions. Percent composition tells you what share of the total mass comes from an element. Mole fraction tells you what share of the total number of particles (moles) is made up of that element, ignoring how heavy each particle is.
For a single compound like CaCO3, the mole ratio of calcium to carbon to oxygen is a clean 1:1:3, but the mass percentages are far from that ratio, because each element has such a different atomic mass. Keeping this distinction clear is one of the more common points of confusion in an introductory chemistry course, and it's part of why this calculator shows both the atom count and the percent by mass side by side.
Real-World Uses of Percent Composition
Beyond the classroom, percent composition underpins a surprising number of everyday products and industries. Fertiliser labels report the nitrogen, phosphorus, and potassium content as percentages, letting a farmer compare products and calculate exactly how much of each nutrient a field is actually receiving. Food and supplement labels rely on the same idea to state how much sodium, calcium, or iron a serving provides, often calculated from the compound actually used in the formulation.
In mining and materials science, the percent composition of a metal within its ore tells a company whether extraction is economically worthwhile. In pharmaceuticals, knowing the percent composition of an active ingredient within a larger formulated compound is part of confirming a correct, consistent dose from batch to batch.
Worked Examples of Percent Composition
Consider sulfuric acid, H2SO4. Hydrogen contributes about 2.02 g/mol, sulfur about 32.07 g/mol, and four oxygen atoms about 64.00 g/mol, for a total molar mass close to 98.09 g/mol. That makes hydrogen about 2.06%, sulfur about 32.69%, and oxygen about 65.25% of the total mass — even though oxygen has four atoms against sulfur's one, it dominates the percentage because there are simply four of them stacked up.
Or take iron(III) oxide, Fe2O3, the main compound in rust. Two iron atoms contribute about 111.69 g/mol, and three oxygen atoms contribute about 48.00 g/mol, giving a molar mass near 159.69 g/mol. Iron works out to roughly 69.94% of the mass, and oxygen to about 30.06%. That's part of why rust looks and feels so much like solid iron: even though oxygen has joined it, iron still carries the large majority of the weight.
Using This Calculator Effectively
Type any valid chemical formula into the input field, including compounds with brackets like Ca(OH)2 or hydrate notation like CuSO4·5H2O, and the percent composition for every element appears immediately, sorted from the largest contributor to the smallest. Use the sample-size feature if you want to see the same result expressed as actual grams for a specific weighed amount, and use the reverse solver if you're working backward from a target element mass to a required sample size.
Scroll down for the complete step-by-step solution, which shows every atomic mass lookup, every multiplication, the molar mass total, and every final percentage calculation laid out individually, so you can either check your own homework or simply understand how each number was produced.
Percent Composition by Mass Calculator FAQ and Quick Reference
To find the percent composition of an element in a compound, divide the total mass that element contributes to the formula by the compound's molar mass, then multiply by 100. Add every subscript's atomic mass contribution together first to get the compound's molar mass before doing this division.
This free online percent composition calculator is meant to help with chemistry homework, lab planning, and general curiosity about what compounds are made of. For regulated, clinical, or safety-critical work, always confirm a substance's identity, purity, and exact composition against a certified reference before relying on any calculation for a real procedure.
Frequently Asked Questions
What is the formula for percent composition?
Percent composition = (mass of the element in the formula ÷ molar mass of the whole compound) × 100.
What is the percent composition of water?
Water (H2O) is about 11.19% hydrogen and 88.81% oxygen by mass.
Why is percent composition based on mass and not atom count?
Because different elements have very different atomic masses, so an element with fewer atoms can still make up most of a compound's weight, and vice versa.
Do percent compositions always add up to 100%?
Yes, in theory they always sum to 100%. In practice you may see a value like 99.9% or 100.1% due to rounding of atomic masses.
Can this calculator handle hydrates like CuSO4·5H2O?
Yes — type the formula with a dot, middot, or asterisk before the water molecules, and the water's hydrogen and oxygen are included in the total percent composition automatically.
How do I find how much of an element is in a real sample?
Use the advanced sample-size option: enter your sample's mass and this calculator multiplies each element's percentage by that mass to show the actual grams present.