Empirical and Molecular Formula Calculator (from Percent Composition)
An elemental analysis gives the percentage by mass of each element in a compound. This calculator turns those percentages, or the masses found in a sample, into the empirical formula (the simplest whole-number ratio of atoms) and, if you know the molar mass, the molecular formula.
Empirical formulaCH2O
Working
Calculated in SI base units; inputs are converted from the units you choose.
Divide by the smallestratio = n/n_minC 1, H 1.999, O 1
Whole numbersmultiply by the smallest factor that gives whole numbers× 1: C 1, H 1.999, O 1 → CH2O
Molecular formulamultiplier = M / empirical formula mass180.2 / 30.03 = 6 ≈ 6 → C6H12O6
Mole ratios
Element
Mass (g per 100 g or as entered)
Moles
Ratio
Ratio × 1
Subscript
C
40
3.3303
1
1
1
H
6.71
6.6567
1.999
1.999
2
O
53.29
3.3308
1
1
1
From percentages to a formula
Treat the percentages as grams in a 100 g sample and divide each by the element’s atomic weight to get moles. Dividing by the smallest number of moles gives the atom ratio; ratios close to 1.5, 1.33 or 1.25 mean the whole set must be multiplied by 2, 3 or 4. The molecular formula is a whole-number multiple of the empirical formula, found by dividing the measured molar mass by the empirical formula mass. Glucose, C₆H₁₂O₆, and formaldehyde, CH₂O, share the same empirical formula.
Assumptions and limits
Atomic weights from the CIAAW standard atomic weights.
Analytical percentages accurate to about ±0.3 %; poor data may give the wrong whole numbers.
Formulas are written in Hill order (C, H, then alphabetical).
References
Prohaska, T. et al. (2022), Standard atomic weights of the elements 2021 (IUPAC Technical Report), Pure and Applied Chemistry 94, 573–600.
Atkins, P., Jones, L. and Laverman, L., Chemical Principles: The Quest for Insight, 7th ed., W. H. Freeman, 2016, Fundamentals section on determining chemical formulas.
Questions
What is the formula of a compound with 40.00 % C, 6.71 % H and 53.29 % O and molar mass 180.16 g/mol?
The empirical formula is CH₂O (30.026 g/mol), and the molecular formula is C₆H₁₂O₆, glucose.
An iron oxide is 72.36 % iron. What is its formula?
With 27.64 % oxygen the mole ratio O/Fe is 1.333, which times 3 gives Fe₃O₄ (magnetite).
This calculator is a design aid. Check results against the governing code or standard and have critical work verified by a qualified engineer. Read the disclaimer.