Percent Composition Calculator in Chemistry

Enter any chemical formula to get percent composition by mass with full steps hydrates support and molar mass details validated instantly. Adjust atomic weights choose rounding download results and print. Designed for students teachers and lab workflows needing precise transparent calculations. Includes parentheses parsing hydrate dots coefficients empirical analysis elemental breakdown audit trail features

Calculator
Supports parentheses, hydrate dots (·), coefficients, and nested groups.
Use this to apply specific isotopic masses or updated standard values.
How it works
  1. Parse the formula into element counts, respecting parentheses and hydrate separators.
  2. Multiply element counts by atomic weights to get mass contributions.
  3. Sum contributions for the molar mass, then compute each element’s mass percentage.
Example inputs: C6H12O6, Ca3(PO4)2, Al2(SO4)3·18H2O, 5H2O.

What is percent composition?

Percent composition (also called mass percent) tells you what fraction of a compound’s total mass comes from each element. For a compound with elements A, B, C, ... the percent composition lists %A, %B, %C, and so on, adding up to 100% (within rounding).

Why it matters. Percent composition helps check formulas, compare compounds, determine empirical formulas from experimental analysis, quantify water of crystallization in hydrates, and assess sample purity.

The formula & where it comes from

For any element E in a compound:

%E = (mass of E in one mole of the compound ÷ molar mass of the compound) × 100

Equivalently, if a compound has subscripts that indicate how many atoms of each element are present, multiply each element’s atomic mass by its subscript to get its contribution and divide by the total molar mass.

Example structure

For CaHbOc:

  • Molar mass = a·M(C) + b·M(H) + c·M(O)
  • %C = a·M(C) / M(total) × 100
  • %H = b·M(H) / M(total) × 100
  • %O = c·M(O) / M(total) × 100

Hydrates (•nH2O)

For hydrates such as CuSO4•5H2O, include the water mass in the total molar mass. The percent of “water of crystallization” is

%H2O = [n · M(H2O) / M(hydrate)] × 100

Note: Use current standard atomic weights (to the number of decimals required by your class or lab). Slight differences (e.g., O = 15.999 vs 16.00) lead to small changes in the final percentages.

How to calculate by hand (step‑by‑step)

  1. Write the formula and identify the number of each type of atom.
  2. Look up atomic masses (e.g., H = 1.008, C = 12.011, O = 15.999, Cu = 63.546; values vary slightly by source).
  3. Compute the molar mass by summing each element’s contribution.
  4. Divide each element’s contribution by the total molar mass.
  5. Multiply by 100 to convert to percent; round to an appropriate number of significant figures.

Worked examples

1) Water, H2O

Molar mass = 2(1.008) + 15.999 = 18.015 g·mol−1

ElementMass (g·mol−1)Percent
H2 × 1.008 = 2.0162.016 ÷ 18.015 × 100 = 11.19%
O15.99915.999 ÷ 18.015 × 100 = 88.81%

2) Glucose, C6H12O6

Molar mass = 6(12.011) + 12(1.008) + 6(15.999) = 180.156 g·mol−1

ElementMass (g·mol−1)Percent
C6 × 12.011 = 72.06672.066 ÷ 180.156 × 100 = 40.00%
H12 × 1.008 = 12.09612.096 ÷ 180.156 × 100 = 6.71%
O6 × 15.999 = 95.99495.994 ÷ 180.156 × 100 = 53.28%

3) Copper(II) sulfate pentahydrate, CuSO4•5H2O

Molar mass (hydrate) = (63.546 + 32.065 + 4×15.999) + 5×(2×1.008 + 15.999) = 249.682 g·mol−1

ComponentMass (g·mol−1)Percent
Water of crystallization (5H2O)5 × 18.015 = 90.07590.075 ÷ 249.682 × 100 = 36.08%
Cu63.54663.546 ÷ 249.682 × 100 = 25.45%
S32.06532.065 ÷ 249.682 × 100 = 12.84%
H (from waters)5 × 2 × 1.008 = 10.0810.08 ÷ 249.682 × 100 = 4.04%
O (total)4×15.999 + 5×15.999 = 144.0144.0 ÷ 249.682 × 100 = 57.67%

Notice that “percent water” is commonly reported for hydrates. Element‑by‑element values also work if you need the full breakdown.

Using a Percent Composition Calculator

  1. Enter the chemical formula (e.g., Fe2O3, (NH4)2SO4, or with hydrates CuSO4·5H2O using a middle dot or a period).
  2. Choose the atomic mass set (e.g., to 3–4 decimal places as required).
  3. Select desired precision (number of decimal places in the result).
  4. Run the calculation to get the percent by mass for each element and (optionally) a check that the total is ~100%.

Tip: Calculators differ in how they parse hydrates ( vs .) and nested parentheses. If you see an error, try an alternate delimiter or explicit multiplication (e.g., 5H2O).

Behind the scenes (algorithm outline)

  1. Tokenize the formula (elements, numbers, parentheses, hydrate dot).
  2. Use a stack to handle parentheses and multipliers.
  3. Aggregate counts for each element.
  4. Multiply counts by atomic masses and divide by the total molar mass to get percentages.

From percent composition to empirical formula

Given the mass percent of each element, you can back‑calculate the empirical formula (the simplest whole‑number ratio of atoms):

  1. Assume a 100 g sample → numbers become grams (e.g., 40.00% C → 40.00 g C).
  2. Convert grams to moles for each element by dividing by atomic mass.
  3. Divide each mole amount by the smallest mole value to get a ratio.
  4. If necessary, multiply to clear small fractional values (e.g., 1.5 → ×2).

Example: 52.14% C, 13.13% H, 34.73% O → moles ≈ C 4.341, H 13.026, O 2.171 → ratios ≈ 2.00 : 6.00 : 1.00 → C2H6O.

Applications in chemistry

Common pitfalls and rounding

Practice problems

  1. Calcium carbonate, CaCO3: Calculate %Ca, %C, %O. Answer: ~40.04% Ca, 12.00% C, 47.96% O.
  2. Magnesium sulfate heptahydrate, MgSO4•7H2O: What percent is water of crystallization? Answer: ~51.16%.
  3. Empirical formula: A compound is 40.00% C, 6.71% H, and 53.29% O by mass. Determine the empirical formula. Answer: CH2O.

Results may vary slightly with the atomic masses you use and your rounding policy.

Frequently asked questions

What’s the difference between percent composition and percent yield?

Percent composition describes how a compound’s mass is distributed among its elements. Percent yield compares actual vs theoretical product amount in a reaction.

Do percent compositions always add to exactly 100%?

They should theoretically. In practice, rounding at 2–3 decimals can give totals like 99.99% or 100.01%—that’s normal.

Which atomic masses should I use?

Use the values specified by your instructor or lab (often IUPAC standard atomic weights). Be consistent within a problem set.

Can I compute percent composition for ions or salts?

Yes. Treat ions the same way: multiply each element’s atomic mass by its subscript, sum, and divide by the total molar mass of the formula unit.

How do hydrates affect the calculation?

Include all waters (n×18.015) in the total molar mass. You may report “% water of crystallization” as a single value in addition to element‑by‑element percentages.

Can I get empirical formula directly from percent composition?

Yes—assume 100 g, convert to moles, divide by the smallest, and scale to whole numbers. See the guide above.

Related Calculators


Mole-Mass Converter Calculator
Percent Composition Calculator
Molality from Mass Calculator
Equilibrium Constant Calculator
Graham's Law Diffusion Calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.