Percent Composition Calculator
How it Works
01Pick Up to 5 Elements
Choose elements from the 39-element library; defaults are H, C, O, N, S — change as needed
02Enter Atom Counts
Each element's count from your molecular formula (e.g., glucose C₆H₁₂O₆: C=6, H=12, O=6)
03Compute Total Molar Mass
Σ(n_i × M_i) — sum each element's contribution to total mass using IUPAC 2021 atomic weights
04Get % per Element
%X = (n_X × M_X) / total × 100 — visual bars + reference table comparison for 12 known compounds
What is a Percent Composition Calculator?
Just enter atom counts for each element slot (defaults are H, C, O, N, S — the five most common in biological molecules), and select different elements via dropdown if needed. The calculator multiplies each element's count by its IUPAC 2021 standard atomic weight, sums to get total molar mass, then divides each element's mass contribution by the total and multiplies by 100. Output: the formula displayed in pretty subscript notation (e.g., C₆H₁₂O₆), the total molar mass in g/mol, individual element cards with mass percent (color-coded with gradient bars), automatic match against 12 reference compounds when your formula is recognized, and a complete step-by-step calculation breakdown.
Designed for general chemistry students learning stoichiometry, organic chemistry students computing percent composition for combustion-analysis verification, pharmaceutical scientists computing API content in formulations, food scientists quantifying nutrient ratios, materials scientists characterizing alloy and ceramic compositions, and forensic chemists matching unknowns against composition databases, the tool runs entirely in your browser — no data is stored or transmitted.
Pro Tip: Pair this with our Molar Mass Calculator for the related "given a formula, find molar mass" problem, or our Combustion Analysis Calculator to reverse-engineer the empirical formula from CO₂ and H₂O combustion masses.
How to Use the Percent Composition Calculator?
How is percent composition calculated?
Percent composition is conceptually simple but operationally critical — it underlies empirical-formula determination, drug content assays, and food-label nutrient calculations. Here's the complete framework:
The conservation-of-mass foundation (Lavoisier 1789) guarantees that the masses of all elements in a compound must sum to the compound's total mass. Percent composition just expresses this as a percentage rather than absolute mass.
The Master Formula
For each element X in a compound:
%X = (nX × MX) / Σ(ni × Mi) × 100
where nX is the number of X atoms in the formula, MX is the standard atomic weight of X, and the denominator is the total molar mass of the compound (sum over all elements i).
Sanity Check: Percentages Sum to 100%
By construction, all percentages must sum to 100% (within rounding):
Σ %X = 100.00%
If your computed sum is > 0.5% off from 100, you've made an arithmetic error. The calculator does this check for you and reports the sum.
Why Use Mass Percent (Not Mole Percent)?
Two common ways to express composition:
- Mass percent (this calculator): %X = (nX·MX)/(total mass) × 100. Used by chemists for stoichiometry, pharmacists for drug formulations, and food labels.
- Mole percent / atomic percent: %X = nX/Σni × 100. Used by materials scientists for alloys and metallurgists for steel composition.
For glucose C₆H₁₂O₆: mass percents are %C=40.0, %H=6.7, %O=53.3. Mole percents are %C=25, %H=50, %O=25 (very different!). The two only coincide for elements of the same atomic mass.
Standard Atomic Weights (IUPAC 2021)
The atomic weights used are natural-abundance averages from the IUPAC 2021 commission. Common values:
- H = 1.008, C = 12.011, N = 14.007, O = 15.999, F = 18.998
- Na = 22.990, Mg = 24.305, P = 30.974, S = 32.06, Cl = 35.45
- K = 39.098, Ca = 40.078, Fe = 55.845, Cu = 63.546, Br = 79.904
- Ag = 107.868, I = 126.904, Au = 196.967, Hg = 200.592, Pb = 207.2
For isotopically labeled compounds (²H, ¹³C, ¹⁵N, ¹⁸O), substitute the exact isotope mass. Old IUPAC tables (pre-2007) gave slightly different values — modern tables differ by < 0.5%.
Connection to Empirical Formula Determination
Percent composition is the inverse of empirical-formula determination. Given mass percentages from combustion analysis:
- Assume 100 g of compound — % becomes grams.
- Divide each element's grams by its atomic weight to get moles.
- Divide all mole values by the smallest to get the mole ratio.
- Multiply by 1, 2, 3, 4, etc. to get integer subscripts (the empirical formula).
For molecular formula, multiply empirical by molar mass / empirical mass. Glucose has empirical CH₂O (M = 30.0); molecular C₆H₁₂O₆ (M = 180.0); ratio 6.
Edge Cases
- Hydrates (CuSO₄·5H₂O): Treat as a single compound with all atoms — Cu=1, S=1, O=9 (from SO₄ + 5×H₂O), H=10 (from 5×H₂O). The hydrate-water mass IS part of the molecular weight.
- Polyatomic ions (NH₄⁺, SO₄²⁻): Charge isn't part of mass — just count the atoms.
- Polymers: Use the repeat unit's composition; molar mass varies with chain length.
- Mixtures (alloys): Composition determined experimentally, not from formula. Brass = 67% Cu + 33% Zn (mass %), but Cu and Zn aren't bonded — it's a metallic solution.
Percent Composition Calculator – Worked Examples
- H: 2 × 1.008 = 2.016 g/mol.
- O: 1 × 15.999 = 15.999 g/mol.
- Total: 2.016 + 15.999 = 18.015 g/mol (textbook value ✓).
- %H = 2.016 / 18.015 × 100 = 11.19%.
- %O = 15.999 / 18.015 × 100 = 88.81%.
- Sum: 11.19 + 88.81 = 100.00% ✓.
Example 2 — Glucose (C₆H₁₂O₆). The textbook combustion-analysis target.
- C: 6 × 12.011 = 72.066 g/mol.
- H: 12 × 1.008 = 12.096 g/mol.
- O: 6 × 15.999 = 95.994 g/mol.
- Total: 180.156 g/mol (textbook 180.16 ✓).
- %C = 72.066 / 180.156 × 100 = 40.00%.
- %H = 12.096 / 180.156 × 100 = 6.71%.
- %O = 95.994 / 180.156 × 100 = 53.29%.
- Sum: 40.00 + 6.71 + 53.29 = 100.00% ✓.
- Notice glucose's empirical formula is CH₂O (mole ratio 1:2:1) — the simplest carbohydrate. Percent composition is identical to formaldehyde (CH₂O) and acetic acid (C₂H₄O₂) — they all share the empirical CH₂O.
Example 3 — Caffeine (C₈H₁₀N₄O₂). A 5-element molecule from your morning coffee.
- C: 8 × 12.011 = 96.088.
- H: 10 × 1.008 = 10.080.
- N: 4 × 14.007 = 56.028.
- O: 2 × 15.999 = 31.998.
- Total: 194.194 g/mol.
- %C = 49.48%; %H = 5.19%; %N = 28.85%; %O = 16.48%. Sum = 100.00% ✓.
- The high %N (28.85%) is characteristic of alkaloids — they contain multiple nitrogens. Combustion analysis of an unknown alkaloid showing %C ≈ 49, %H ≈ 5, %N ≈ 29 immediately suggests caffeine or a close relative.
Example 4 — Iron(III) Oxide (Fe₂O₃, Common Rust).
- Fe: 2 × 55.845 = 111.69.
- O: 3 × 15.999 = 47.997.
- Total: 159.687 g/mol.
- %Fe = 111.69 / 159.687 × 100 = 69.94%.
- %O = 47.997 / 159.687 × 100 = 30.06%.
- Iron ore quality is reported as %Fe — high-grade hematite ore approaches the theoretical 69.94% for pure Fe₂O₃; ore that's 65% Fe is excellent industrial-grade.
Example 5 — Sodium Chloride (NaCl). The simplest 1:1 ionic compound.
- Na: 1 × 22.990 = 22.990.
- Cl: 1 × 35.45 = 35.45.
- Total: 58.44 g/mol.
- %Na = 22.990 / 58.44 × 100 = 39.34%.
- %Cl = 35.45 / 58.44 × 100 = 60.66%.
- The 39.34% sodium content is what nutrition labels reference: 1 g of table salt contains 0.39 g of sodium. The FDA daily recommended max is 2,300 mg sodium = ~5.85 g of NaCl (about 1 teaspoon).
Who Should Use the Percent Composition Calculator?
Technical Reference
Theoretical Foundation. Percent composition follows directly from Antoine Lavoisier's 1789 law of conservation of mass — the total mass of a compound equals the sum of its constituent atoms' masses. The systematic determination of percent composition by combustion analysis was pioneered by Antoine Lavoisier and refined by Justus von Liebig (1831) with his Kaliapparat for CO₂ collection. Today's instrumental CHN analyzers (Perkin-Elmer 2400, LECO TruSpec, Elementar vario) automate the same principle to ±0.3% absolute precision.
IUPAC 2021 Standard Atomic Weights (Selected):
- Period 1: H = 1.008, He = 4.003
- Period 2: Li = 6.94, Be = 9.012, B = 10.81, C = 12.011, N = 14.007, O = 15.999, F = 18.998, Ne = 20.180
- Period 3: Na = 22.990, Mg = 24.305, Al = 26.982, Si = 28.085, P = 30.974, S = 32.06, Cl = 35.45, Ar = 39.948
- Period 4 (selected): K = 39.098, Ca = 40.078, Fe = 55.845, Ni = 58.693, Cu = 63.546, Zn = 65.38, As = 74.922, Br = 79.904
- Heavier elements: Ag = 107.868, I = 126.904, Ba = 137.327, Au = 196.967, Hg = 200.592, Pb = 207.2, U = 238.029
Reference Compositions for Common Substances:
- Water (H₂O): M = 18.015 — %H = 11.19, %O = 88.81
- Methane (CH₄): M = 16.043 — %C = 74.87, %H = 25.13
- Ammonia (NH₃): M = 17.031 — %N = 82.24, %H = 17.76
- Carbon dioxide (CO₂): M = 44.009 — %C = 27.29, %O = 72.71
- Glucose (C₆H₁₂O₆): M = 180.156 — %C = 40.00, %H = 6.71, %O = 53.29
- Sucrose (C₁₂H₂₂O₁₁): M = 342.30 — %C = 42.11, %H = 6.48, %O = 51.42
- Caffeine (C₈H₁₀N₄O₂): M = 194.194 — %C = 49.48, %H = 5.19, %N = 28.85, %O = 16.48
- Aspirin (C₉H₈O₄): M = 180.158 — %C = 60.00, %H = 4.48, %O = 35.52
- Sodium chloride (NaCl): M = 58.44 — %Na = 39.34, %Cl = 60.66
- Hematite (Fe₂O₃): M = 159.687 — %Fe = 69.94, %O = 30.06
- Magnetite (Fe₃O₄): M = 231.533 — %Fe = 72.36, %O = 27.64
- Cuprite (Cu₂O): M = 143.09 — %Cu = 88.82, %O = 11.18
- Calcium carbonate (CaCO₃): M = 100.087 — %Ca = 40.04, %C = 12.00, %O = 47.96
Pharmaceutical Salt Form Implications. Many drugs are formulated as their HCl, sulfate, or other salt forms — the "active" portion is only part of the dosed mass. Examples: Hydroxychloroquine sulfate (C₁₈H₂₆ClN₃O · ½H₂SO₄, MW 433.95) — only 77.5% is HCQ free base. Lisinopril dihydrate (C₂₁H₃₁N₃O₅·2H₂O, MW 441.52) — only 91.8% is anhydrous lisinopril. Dosage labels report "X mg of free base equivalent" to handle this — but you need percent composition to convert salt mass to active mass.
Food and Nutrition Reference. Salt (NaCl): 1 g salt = 0.39 g sodium → 1 tsp salt (~6 g) = 2,300 mg Na (FDA daily max). Iron in spinach (Fe in Fe₂O₃ form ~70%): 100 g spinach has 2.7 mg total Fe; bioavailability much lower than supplement Fe(II) salts. Calcium in milk (Ca in calcium phosphate / casein complex): ~120 mg Ca per 100 g milk, requiring ~1 g Ca per day from diet.
Mining / Ore Grade Standards.
- Iron ore: Hematite (Fe₂O₃ pure) gives max 69.94% Fe; commercial high-grade ores 60-65% Fe; low-grade ores 30-50%.
- Copper ore: Native Cu = 100%; chalcopyrite (CuFeS₂) = 34.6% Cu; cuprite (Cu₂O) = 88.82%; commercial ore 0.5-2% Cu (mostly gangue).
- Bauxite (aluminum ore): Mostly Al(OH)₃ (gibbsite) = 34.6% Al; commercial bauxite 30-60% Al₂O₃ equivalent.
- Gold ore: Native Au or AuTe₂ (calaverite, 56.4% Au); commercial ore 0.3-3 g/tonne (0.00003%).
Common Pitfalls. (1) Forgetting subscripts: for Fe₂O₃, n_Fe = 2, n_O = 3, NOT 1 each. (2) Hydrates: CuSO₄·5H₂O has Cu=1, S=1, O=9 (4 from sulfate + 5 from water), H=10. (3) Polyatomic ions: NH₄Cl has N=1, H=4, Cl=1 — count atoms, not the ion. (4) Charged species: charge doesn't add mass; SO₄²⁻ has the same molar mass as neutral SO₄. (5) Mixtures vs compounds: bronze (alloy) and brass (alloy) have variable composition — percent composition there means mass fraction, not stoichiometric.
Key Takeaways
Frequently Asked Questions
What is the Percent Composition Calculator?
Designed for general chemistry students learning stoichiometry, organic chemistry students cross-checking combustion-analysis results, pharmaceutical scientists computing API content in salt forms, food scientists for label compliance, materials scientists for alloys/ceramics, and mining engineers for ore-grade calculations. Runs entirely in your browser — no data stored.
Pro Tip: Use our Combustion Analysis Calculator to reverse-engineer the empirical formula from CO₂/H₂O combustion data.
What's the formula for percent composition?
Why must the percentages sum to 100%?
What's the difference between mass percent and mole percent?
How do I handle hydrates like CuSO₄·5H₂O?
Can I use this for organic functional-group analysis?
Why are heavier elements always a larger percent than lighter ones?
What atomic weights does the calculator use?
How does this relate to empirical formula determination?
Why doesn't pharmaceutical labeling always match my calculated %?
Can the calculator handle ions and charged species?
Disclaimer
Atomic weights are IUPAC 2021 standard values for natural-abundance elements. For isotopically labeled compounds (²H, ¹³C, ¹⁵N, ¹⁸O), use exact monoisotopic masses instead. Hydrate compounds (CuSO₄·5H₂O) require entering all atoms (Cu=1, S=1, O=9, H=10) — the calculator can't parse the dot-prefix notation directly. Percentages must sum to exactly 100% within rounding by conservation of mass; if not, an input error has occurred. The calculator handles up to 5 distinct elements per compound; for larger formulas split into two calculations or use a more general molar-mass tool.