Empirical formula calculator (with molecular formula)

Enter each element and its percent by mass (or its mass in grams) to get the empirical formula, the simplest whole-number ratio of atoms. Add the molar mass to get the molecular formula too.

Element% or grams

Empirical formulaCH2O

Molecular formula: C6H12O6 (6 × the empirical formula).

Element% or grams÷ Atomic mass = mol÷ smallest× 1
Carbon 40 3.3303 1 1
Hydrogen 6.71 6.6567 1.999 2
Oxygen 53.3 3.3315 1 1

How to use the calculator

Type one element symbol per row with its percentage by mass, such as C 40.0, H 6.71 and O 53.3. Masses in grams work the same way, because only the ratios matter. Leave unused rows empty.

If you know the compound’s molar mass, enter it as well. The calculator then multiplies the empirical formula up to the molecular formula, for example CH₂O to C₆H₁₂O₆ for glucose.

Worked example: glucose

Take 100 g, so the percentages become grams: 40.0 g C, 6.71 g H and 53.3 g O. Divide by the atomic masses to get moles: 40.0 ÷ 12.011 = 3.33 mol C, 6.71 ÷ 1.008 = 6.66 mol H and 53.3 ÷ 15.999 = 3.33 mol O.

Divide every amount by the smallest, 3.33, to get the ratio 1 : 2 : 1, so the empirical formula is CH₂O (30.03 g/mol). Glucose has a molar mass of 180.16 g/mol, which is 6 × 30.03, so the molecular formula is C₆H₁₂O₆.

When the ratio is not a whole number

If a ratio comes out near 1.5, 1.33 or 1.25, do not round it: multiply every ratio by 2, 3 or 4 until all are whole numbers. Iron(III) oxide, at 69.94% iron, gives Fe : O = 1 : 1.5, which doubles to Fe₂O₃.

Small differences, such as 1.98 instead of 2, come from rounded percentages and measurement error, and can be rounded. The calculator allows a difference of 0.1.

FAQ

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

The empirical formula gives the simplest whole-number ratio of atoms, such as CH₂O. The molecular formula gives the actual number of atoms in one molecule, such as C₆H₁₂O₆, which is always a whole-number multiple of the empirical formula.

Do the percentages have to add up to 100?

No. The calculator only uses the ratios between the amounts, so percentages that add up to 99.9 or 100.1 because of rounding work fine, and so do masses in grams.

How do you get the molecular formula?

Divide the molar mass of the compound by the mass of the empirical formula and round to a whole number. Multiply every subscript by that number: 180.16 ÷ 30.03 = 6, so CH₂O becomes C₆H₁₂O₆.