Chemistry calculator

Percent Composition Calculator

Calculate percent composition by mass from a chemical formula. The tool shows formula mass, element mass contributions, element percentages, and optional sample-mass results.

Chemistry composition tool

Calculate percent composition by mass

Enter a chemical formula to calculate molar mass, element mass contributions, and the percent by mass of each element.

% element = element mass ÷ formula mass × 100

Supports element symbols, subscripts written as numbers, parentheses, brackets, and hydrate dots.

Add a sample mass to estimate grams of each element in that sample. Leave blank for percentages only.

Elements found3
Total atoms24
Largest shareO 53.28%
ElementAtomsMass contributionPercent by massMass in sample
O695.994 g/mol53.284%5.3284 g
C672.066 g/mol40.002%4.0002 g
H1212.096 g/mol6.714%0.6714 g

The displayed percentages add to 100.000% before rounding. Use the optional sample mass when you need grams of each element in a known mass of compound.

Percent Composition Calculator dashboard showing formula mass and element percentage by mass

Percent Composition Calculator for chemical formulas

This Percent Composition Calculator finds how much of a compound's formula mass comes from each element. It is useful when a student needs percent carbon in glucose, percent oxygen in calcium carbonate, or percent water-related mass in a hydrate. The result is a mass percentage, not a count percentage. A formula with many hydrogen atoms can still have a small hydrogen percentage because hydrogen has a low atomic mass.

The calculator accepts formulas such as H2O, CO2, C6H12O6, CaCO3, Al2(SO4)3, and CuSO4·5H2O. It calculates each element's total mass contribution from atomic mass and atom count. It then divides that contribution by the total formula mass. OpenStax explains percent composition as a way to compute the mass percentage of each element in a compound, which is the same method used here for formula-based calculations.

Use this tool when you already know the compound formula. Use the Empirical Formula Calculator when you start from experimental percentages and need the simplest whole-number formula. Use the Molecular Formula Mass Calculator when your main goal is formula mass rather than percentage breakdown.

This page is designed for chemistry students, teachers, lab workers, and researchers who need a fast formula check. It is also useful for homework problems that ask for percent composition from a molecular formula. The calculation is educational and should be checked independently for critical lab documentation or graded work.

How to use Percent Composition Calculator correctly

Enter the chemical formula using normal element symbols. Use uppercase and lowercase letters correctly because Co means cobalt while CO means carbon and oxygen. Write subscripts as plain numbers after the element symbol, such as H2O instead of H₂O. Use parentheses for grouped ions or repeated groups, such as Ca(OH)2 and Al2(SO4)3.

Hydrates can be entered with a dot, such as CuSO4·5H2O. The hydrate number multiplies the water formula segment. The calculator removes spaces, but it does not interpret compound names. It also does not use ionic charge in the mass calculation, so charges should be left out.

The optional sample mass field converts the percentage into grams of each element in a chosen mass of compound. For example, if oxygen is 53.29% of a sample and the sample mass is 10.0 g, oxygen contributes 5.329 g. This option helps students connect formula composition with real sample masses.

Percent Composition Calculator formula and assumptions

The method uses the standard mass percent equation for each element in a compound. First, the calculator multiplies each element's atom count by its average atomic mass. Next, it adds all element contributions to get the formula mass. Finally, it divides each element contribution by the total formula mass and multiplies by 100.

Percent by mass = element mass contribution ÷ formula mass × 100

The formula assumes the written chemical formula is correct. It uses average atomic masses, so results are appropriate for normal classroom and general laboratory calculations. Isotopically enriched compounds may need isotope-specific masses. Rounded atomic masses can also shift the last decimal place, so small differences between textbooks and calculators are expected.

Percent composition is different from atomic fraction. Methane, CH4, has four hydrogen atoms and one carbon atom, but carbon still contributes most of the mass. Mass percent follows grams per mole, not the visual number of atoms in the formula.

Percent Composition Calculator worked example

Calculate the percent composition of glucose, C6H12O6. Given values are carbon = 6 atoms, hydrogen = 12 atoms, oxygen = 6 atoms, atomic mass of C = 12.011 g/mol, H = 1.008 g/mol, and O = 15.999 g/mol. The formula mass is 6 × 12.011 + 12 × 1.008 + 6 × 15.999 = 180.156 g/mol.

Carbon mass contribution = 72.066 g/mol. Hydrogen mass contribution = 12.096 g/mol. Oxygen mass contribution = 95.994 g/mol. Carbon percent = 72.066 ÷ 180.156 × 100 = 40.00%. Hydrogen percent = 12.096 ÷ 180.156 × 100 = 6.71%. Oxygen percent = 95.994 ÷ 180.156 × 100 = 53.29%.

The result means a 10.0 g glucose sample contains about 4.00 g carbon, 0.671 g hydrogen, and 5.329 g oxygen. The oxygen percentage is largest because oxygen contributes a large mass share. The atom counts alone do not tell the mass percentage.

Percent Composition Calculator results explained

A high percent value means that element contributes a large part of the compound's formula mass. A low percent value means the element contributes little mass, even if its atom count is large. Hydrogen often has a low mass percent because each hydrogen atom has a small atomic mass.

Percentages should add to about 100%. The displayed sum may be 99.999% or 100.001% because each element is rounded separately. This is normal and does not mean the formula is wrong. For lab reports, use a consistent number of significant figures based on the atomic masses and problem data.

The optional sample mass result is a direct scaling of the percentage. It does not mean the compound has been chemically separated into pure elements. It simply states how much of the sample mass is represented by each element in the formula.

Percent Composition Calculator mistakes to avoid

Do not confuse element symbols with words. Na is sodium, N is nitrogen, and NA is not a valid element symbol. Do not write charges such as SO4-2 or NH4+ because charges do not belong in a formula mass calculation. Use parentheses when a group repeats, such as Mg(OH)2 instead of MgOH2.

Do not treat percent composition as a mole ratio. Percent composition tells mass share. Empirical formula work converts percentages to grams, then to moles, then to whole-number ratios. A compound can have a high oxygen percent without having the largest oxygen atom count.

Check hydrate notation carefully. CuSO4·5H2O includes five water molecules for each formula unit. Leaving out the hydrate water changes the molar mass and all element percentages. Small notation errors can create large result changes.

Percent Composition Calculator use cases in chemistry

Students can use the calculator to check homework on molecular formulas, empirical formulas, and mass percent. It helps show why percent composition depends on atomic mass as well as atom count. Teachers can use the worked example style to demonstrate each step before asking learners to solve a similar formula by hand.

Lab workers can use the sample mass option to estimate element mass contribution in a weighed compound. Researchers can use it for quick formula sanity checks when comparing theoretical composition with elemental analysis data. The tool is not a substitute for analytical chemistry data, but it helps catch obvious formula-entry mistakes before deeper interpretation.

Related chemistry tools

Student questions about percent composition

How do I calculate percent composition from a formula?

Find the mass contribution of each element, divide each contribution by the formula mass, and multiply by 100. The calculator performs those steps automatically after parsing the formula.

Can percent composition add to slightly more or less than 100 percent?

Yes. Rounded percentages can add to slightly more or less than 100 percent because each element is rounded separately. Use more decimal places when you need a closer displayed sum.

Does the calculator support hydrates?

Yes. Enter hydrates with a hydrate dot, such as CuSO4·5H2O. The tool treats the water segment as part of the formula mass and includes hydrogen and oxygen from the hydrate water.

External source: OpenStax Chemistry 2e section on empirical and molecular formulas.