⚗️
✓ Editorially reviewed by Derek Giordano, Founder & Editor · BA Business Marketing

Empirical Formula Calculator

Moles, mole ratios and the smallest whole-number formula from element masses or percentages, plus the molecular formula from a molar mass, checked against OpenStax Chemistry 2e

Updated October 2026

🧮
700+ calculators, no signup required
Finance · Health · Math · Science · Business
nnng.com
Empirical formula: convert each element’s mass (or percentage, using a 100 g sample) to moles, divide by the smallest number of moles, and multiply by a whole number if needed so every ratio is a whole number; the molecular formula multiplies that by molar mass ÷ empirical formula mass. For nicotine (74.02% C, 8.710% H, 17.27% N, molar mass 162.3 g/mol), OpenStax Chemistry 2e Example 3.13 gives: Empirical formula C₅H₇N, molecular formula C₁₀H₁₄N₂.

How the Empirical Formula Is Found

  1. Grams. Use the masses given, or treat percentages as grams of a 100 g sample.
  2. Moles. Divide each by its atomic mass: in OpenStax Example 3.11, 34.97 g Fe ÷ 55.845 = 0.6262 mol and 15.03 g O ÷ 15.999 = 0.9394 mol.
  3. Ratio. Divide by the smallest: Fe 1.000, O 1.500.
  4. Whole numbers. 1.5 is not whole, so multiply both by 2: Fe₂O₃.

Ratios that end near .5 call for ×2, near .33 or .67 for ×3, and near .25 or .75 for ×4. The calculator tries multipliers 1 through 10 and takes the first that brings every ratio within 0.1 of a whole number.

From Empirical to Molecular Formula

A molecular formula is a whole-number multiple of the empirical formula. Divide the molar mass by the empirical formula mass. For nicotine, the empirical formula C₅H₇N has a mass of 81.13 g/mol (OpenStax’s figure), and a 40.57 g sample containing 0.2500 mol gives a molar mass of 162.3 g/mol: 162.3 ÷ 81.13 = 2, so the molecular formula is C₁₀H₁₄N₂.

OpenStax Examples, Reproduced

ProblemDataEmpirical formulaMolecular formula
Ex. 3.11: hematite34.97 g Fe, 15.03 g OFe₂O₃–
Check Your Learning0.130 g N, 0.370 g ON₂O₅–
Ex. 3.1227.29% C, 72.71% OCO₂–
Check Your Learning40.0% C, 6.71% H, 53.28% OCH₂O–
Ex. 3.13: nicotine74.02% C, 8.710% H, 17.27% N; 162.3 g/molC₅H₇NC₁₀H₁₄N₂
Check Your Learning49.47% C, 5.201% H, 28.84% N, 16.48% O; 194.2 g/molC₄H₅N₂OC₈H₁₀N₄O₂

The last row is caffeine’s formula, C₈H₁₀N₄O₂, from its percent composition and a molecular mass of 194.2 amu. Atomic masses come from the site’s molar mass calculator, so masses can differ from the textbook’s in the last decimal place.

Common Mistakes

What This Calculator Does Not Cover

It assumes the data describe one pure compound with a definite composition. Hydrates, combustion analysis (finding C and H from the masses of CO₂ and H₂O) and data with large experimental error need extra steps; for the molar mass of a formula, use the molar mass calculator.

Frequently Asked Questions

How do you find an empirical formula from percent composition?
Treat the percentages as grams of a 100 g sample, convert each to moles, divide all by the smallest, and multiply by a whole number if needed to make every ratio whole.
What is the empirical formula for 27.29% C and 72.71% O?
CO₂: 2.272 mol C and 4.544 mol O give a 1 : 2 ratio (OpenStax Chemistry 2e Example 3.12).
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 that whole number.
What do you do when the ratio is 1.5?
Multiply all ratios by 2. In OpenStax Example 3.11, Fe 1 and O 1.5 become Fe₂O₃.
What is the empirical formula of nicotine?
C₅H₇N; with a molar mass of 162.3 g/mol the molecular formula is C₁₀H₁₄N₂.
Can the empirical and molecular formulas be the same?
Yes, when the molar mass equals the empirical formula mass, as for CO₂ or H₂O.

How to Use This Calculator

  1. Enter each element and its amount — in grams or as a percentage, e.g. C 74.02%, H 8.710%, N 17.27%.
  2. Add a molar mass if you have one — to get the molecular formula; leave 0 to skip.
  3. Check the mole steps — moles, ratios and the multiplier are shown for each element.
  4. Read the formulas — the empirical formula and, with a molar mass, the molecular formula.
📚 Sources & References
  1. [1] OpenStax. Chemistry 2e, 3.2 Determining Empirical and Molecular Formulas (2019; accessed October 2026). openstax.org
  2. [2] OpenStax. Chemistry 2e, 4.3 Reaction Stoichiometry (2019; accessed October 2026). openstax.org
✅ Editorial Standards — Every calculator is built from peer-reviewed formulas and official data sources, editorially reviewed for accuracy, and updated regularly. Read our full methodology · About the author