Empirical Formula Calculator

Turn percent composition, element masses or CO₂ and H₂O masses from combustion into the simplest whole-number formula and the molecular formula.

Data you have
Element symbol or name, then the percent or mass, e.g. "N 35.0".
Adds the molecular formula. Glucose is 180.16 g/mol.
Empirical formula mass
30.026 g/mol
Empirical formulaCH2Osimplest whole-number ratio

Show the work

  1. Assume a 100 g sample, so each percentage becomes grams.
  2. C: 40 g ÷ 12.011 g/mol = 3.33028 mol
  3. H: 6.71 g ÷ 1.008 g/mol = 6.65675 mol
  4. O: 53.29 g ÷ 15.999 g/mol = 3.33083 mol
  5. Divide by the smallest (3.33028 mol): C 1, H 1.999, O 1
  6. Round to whole numbers: C 1, H 2, O 1
  7. Empirical formula: CH2O, formula mass 30.026 g/mol
Working table
ElementMass (g)Atomic weightMoles÷ smallest× 1SubscriptMass % (check)
Carbon (C)4012.0113.330311140%
Hydrogen (H)6.711.0086.65671.9991.99926.71%
Oxygen (O)53.2915.9993.330811153.29%

Chemical analysis tells you how much of each element a compound contains, but not directly how the atoms are arranged. The first step toward identifying it is the empirical formula: the simplest whole-number ratio of atoms that matches the data. This calculator converts mass percentages, element masses or the CO₂ and H₂O produced by burning a sample into moles, finds the smallest whole-number ratio and, if you know the molar mass, scales it up to the molecular formula.

How to use the empirical formula calculator

  1. Choose the Data you have: mass percent, grams of each element, or combustion analysis.
  2. For percent or grams, type one element per line in the Composition box, such as C 40.00. You can use symbols or names (carbon 40).
  3. For combustion analysis, enter the Mass of sample burned, the Mass of CO₂ produced and the Mass of H₂O produced. Leave “Assign any remaining mass to oxygen” ticked for compounds of carbon, hydrogen and oxygen.
  4. Optionally enter the Molar mass of the compound to get the molecular formula.
  5. Read the formula, the empirical formula mass, the multiplier and a working table showing moles, ratios and the rounding.

How the empirical formula is calculated

  1. Treat percentages as grams of a 100 g sample.
  2. Convert each mass to moles: n = m ÷ A, where A is the standard atomic weight.
  3. Divide every mole value by the smallest one.
  4. If any ratio is not close to a whole number, multiply all ratios by the smallest factor (2 to 12) that makes them whole within ±0.1.
  5. Round, and write the subscripts.

For the molecular formula:

n = Mmolecular ÷ Mempirical  →  molecular formula = (empirical formula) × n

In combustion analysis, the masses of carbon and hydrogen are mC = mCO₂ × 12.011 ÷ 44.009 and mH = mH₂O × 2.016 ÷ 18.015.

Worked example

A sugar from its percent composition

A compound is 40.00% C, 6.71% H and 53.29% O, with a molar mass of 180.16 g/mol.

Moles in 100 g: C 40.00 ÷ 12.011 = 3.3303; H 6.71 ÷ 1.008 = 6.6567; O 53.29 ÷ 15.999 = 3.3308

Divide by 3.3303: C 1, H 1.999, O 1.000 → empirical formula CH2O (30.026 g/mol)

Enter the molar mass of 180.16 g/mol: 180.16 ÷ 30.026 = 6.00, so the molecular formula is C6H12O6, glucose.

When ratios are fractional. A phosphorus oxide is 43.64% P and 56.36% O. The mole ratio is P 1 : O 2.5, so multiply by 2 to get P2O5. With a molar mass of 283.9 g/mol, the molecular formula is P4O10.

From combustion data. Burning 0.500 g of a compound gives 0.7329 g CO2 and 0.3001 g H2O. That is 0.2000 g C and 0.0336 g H, leaving 0.2664 g O by difference. The mole ratio again works out to CH2O.

Common fractional ratios

Ratio after dividing Multiply by Example
x.5 2 Fe 1 : O 1.5 → Fe₂O₃
x.33 or x.67 3 1 : 1.33 → 3 : 4
x.25 or x.75 4 1 : 1.25 → 4 : 5
x.2, x.4, x.6, x.8 5 1 : 2.4 → 5 : 12

Do not round a ratio like 1.5 or 1.33 to the nearest integer; that is the most common mistake in empirical formula problems. Values within about 0.1 of a whole number, such as 1.98 or 3.04, can safely be rounded, since they reflect small measurement errors.

Writing the formula

For carbon compounds the calculator uses Hill order: carbon first, hydrogen second, then the other elements alphabetically. For compounds without carbon it keeps the order you typed, so enter metals first to get familiar forms like Fe₂O₃ and NaCl.

To go the other way, from a formula to its composition, use the percent composition calculator. The molar mass calculator checks the mass of the formula you found, and the ratio simplifier shows the whole-number reduction on its own.

Frequently asked questions

What is the difference between an empirical and a molecular formula?

The empirical formula is the simplest whole-number ratio of atoms; the molecular formula gives the actual number in one molecule. Glucose is C₆H₁₂O₆, but its empirical formula is CH₂O, shared with formaldehyde and acetic acid.

How do I get the molecular formula?

Divide the compound's molar mass by the empirical formula mass and round to a whole number, then multiply every subscript by it. For glucose, 180.16 ÷ 30.026 = 6, so CH₂O becomes C₆H₁₂O₆. Enter the molar mass in the optional field and the calculator does this for you.

Why do I sometimes need to multiply the ratios?

Dividing by the smallest number of moles can leave fractions such as 1.5, 1.33 or 1.25. Multiply everything by 2, 3 or 4 respectively to clear them. Iron oxide with 69.94% Fe gives Fe 1 : O 1.5, which becomes Fe₂O₃.

How does combustion analysis work?

Burning an organic compound turns all its carbon into CO₂ and all its hydrogen into H₂O. Their masses give the grams of C and H in the sample; whatever mass remains is usually oxygen. Burning 0.500 g of glucose gives 0.7329 g of CO₂ and 0.3001 g of H₂O.

What if my percentages do not add up to 100%?

Small gaps come from rounding in the analysis. If they fall short by more than a percent or two, an element is probably missing, often oxygen, which is commonly found by difference. The calculator notes the gap and rejects totals above 100.5%.

Last reviewed October 2026 by the CalcFluent editorial team. How we check our calculators.