Molecular Formula Calculator
Enter an empirical formula (e.g., CH2O) and the compound's actual molar mass to find its molecular formula, the whole-number multiplier n, and a live 3D view of the empirical cluster scaling up.
Reviewed by the ToolNestr Editorial Team — July 2026
Enter an empirical formula and the compound's actual molar mass
Two ideas that trip students up
1. Molecular = empirical × n
The small cluster on the left is the empirical formula CH₂O. The larger cluster on the right is the molecular formula C₆H₁₂O₆ — the same atom ratio, just six times as many atoms. Illustrative only, not to scale.
2. Mass scales with n too
Two static bars compare the empirical formula mass (30.03 g/mol) with the molecular mass (180.16 g/mol) for the same glucose example — the taller bar is exactly 6× the shorter one.
Molecular formula graphs
How it works
The core idea in one line: the molecular formula is the empirical formula scaled up by a whole number n — and n is found by comparing the empirical formula's mass to the compound's real, measured molar mass.
Mempirical = Σ(ni × Ai)
empirical formula mass, same rule as molar mass
n = Mactual / Mempirical
rounded to the nearest whole number
molecular formula = empirical × n
multiply every subscript by n
Because the empirical formula only records the simplest ratio of atoms, many different molecules can share the same one — CH₂O is formaldehyde, acetic acid, or glucose, depending only on size. Dividing the actual molar mass by the empirical formula mass recovers that size as n = Mactual / Mempirical, then every subscript in the empirical formula is multiplied by n.
Worked example 1 — glucose
Given: The empirical formula of a sugar is CH₂O, and its actual molar mass (measured) is 180.16 g/mol. Find the molecular formula.
Worked example 2 — when n = 1
Given: A compound has empirical formula CH₄ and an actual molar mass of 16.04 g/mol. Find the molecular formula.
Whenever the actual molar mass equals the empirical formula mass, n = 1 and the two formulas are the same compound.
Empirical vs molecular formula for common compounds
Same empirical formula, different actual molar mass, gives a different n and a different molecular formula.
| Compound | Empirical | Empirical mass | Actual M | n | Molecular |
|---|---|---|---|---|---|
| Formaldehyde | CH₂O | 30.03 g/mol | 30.03 g/mol | 1 | CH₂O |
| Acetic acid | CH₂O | 30.03 g/mol | 60.05 g/mol | 2 | C₂H₄O₂ |
| Glucose | CH₂O | 30.03 g/mol | 180.16 g/mol | 6 | C₆H₁₂O₆ |
| Benzene | CH | 13.02 g/mol | 78.11 g/mol | 6 | C₆H₆ |
| Hydrogen peroxide | HO | 17.01 g/mol | 34.01 g/mol | 2 | H₂O₂ |
All three CH₂O rows share the same simplest ratio of atoms — only the actual molar mass tells them apart.
Where this actually matters
🔬 Compound identification
Combustion analysis gives only the empirical formula (a ratio of atoms). Mass spectrometry or another independent method supplies the actual molar mass, and combining the two pins down exactly which molecule you have.
🕵️ Forensic & materials analysis
Analysts identifying an unknown substance from trace samples often start with elemental composition (empirical formula) and use mass spectrometry to fix the true molecular size — critical for correctly identifying drugs, polymers, or contaminants.
💊 Pharmaceutical structure determination
Confirming a new drug candidate's molecular formula (not just its atomic ratio) is a required step before its structure, dosage and purity can be established.
Common misconceptions
"The empirical and molecular formulas are always different."
They are identical whenever n = 1 — e.g. water (H₂O) and methane (CH₄). "Empirical" just means simplest ratio; sometimes the simplest ratio already is the true molecule.
"You can find the molecular formula from the empirical formula alone."
No — the empirical formula only fixes the ratio of atoms. You always need an independent measurement of the actual molar mass (from mass spectrometry, freezing-point depression, or similar) to determine n.
"n should be rounded no matter how far off it is."
A small deviation (a percent or two) from a whole number is normal measurement error and should be rounded. But if n is off by more than roughly 5%, that signals a likely error in the empirical formula or the molar mass, not a valid rounding.
"The empirical formula mass and the molecular formula mass are unrelated."
They are directly related: molecular formula mass = empirical formula mass × n, exactly the same multiplier used to scale the atom counts.
Formula sources & further reading
The formulas here are standard, traceable to:
- • OpenStax, Chemistry 2e — determining empirical and molecular formulas (free, peer-reviewed). openstax.org
- • Brown, LeMay & Bursten, Chemistry: The Central Science — Chapter 3, Empirical Formulas from Analyses.
- • Zumdahl & Zumdahl, Chemistry — determination of molecular formula from empirical formula and molar mass.
n = actual molar mass ÷ empirical formula mass, rounded to the nearest whole number. Results are rounded for display.
How to use this calculator
Enter the empirical formula
Use standard element symbols and optional parentheses, e.g. CH2O or Ca(OH)2.
Enter the actual molar mass
Type the experimentally measured molar mass in g/mol.
Check the multiplier
A warning appears if n is not close to a whole number — check your formula and mass.
Related tools
Frequently asked questions
What is a molecular formula?
The molecular formula gives the actual number of atoms of each element in one molecule of a compound — e.g. glucose is C₆H₁₂O₆. It is always a whole-number multiple of the empirical formula, which shows only the simplest ratio of atoms.
How do you find the molecular formula from the empirical formula?
Compute the empirical formula mass (sum of atomic masses in the empirical formula), then divide the actual molar mass by it: n = M(actual) / M(empirical). Round n to the nearest whole number and multiply every subscript in the empirical formula by n.
Why do I need the actual molar mass as well as the empirical formula?
The empirical formula alone only fixes the ratio of atoms, not the true size of the molecule — CH₂O could be formaldehyde (n=1), acetic acid (n=2), glucose (n=6), or larger. The actual molar mass, usually from mass spectrometry or freezing-point depression, is what pins down n.
What if n does not come out close to a whole number?
A small rounding gap (a percent or two) is normal experimental error. If n is off by more than about 5% from a whole number, it usually means the empirical formula or the measured molar mass has an error — double-check both inputs.
Can the molecular formula equal the empirical formula?
Yes — whenever n = 1, the molecular and empirical formulas are identical. Water (H₂O) and methane (CH₄) are both cases where the simplest ratio is already the true molecular formula.