Empirical & Molecular Formula Calculator
Turn percent composition into a chemical formula. Enter the mass percent or grams of each element, or the CO₂ and H₂O from a combustion analysis, and get the empirical formula, then the molecular formula from a molar mass.
How to Use
- Choose how the composition is given: Mass percent, Grams of each element, or Combustion (CO₂ and H₂O from burning a C/H/O compound).
- Type each element symbol and its amount, one per row. In percent mode you may leave one amount blank and it is found by difference from 100 %.
- For a molecular formula, enter the compound’s molar mass (from a mass spectrum or a freezing-point measurement). Leave it blank for the empirical formula only.
- Or press a preset: glucose, benzene, vitamin C from combustion, magnetite Fe₃O₄ or rust Fe₂O₃.
- Read the formula in the panel, and check Show Work for the moles, the ratios and why a multiplier such as ×3 was needed.
Worked Example
Glucose from percent composition. In 100 g there are 40.0 g C, 6.7 g H and 53.3 g O. Moles: 40.0 ÷ 12.011 = 3.3303, 6.7 ÷ 1.008 = 6.6468, 53.3 ÷ 15.999 = 3.3315. Divide by the smallest (3.3303): 1.0000 : 1.9959 : 1.0004, so the empirical formula is CH₂O (30.026 g/mol). The molar mass 180.16 g/mol is 6.0001 × that, so the molecular formula is C₆H₁₂O₆.
Vitamin C by combustion. 0.2000 g burned gives 0.2999 g CO₂ and 0.0818 g H₂O. Carbon: 0.2999 × 12.011 ÷ 44.009 = 0.08185 g; hydrogen: 0.0818 × 2.016 ÷ 18.015 = 0.00915 g; oxygen by difference: 0.2000 − 0.08185 − 0.00915 = 0.10900 g. Moles 0.0068145 : 0.0090813 : 0.0068127 → 1.0003 : 1.3330 : 1. The 1.333 means ×3: C₃H₄O₃ (88.062 g/mol), and 176.12 ÷ 88.062 = 2.0000, so vitamin C is C₆H₈O₆.
The common mistake: rounding a fraction away. Magnetite is 72.36 % Fe and 27.64 % O: 1.2957 mol Fe and 1.7276 mol O, a ratio of 1 : 1.3333. Rounding 1.3333 to 1 gives FeO (71.844 g/mol), a different oxide. The right move is ×3, giving 3 : 3.9999 and Fe₃O₄ (231.531 g/mol). In the same way, vitamin C’s 1 : 1.333 : 1 rounded to 1 : 1 : 1 would give “CHO”, which isn’t even a stable molecule.
Show Work
Formulas
From Lavoisier’s Balance to Liebig’s Bulbs
Formulas rest on two laws from around 1800. Joseph Proust showed that a compound always contains its elements in the same proportions by mass (the law of definite proportions, 1790s), and John Dalton explained it with atoms that combine in small whole-number ratios (1803–1808). Dalton also noticed the law of multiple proportions, which is exactly what this calculator meets when two iron oxides, FeO and Fe₃O₄, give different ratios from the same two elements.
Getting the percentages was the hard part. Antoine Lavoisier burned organic substances and weighed the products in the 1780s, and Joseph Gay-Lussac and Louis Thénard improved the method around 1810. In 1831 Justus von Liebig introduced the Kaliapparat, a five-bulb glass absorber filled with potash solution that trapped the CO₂ from a burned sample so it could be weighed, while a calcium chloride tube caught the water. It made organic analysis routine and is the reason combustion problems still use exactly two numbers, the mass of CO₂ and the mass of H₂O. Modern CHN analysers do the same job automatically, measuring the gases by thermal conductivity instead of on a balance.
An empirical formula alone cannot tell CH₂O (formaldehyde) from C₂H₄O₂ (acetic acid) or C₆H₁₂O₆ (glucose): they all share the same percentages. The molar mass, today usually from mass spectrometry and historically from vapour density or freezing-point depression, supplies the missing multiple. Atomic weights used here are the IUPAC conventional values (H 1.008, C 12.011, O 15.999, Fe 55.845), the same as the Molar Mass Calculator.
About This Calculator
This calculator turns an elemental analysis into a formula. Give the composition as mass percentages (one may be left blank and found by difference), as grams of each element, or as the CO₂ and H₂O collected from burning a carbon–hydrogen–oxygen compound. It converts to moles, divides by the smallest, and searches for the smallest whole-number multiplier rather than rounding blindly, so 1 : 1.333 becomes Fe₃O₄ instead of FeO, and it tells you which ratio forced the multiplier.
Add the molar mass and it gives the molecular formula as well. The drawing follows each element from grams to its subscript, and Show Work lists every division. Everything runs in your browser.
It is aimed at chemistry students working percent-composition and combustion problems, and at anyone checking an analysis certificate against a formula.
Related tools: Molar Mass Calculator, Stoichiometry Calculator, and Boiling & Freezing Point Calculator.
Frequently Asked Questions
How do you find an empirical formula from percent composition?
Assume 100 g so each percent becomes grams, divide each by its atomic weight to get moles, then divide every amount by the smallest. Glucose is 40.0 % C, 6.7 % H and 53.3 % O: 40.0 ÷ 12.011 = 3.3303 mol C, 6.7 ÷ 1.008 = 6.6468 mol H, 53.3 ÷ 15.999 = 3.3315 mol O. Dividing by 3.3303 gives 1 : 1.9959 : 1.0004, which rounds to CH₂O.
What do I do when a ratio comes out as 1.33 or 1.5?
Don’t round it. A ratio ending in .5 means multiply every ratio by 2; .33 or .67 means ×3; .25 or .75 means ×4. Magnetite is 72.36 % Fe and 27.64 % O, giving Fe : O = 1 : 1.3333. Rounding to 1 : 1 would give FeO, which is wrong; ×3 gives 3 : 3.9999, so the formula is Fe₃O₄. This calculator tries ×1 up to ×12 and takes the first that puts every ratio within 0.1 of a whole number.
How do you get the molecular formula from the empirical formula?
Divide the molar mass by the empirical formula mass and multiply every subscript by the result. CH₂O weighs 30.026 g/mol; glucose’s molar mass is 180.16 g/mol, and 180.16 ÷ 30.026 = 6.0001, so the molecular formula is C₆H₁₂O₆. Benzene’s empirical formula CH (13.019 g/mol) and molar mass 78.11 g/mol give n = 5.9997 → C₆H₆.
How does combustion analysis give an empirical formula?
All the carbon ends up in CO₂ and all the hydrogen in H₂O. Mass of C = mass of CO₂ × 12.011 ÷ 44.009; mass of H = mass of H₂O × 2.016 ÷ 18.015; oxygen is whatever is left of the sample. 0.2000 g of vitamin C gives 0.2999 g CO₂ and 0.0818 g H₂O: that is 0.08185 g C, 0.00915 g H and 0.1090 g O, a 1 : 1.333 : 1 mole ratio, ×3 = C₃H₄O₃. With M = 176.12 g/mol, n = 2 and the molecular formula is C₆H₈O₆.
Why is my answer slightly off a whole number?
Real analyses carry 0.1–0.3 % errors and atomic weights are averages, so ratios such as 1.9959 or 1.0004 are normal and round cleanly. A ratio like 2.43 is not experimental error: it signals a fraction (here about 2 ½ → ×2) or a mistake in the data. The rounding tolerance (0.1 by default) can be tightened to 0.05 for precise data or loosened to 0.15 for rough classroom measurements.
How do I use the Empirical & Molecular Formula Calculator?
Simply type your numbers and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.
Is it free? Does it work without internet?
Yes to both. It is free with no sign-up, and once the page has loaded it keeps working even with no internet.
Where does my data go?
Nowhere — every calculation runs on your own device. Nothing you enter is uploaded, logged, or stored.
Common Use Cases
Chemistry homework
Glucose’s 40.0 % C, 6.7 % H, 53.3 % O → CH₂O, and with 180.16 g/mol, C₆H₁₂O₆, with every step shown.
Combustion analysis lab
1.000 g of a hydrocarbon burned to 3.074 g CO₂ and 1.438 g H₂O is C₇H₁₆ (heptane): the H : C ratio 2.286 needs ×7.
Metal oxides
2.233 g of iron combined with 0.960 g of oxygen is a 1 : 1.5006 ratio, ×2 = Fe₂O₃ (rust); 72.36 % Fe is Fe₃O₄.
Checking an analysis certificate
Benzene’s 92.26 % C and 7.74 % H give exactly 1 : 1.000 (CH); a ratio 2 % away from a whole number means a contaminant or a wrong sample.
Organic structure work
A formula of C₆H₈O₆ from combustion plus a molar mass of 176.12 g/mol narrows an unknown down before NMR or IR.
Last updated: