Percent Composition Calculator
Find the mass percent of every element in a chemical compound. Type a formula such as H2O, Ca(OH)2 or CuSO4·5H2O to see each element's share of the molar mass.
Enter a formula to see the mass percent of each element.
How to Use
- Type the chemical formula: Start each element symbol with a capital letter and use numbers for subscripts, for example C6H12O6. Brackets and hydrate dots are accepted, or tap one of the example buttons.
- Choose the decimal places: Two decimals is the usual choice for lab reports; pick 1 to 4 to match your data.
- Add a sample mass (optional): Enter a mass in grams to see how many grams of each element the sample contains.
- Read the results: The molar mass, the mass percent of every element with a bar, the atom counts and, for hydrates, the percentage of water appear instantly.
- Copy or reset: Use Share to copy the result as text, or Clear to start a new formula.
What You'll Discover
- Molar mass — the sum of the atomic masses of every atom in the formula, in g/mol.
- Mass percent of each element — that element's mass in one mole of the compound divided by the molar mass, times 100. Each row also shows the working, such as 2 × 1.008 = 2.016 g/mol for the hydrogen in water.
- Grams in your sample — if you enter a sample mass, the grams of each element in that sample appear beside its percentage.
- Water of hydration — for a hydrate such as CuSO₄·5H₂O, the percentage of the total mass that is water.
- Atom and element counts — the total number of atoms in one formula unit and how many different elements it contains.
Percentages are rounded to the decimal places you choose. Because every row is rounded separately, the displayed values can add up to 99.99% or 100.01%; the calculator tells you when that happens. The unrounded values always add up to 100%.
Formula formats the calculator accepts
| You type | What it means | Result |
|---|---|---|
| C6H12O6 | Plain formula with subscripts | Works |
| Ca(OH)2 | The group in brackets is multiplied by the number after it | Works |
| Al2(SO4)3 | Bracketed group with a larger multiplier | Works |
| K4[Fe(CN)6] | Square brackets, nested inside each other | Works |
| CuSO4·5H2O, CuSO4.5H2O or CuSO4*5H2O | Hydrate: the number before H2O multiplies the whole water group | Works |
| H₂O | Unicode subscript digits are converted to normal digits | Works |
| nacl or co | Element symbols must start with a capital letter | Error message |
| SO4^2-, D2O, Fe0.95O | Ion charges, isotope symbols and fractional subscripts | Not supported |
How to Calculate Percent Composition by Mass
The percent composition of an element in a compound is the share of the compound's mass that comes from that element:
% element = (n × atomic mass of element) / molar mass of compound × 100
Here n is the number of atoms of that element in one formula unit. Follow the same five steps for any compound: count the atoms of each element, look up each atomic mass, multiply each atomic mass by its atom count, add those products to get the molar mass, and divide each product by the molar mass. Glucose, C₆H₁₂O₆, shows the pattern:
| Element | Atoms | Atomic mass (g/mol) | Mass in 1 mol (g) | Mass % |
|---|---|---|---|---|
| Carbon (C) | 6 | 12.011 | 72.066 | 40.00% |
| Hydrogen (H) | 12 | 1.008 | 12.096 | 6.71% |
| Oxygen (O) | 6 | 15.999 | 95.994 | 53.28% |
| Total | 24 | 180.156 | 100% (99.99% after rounding) |
The calculator uses the conventional standard atomic weights published by IUPAC's Commission on Isotopic Abundances and Atomic Weights (the 2024 table), rounded to three decimals. For elements whose natural isotope mix varies, such as hydrogen, carbon, oxygen, sulfur and chlorine, IUPAC lists an interval and a single conventional value; the conventional value is used here (S 32.06, Cl 35.45). If your textbook uses older or whole-number masses, your answers can differ from ours in the second decimal place.
Percent composition depends only on the ratio of atoms, so it is the same for every sample size. A gram and a tonne of glucose are both 40.00% carbon. To turn a percentage into a mass, multiply it by the mass of your sample, or enter the sample mass above. If you only need the total, the molar mass calculator gives the g/mol figure on its own.
Percent Composition of Common Compounds
These values were computed with the same atomic masses the calculator uses, rounded to two decimals. Type any formula into the calculator to confirm them.
| Compound | Formula | Molar mass (g/mol) | Mass percent by element |
|---|---|---|---|
| Water | H₂O | 18.015 | H 11.19%, O 88.81% |
| Carbon dioxide | CO₂ | 44.009 | C 27.29%, O 72.71% |
| Sodium chloride | NaCl | 58.44 | Na 39.34%, Cl 60.66% |
| Sodium hydroxide | NaOH | 39.997 | Na 57.48%, O 40.00%, H 2.52% |
| Calcium carbonate | CaCO₃ | 100.086 | Ca 40.04%, C 12.00%, O 47.96% |
| Sulfuric acid | H₂SO₄ | 98.072 | H 2.06%, S 32.69%, O 65.25% |
| Ammonium nitrate | NH₄NO₃ | 80.043 | N 35.00%, H 5.04%, O 59.96% |
| Iron(III) oxide | Fe₂O₃ | 159.687 | Fe 69.94%, O 30.06% |
| Ethanol | C₂H₅OH | 46.069 | C 52.14%, H 13.13%, O 34.73% |
| Glucose | C₆H₁₂O₆ | 180.156 | C 40.00%, H 6.71%, O 53.28% |
| Sodium bicarbonate | NaHCO₃ | 84.006 | Na 27.37%, H 1.20%, C 14.30%, O 57.14% |
| Copper(II) sulfate pentahydrate | CuSO₄·5H₂O | 249.677 | Cu 25.45%, S 12.84%, O 57.67%, H 4.04% |
The table shows why atom counts mislead. In ethanol, six of the nine atoms are hydrogen, yet hydrogen is only 13.13% of the mass because each hydrogen atom weighs about one-sixteenth as much as an oxygen atom. Oxygen, with one atom in nine, contributes 34.73%. Heavy elements dominate by mass: iron is 69.94% of Fe₂O₃ even though it is two of five atoms.
Rows add to 100.00% except where rounding intervenes. Sodium bicarbonate adds to 100.01% at two decimals, and glucose to 99.99%. At three or four decimals the totals settle back to 100%, which is why the calculator lets you choose the precision.
Percent Composition vs Empirical Formula, Percent Yield and Percent Error
Percent composition sits at the centre of several related chemistry calculations, and it is easy to confuse them. This table separates what each one measures:
| Quantity | What it tells you | Formula | Example |
|---|---|---|---|
| Percent composition | Share of a compound's mass from each element | n × atomic mass / molar mass × 100 | Water is 11.19% hydrogen |
| Empirical formula | Simplest whole-number ratio of atoms | Mass % to moles, then divide by the smallest | 40.00 / 6.71 / 53.28 gives CH₂O |
| Molecular formula | Actual atoms in one molecule | Empirical formula × (molar mass / empirical mass) | CH₂O × 6 = C₆H₁₂O₆ |
| Percent yield | How much product you actually made | actual / theoretical × 100 | 4.2 g of 5.0 g is 84% |
| Percent error | How far a measurement is from the accepted value | |measured − accepted| / accepted × 100 | 25.0% Cu against 25.45% is 1.77% |
Going from a formula to percentages is the direction this calculator handles. Going the other way, from measured percentages back to a formula, is how unknown compounds are identified in the lab. Divide each percentage by the element's atomic mass to get moles per 100 g, then divide by the smallest answer. A mixed result such as 1.5 usually means you should double all the ratios.
Percent composition also shows up when you check a result. If an analysis reports 25.0% copper for a sample you believe is CuSO₄·5H₂O, the theoretical figure is 25.45%. Feed the two numbers into the percent error calculator to see how far off the measurement is. For simple ratios such as "what percent is 3.6 g of 9.0 g", the percentage calculator is quicker.
What Is the Percent Composition If...
What is the percent composition if the compound is water (H₂O)?
Water is 11.19% hydrogen and 88.81% oxygen by mass. The molar mass is 2 × 1.008 + 15.999 = 18.015 g/mol. Hydrogen contributes 2.016 g, and 2.016 ÷ 18.015 × 100 = 11.19%. Oxygen contributes 15.999 g, and 15.999 ÷ 18.015 × 100 = 88.81%. Two of every three atoms are hydrogen, but each is about one-sixteenth the mass of an oxygen atom.
What is the percent composition if the compound is glucose (C₆H₁₂O₆)?
Glucose is 40.00% carbon, 6.71% hydrogen and 53.28% oxygen by mass. The molar mass is 180.156 g/mol, with 72.066 g of carbon, 12.096 g of hydrogen and 95.994 g of oxygen in each mole. Rounded to two decimals the three values add to 99.99%, not 100%; that is rounding, not an error. At three decimals they are 40.002%, 6.714% and 53.284%.
What is the percent composition if the compound is table salt (NaCl)?
Sodium chloride is 39.34% sodium and 60.66% chlorine by mass. The molar mass is 22.990 + 35.45 = 58.44 g/mol. Sodium: 22.990 ÷ 58.44 × 100 = 39.34%. Chlorine: 35.45 ÷ 58.44 × 100 = 60.66%. Because there is one atom of each, the split follows the atomic masses directly.
What is the percent composition if the compound is carbon dioxide (CO₂)?
Carbon dioxide is 27.29% carbon and 72.71% oxygen by mass. The molar mass is 12.011 + 2 × 15.999 = 44.009 g/mol. Carbon: 12.011 ÷ 44.009 × 100 = 27.29%. Oxygen: 31.998 ÷ 44.009 × 100 = 72.71%. Only one atom in three is oxygen by count, but the two oxygen atoms outweigh the single carbon.
What is the percent composition if the formula has brackets, such as Ca(OH)₂?
Calcium hydroxide is 54.09% calcium, 43.19% oxygen and 2.72% hydrogen by mass. The subscript 2 after the bracket multiplies everything inside, so Ca(OH)₂ contains 1 Ca, 2 O and 2 H. The molar mass is 40.078 + 2 × 15.999 + 2 × 1.008 = 74.092 g/mol. Calcium: 40.078 ÷ 74.092 × 100 = 54.09%. Oxygen: 31.998 ÷ 74.092 = 43.19%. Hydrogen: 2.016 ÷ 74.092 = 2.72%.
What is the percent composition if the compound is sulfuric acid (H₂SO₄)?
Sulfuric acid is 2.06% hydrogen, 32.69% sulfur and 65.25% oxygen by mass. The molar mass is 2 × 1.008 + 32.06 + 4 × 15.999 = 98.072 g/mol. Hydrogen: 2.016 ÷ 98.072 × 100 = 2.06%. Sulfur: 32.06 ÷ 98.072 = 32.69%. Oxygen: 63.996 ÷ 98.072 = 65.25%. A textbook that uses the older S = 32.065 gets a molar mass of 98.077 g/mol, but the percentages still round to the same 2.06%, 32.69% and 65.25%.
What is the percent composition if the compound is calcium carbonate (CaCO₃), and how much calcium is in 50 g of it?
Calcium carbonate is 40.04% calcium, 12.00% carbon and 47.96% oxygen, so 50.0 g of it contains about 20.02 g of calcium. The molar mass is 40.078 + 12.011 + 3 × 15.999 = 100.086 g/mol. Multiplying the unrounded calcium fraction by the sample gives 50.0 × 0.400436 = 20.02 g. The same sample holds 6.00 g of carbon and 23.98 g of oxygen. Enter 50 in the sample mass box to see all three.
What is the percent composition if the compound is a hydrate, CuSO₄·5H₂O?
Copper(II) sulfate pentahydrate is 25.45% copper, 12.84% sulfur, 57.67% oxygen and 4.04% hydrogen, and 36.08% of its mass is water. The anhydrous CuSO₄ part has a molar mass of 159.602 g/mol and the five waters add 5 × 18.015 = 90.075 g/mol, for a total of 249.677 g/mol. The oxygen figure counts both the sulfate oxygen and the water oxygen. The calculator shows the water share on its own row.
What is the percent composition if the compound is ammonium nitrate (NH₄NO₃)?
Ammonium nitrate is 35.00% nitrogen, 5.04% hydrogen and 59.96% oxygen by mass. The formula has two nitrogen atoms (one in NH₄ and one in NO₃), so nitrogen contributes 2 × 14.007 = 28.014 g of the 80.043 g/mol molar mass. That is 34.9987%, which rounds to 35.00%. A kilogram of the pure compound therefore contains about 350 g of nitrogen.
What is the percent composition if I only know the mass of each element?
Divide each element's mass by the total mass of the sample and multiply by 100. A 25.00 g sample with 10.00 g carbon, 1.68 g hydrogen and 13.32 g oxygen gives 10.00 ÷ 25.00 = 40.00% C, 1.68 ÷ 25.00 = 6.72% H and 13.32 ÷ 25.00 = 53.28% O, which add to exactly 100%. Those are experimental percentages; compare them with the calculator's value for the formula you expect.
People Also Search For
How to calculate percent composition step by step
Find the molar mass, then divide the mass of each element in one mole by that molar mass and multiply by 100. For aluminium sulfate, Al₂(SO₄)₃, count 2 Al, 3 S and 12 O. The masses are 2 × 26.982 = 53.964 g, 3 × 32.06 = 96.18 g and 12 × 15.999 = 191.988 g, which add to a molar mass of 342.132 g/mol. The percentages are 15.77% Al, 28.11% S and 56.12% O. Keep every digit until the last step and round only the final answers.
How much of an element is in a sample of a compound
Multiply the sample mass by the element's mass percent divided by 100. A 25.0 g sample of glucose contains 25.0 × 0.4000 = 10.0 g of carbon, 1.68 g of hydrogen and 13.32 g of oxygen. This is the reverse of the "only know the masses" calculation above, and the sample mass field in the calculator does it for every element at once.
How to find the empirical formula from percent composition
Treat the percentages as grams in a 100 g sample, convert each to moles, and divide by the smallest number of moles. For 40.00% C, 6.71% H and 53.28% O: carbon is 40.00 ÷ 12.011 = 3.330 mol, hydrogen is 6.71 ÷ 1.008 = 6.657 mol and oxygen is 53.28 ÷ 15.999 = 3.330 mol. Dividing by 3.330 gives 1 : 2 : 1, so the empirical formula is CH₂O. A molar mass of 180.156 g/mol against an empirical mass of 30.026 g/mol is a factor of 6, giving C₆H₁₂O₆.
Mass percent vs atom percent
Mass percent weighs each atom by its atomic mass; atom percent just counts atoms. In water, hydrogen is 2 of 3 atoms, or 66.67% by atom count, but only 11.19% by mass. Percent composition in chemistry normally means mass percent. Atom percent appears in materials science, so check which one a question wants.
How to find the percent of water in a hydrate
Divide the mass of the water of hydration in one mole by the molar mass of the whole hydrate and multiply by 100. For CuSO₄·5H₂O that is 90.075 ÷ 249.677 × 100 = 36.08%. For Epsom salt, MgSO₄·7H₂O, it is 126.105 ÷ 246.466 × 100 = 51.17%. Type the hydrate into the calculator and read the water row. Experimentally the figure comes from weighing a sample before and after the water is removed, following your lab's instructions.
Percent composition vs mass percent of a solution
Percent composition describes the elements inside a pure compound; the mass percent of a solution describes how much solute is dissolved in it. Dissolving 5.0 g of NaCl in 95.0 g of water gives a solution that is 5.0 ÷ 100.0 × 100 = 5.0% NaCl by mass. The NaCl itself is still 39.34% sodium and 60.66% chlorine, whatever solution it is in.
Frequently Asked Questions
What is percent composition?
Percent composition is the percentage of a compound's total mass that comes from each element in it. It is calculated as (atoms of the element × its atomic mass) ÷ molar mass of the compound × 100. The percentages of all the elements in a pure compound add up to 100%.
Which atomic masses does the calculator use?
It uses the conventional standard atomic weights from the IUPAC (CIAAW) 2024 table, rounded to three decimals, for example H 1.008, C 12.011, O 15.999, S 32.06 and Cl 35.45. Where IUPAC gives a range because an element's isotope mix varies, the conventional single value is used. Textbooks that use older or whole-number values can give results that differ slightly.
Why do my percentages add up to 99.99% or 100.01%?
Each percentage is rounded separately to the decimal places you choose, so the rounded values can total slightly above or below 100%. Glucose at two decimals gives 40.00 + 6.71 + 53.28 = 99.99. The unrounded values add up to exactly 100%, and choosing more decimal places brings the displayed total closer to 100.
Does it work with brackets and hydrates?
Yes. Round and square brackets, including nested ones, multiply everything inside by the number that follows, so Ca(OH)2 and K4[Fe(CN)6] both work. Hydrates can be written with a middle dot, a full stop or an asterisk: CuSO4·5H2O, CuSO4.5H2O and CuSO4*5H2O are all read as the same compound, with the number before H2O multiplying the water group.
Why does the calculator show an error for my formula?
The most common cause is capitalisation. Every element symbol starts with a capital letter, so Co is cobalt and CO is carbon monoxide, while nacl is rejected. Other causes are unbalanced or mismatched brackets, a number at the start of a group, a symbol that is not an element, or characters such as charges (^2-) that the calculator does not read. The message under the results names the problem.
Which elements are supported?
Every element from hydrogen to bismuth that has a standard atomic weight, plus thorium, protactinium and uranium. Technetium and promethium are left out because IUPAC lists no standard atomic weight for them (all their isotopes are radioactive). Elements heavier than uranium are not included.
Can it handle ions, charges or isotopes such as D2O?
No. The calculator reads neutral formulas made of standard element symbols and whole-number subscripts. Charges, isotope symbols (D, T) and fractional subscripts such as Fe0.95O are not supported. For an ionic compound, type the full formula, for example Al2(SO4)3, rather than the separate ions.
How many decimal places should I report?
Match the precision of your data and your course instructions. Two decimals (for example 11.19%) is the most common choice for textbook problems. If your measurements only have three significant figures, quoting more digits suggests accuracy you do not have. Use the decimal places selector to switch between 1 and 4.
What does the sample mass box do?
It multiplies each element's percentage by the mass you enter and shows the grams of that element next to the percentage. It is optional and only changes the grams display; the percentages and molar mass stay the same. Enter the mass in grams and the element masses are shown in grams too.
Can percent composition identify an unknown compound?
It narrows the possibilities but does not settle them on its own. Percent composition fixes the empirical formula, not the molecular formula, so CH2O, C2H4O2 and C6H12O6 all give the same percentages. You also need the molar mass to find the molecular formula, and some different compounds share a formula but have different structures.
How is this different from the molar mass calculator?
Both read a chemical formula, but they answer different questions. The molar mass calculator gives the mass of one mole of the compound in g/mol. This calculator also splits that mass into the share contributed by each element, which is what you need for lab reports, empirical formulas and purity checks.
Does it work for mixtures, alloys or solutions?
No, it works on a single chemical formula. For a mixture or an alloy, divide the mass of each component by the total mass and multiply by 100, which the percentage calculator can do. For a solution, the mass percent of the solute is its mass divided by the total mass of the solution.
How do I compare my experimental percentages with the calculated ones?
Enter the formula you expect and note the calculated percentage for each element. Then treat your measured percentage as the experimental value and the calculated one as the theoretical value in the percent error calculator. A small difference is normal; a large one can mean an impure sample, a measurement slip or a different compound than you thought.
Is my data stored or sent anywhere?
No. All calculations run in your browser. Nothing you type is sent to a server or saved, and no account is needed.
Last reviewed: November 2026 — formulas and worked examples verified.