Not sure which lesson to do first? Find your level and get a plan →

Chemistry · Quantity & Proportion · Grade 9-12

Molecular Formula

A molecular formula gives the actual number of atoms of each element in one molecule (glucose is C₆H₁₂O₆, while CH₂O is only its empirical ratio).


Quick Answer

A molecular formula gives the actual number of atoms of each element in one molecule (glucose is C₆H₁₂O₆, while CH₂O is only its empirical ratio). You use it when you know a compound's empirical formula (or its percent composition) and also its molar mass, and you need the real molecule. Divide the molar mass by the empirical formula mass to get a whole number n, then multiply every subscript by n. The result tells you what one molecule actually contains and gives the molar mass that mole calculations need.

Why This Matters

Very different substances can share one empirical formula. CH2O is the ratio for formaldehyde, a toxic gas, for acetic acid in vinegar (C2H4O2) and for glucose (C6H12O6). Only the molecular formula tells them apart, gives the right molar mass, and lets you balance equations and draw structures. Stop at the ratio and every gram-to-mole conversion for glucose is off by a factor of 6.

Intuitive Explanation

Suppose a lab analysis of a white powder finds 40.0% carbon, 6.7% hydrogen and 53.3% oxygen by mass. Converting to moles gives a ratio of 1 C : 2 H : 1 O, so the empirical formula is CH2O. But that ratio fits many molecules: formaldehyde CH2O, acetic acid C2H4O2, lactic acid C3H6O3 and glucose C6H12O6 all have exactly those percentages. Composition tells you the proportions, not the size of the molecule.

The fact that breaks the tie is the molar mass, which comes from a separate measurement such as a mass spectrometer. One CH2O unit has a mass of 12.01+2(1.008)+16.00=30.03 g/mol. If the compound's molar mass is 180 g/mol, each molecule must hold 180÷30.03≈6 units, so the molecular formula is C6H12O6. The multiplier n is always a whole number, because a molecule cannot contain part of an atom; a result like 2.5 means an error earlier in the work.

Not every formula is a molecular formula. NaCl looks like one, but table salt is a lattice of Na+ and Cl− ions with no separate molecules, so NaCl is a formula unit and the ratio is the whole story. You can usually tell from the elements: a metal combined with a nonmetal forms an ionic lattice, while nonmetals bonded to each other form molecules with a definite atom count.

Think of it like this. An empirical formula is like a recipe card that says 1 cup of flour for every 2 eggs; the molecular formula is the batch you actually made, say 6 cups and 12 eggs. The molar mass is the scale reading that reveals how many times the recipe was multiplied. Unlike baking, the multiplier must be a whole number.

Core idea. The molecular formula is the empirical formula multiplied by a whole number n, where n is the compound's molar mass divided by the empirical formula mass. Composition data fix the ratio of atoms; only the molar mass fixes how many atoms one molecule holds.


When to Use

Use it when a problem gives an empirical formula or percent composition together with a molar mass, and asks for the actual formula of the molecule. With no molar mass, the best you can reach is the empirical formula. If the task asks for the grams per mole of a known formula, that is Molar Mass; if it asks how the atoms are connected, draw a Lewis structure. For an ionic compound such as CaCl2, report the formula unit instead.

Tip. Ask: Do you have the simplest atom ratio and the compound's molar mass, and need the actual atoms in one molecule?

How to Recognize It

A molecular formula needs one more fact than an empirical formula does, so look for a molar mass before you start.

  1. Is the molar mass of the compound given, from a measurement or in the question?

    Yes lets you scale the ratio up to the real molecule. Without it, the best you can give is the Empirical Formula.

  2. Does the molar mass divided by the empirical formula mass come out as a whole number?

    That number, n, multiplies every subscript. A result like 2.5 means the empirical formula or the arithmetic is wrong, so recheck before rounding.

  3. Is the compound made of separate molecules rather than an ionic lattice?

    Yes means a molecular formula exists. Ionic compounds such as MgCl₂ have only a formula unit, found by Formula Writing from the ion charges.

  4. Does the question ask which atoms are bonded to which?

    That needs a Lewis Structure. A molecular formula counts the atoms but does not show how they are connected.

Molecular Formula vs Empirical Formula vs Molar Mass vs Lewis Structure

A formula can stand for a ratio, a real molecule, a mass per mole or a map of bonds, and the same element symbols appear in each. Ask whether you need the ratio, the true count, the grams, or the connections.

Molecular Formula

Meaning
A molecular formula states exactly how many atoms of each element are in one molecule.
Key test
The true atom count, found by multiplying the empirical formula by n.
Formula
(CH2)4=C4H8
Example
Hydrogen peroxide is H₂O₂, with two of each atom in every molecule.

Empirical Formula

Meaning
An empirical formula gives only the simplest whole-number ratio of the atoms.
Key test
Only the ratio, which many different compounds can share.
Example
Hydrogen peroxide's empirical formula is HO.

Molar Mass

Meaning
Molar mass is the mass of one mole of the compound, found by adding up atomic masses.
Key test
A number in g/mol, and the fact that decides n.
Formula
M(C4H8)=4(12.01)+8(1.008)
Example
C₄H₈ has a molar mass of 56.10 g/mol.

Lewis Structure

Meaning
A Lewis structure shows which atoms are bonded to which and where the valence electrons sit.
Key test
Shows connections and electron pairs, not just how many atoms.
Example
Ethanol and dimethyl ether are both C₂H₆O but have different Lewis structures.

Formula & Notation

How to read it: Subscripts indicate the number of atoms of each element (e.g., H2O has 2 H atoms and 1 O atom). A subscript of 1 is omitted by convention.

Worked Examples

Example 1 — Scale an empirical formula to benzene

Easy

A compound has the empirical formula CH and a molar mass of 78.11 g/mol. Find its molecular formula.
Show the steps and the answer
  1. Find the empirical formula mass: CH=12.01+1.008=13.02 g/mol.

    This is the mass of one copy of the repeating ratio unit.

  2. Divide: n=78.11÷13.02=6.00.

    The molar mass is the mass of a whole molecule, so n counts how many CH units one molecule contains. A result this close to a whole number shows the data fit.

  3. Multiply every subscript by 6: C1×6H1×6=C6H6.

    Every element scales by the same n, so the 1 : 1 ratio of C to H is kept.

  4. Check: 6(12.01)+6(1.008)=72.06+6.05=78.11 g/mol.

    The molecular formula must reproduce the given molar mass exactly.

Answer: C6H6 (benzene)

Takeaway: Divide the molar mass by the empirical formula mass, then scale every subscript by that whole number.

Example 2 — Contrast: percentages alone stop at the ratio

Standard

A hydrocarbon is 85.6% carbon and 14.4% hydrogen by mass. A student is asked for its molecular formula. What can be found from these data, and what else is needed?
Show the steps and the answer
  1. Take 100 g, so there are 85.6 g C and 14.4 g H. Moles: 85.6÷12.01=7.13 mol C and 14.4÷1.008=14.29 mol H.

    Percent by mass becomes grams in a 100 g sample, and moles let you compare atoms.

  2. Divide by the smaller amount: 7.13÷7.13=1 and 14.29÷7.13=2.00, so the empirical formula is CH2.

    This is the simplest whole-number ratio of atoms.

  3. List formulas with the same percentages: C2H4 (28.05 g/mol), C3H6 (42.08 g/mol), C4H8 (56.10 g/mol).

    Every multiple of CH2 has the same 85.6% carbon, so the percentages cannot choose between them. That is how you can tell the molecular formula is out of reach.

  4. Say what would settle it: if the molar mass were 42.08 g/mol, then n=42.08÷14.03=3 and the formula would be C3H6.

    The molar mass is the one measurement that fixes the size of the molecule.

Answer: Only the empirical formula, CH2, can be found. The molecular formula needs the molar mass (for example, 42.08 g/mol gives C3H6).

Takeaway: No molar mass, no molecular formula: composition data alone give only the simplest ratio.

Example 3 — Find the mistake: stopping at the empirical formula

Application

Lighter fuel is 82.66% C and 17.34% H by mass, and its molar mass is 58.12 g/mol. Leo works out the ratio and writes: "The molecular formula of the fuel is C2H5." Find the mistake and correct it.
Show the steps and the answer
  1. Check Leo's ratio: 82.66÷12.01=6.883 mol C and 17.34÷1.008=17.20 mol H; 17.20÷6.883=2.50, so C : H is 1 : 2.5, or 2 : 5.

    His empirical formula C2H5 is right; the error comes after it.

  2. Compare masses: C2H5=2(12.01)+5(1.008)=29.06 g/mol, but the fuel is 58.12 g/mol.

    A formula whose mass is half the measured molar mass cannot be the whole molecule. Leo never used the molar mass he was given.

  3. Find the multiplier: n=58.12÷29.06=2.00, so the formula is C4H10.

    Every subscript doubles.

  4. Check: 4(12.01)+10(1.008)=48.04+10.08=58.12 g/mol, and carbon is 48.04÷58.12=82.66%.

    The corrected formula matches both the molar mass and the composition.

Answer: C4H10 (butane)

Takeaway: An empirical formula is only the starting point; when a molar mass is given, it must be used to find n.

Where You'll See It

  • Glucose on a nutrition label

    Blood-sugar glucose is C6H12O6 — the molecular formula gives the real atom count in one molecule, not just the CH2O ratio.

  • Hydrogen peroxide versus water

    Water is H2O and hydrogen peroxide is H2O2. Peroxide's empirical formula is HO, so the ratio alone hides its second oxygen atom. That extra oxygen is what peroxide gives off as it breaks down, 2H2O2→2H2O+O2, which is why it bleaches and disinfects while water does not.

  • Caffeine in coffee

    Caffeine's molecular formula C8H10N4O2 tells a chemist exactly how many of each atom are in one molecule, which the simplified ratio alone could not.

Common Mistakes

  1. The slip: The molecular formula is just the empirical formula.

    Why it's tempting: They contain the same elements, so they seem interchangeable.

    Instead: The molecular formula is the empirical formula times a whole number n; for glucose, CH2O times 6 gives C6H12O6.

  2. The slip: You can find the molecular formula without the molar mass.

    Why it's tempting: The empirical formula already looks like a finished formula, so the extra data seems unnecessary.

    Instead: You need the compound's molar mass to find the multiplier n = (molar mass) / (empirical formula mass); without it you only get the empirical formula.

  3. The slip: NaCl is a molecular formula.

    Why it's tempting: It's written just like a molecule's formula, with element symbols and a ratio.

    Instead: Ionic compounds like NaCl form lattices, not discrete molecules, so NaCl is a formula unit, not a molecular formula.


Mini Practice

Try these on your own. Tap Reveal when you want to check.

  1. A compound has the empirical formula CH2O (30.0 g/mol) and a molar mass of 60.0 g/mol. What is its molecular formula?

    Hint: Find how many empirical units fit into the molar mass.

  2. A brown gas has the empirical formula NO2 (46.0 g/mol) and a molar mass of 92.0 g/mol. What is its molecular formula?

    Hint: Divide the molar mass by the empirical formula mass.

  3. A fuel has the empirical formula C2H5 and a molar mass of 58.0 g/mol. Use C = 12.0 and H = 1.0 g/mol. Find the molecular formula.

    Hint: First find the mass of one C2H5 unit.

  4. A gas is 92.3% carbon and 7.7% hydrogen by mass, and its molar mass is 26.0 g/mol. Use C = 12.0 and H = 1.0 g/mol. Find its molecular formula.

    Hint: Get the empirical formula from the percents, then scale it with the molar mass.

  5. A compound is 40.0% C, 6.7% H and 53.3% O by mass. No molar mass is given. Can you find its molecular formula, or only its empirical formula?

    Hint: What number do you need to find the multiplier n?

  6. The empirical formula is CH2O (30.0 g/mol) and the molar mass is 180 g/mol. A student writes: "n=6, so the molecular formula is C6H2O." Find and fix the error.

    Hint: The multiplier applies to every element in the formula.

Want the full set?

50 practice questions for this concept — free to try, every one with a complete worked solution showing the why, not just the answer.

Frequently Asked Questions

Can two different compounds have the same molecular formula?

Yes. Compounds with the same molecular formula but different arrangements of atoms are called isomers. Ethanol and dimethyl ether are both C₂H₆O: ethanol is a liquid that boils at 78 °C, while dimethyl ether is a gas used as an aerosol propellant. Butane and isobutane share C₄H₁₀. A molecular formula is a parts list, and the same parts can be put together in more than one way.

How is the molar mass of an unknown compound measured?

Today usually with a mass spectrometer, which turns molecules into charged particles and sorts them by mass; the peak from whole, unbroken molecules gives the molar mass. Before that, chemists weighed a known volume of the compound's vapour, found its moles from the ideal gas law, n=PV/RTn = PV/RT, and divided mass by moles. Either way, the molar mass is the extra fact that turns a ratio into a molecule.

Why is oxygen gas written O₂ and not just O?

Because oxygen in air exists as molecules of two bonded atoms, so O₂ is its molecular formula, while its empirical formula would be O. Seven elements form two-atom molecules: hydrogen, nitrogen, oxygen, fluorine, chlorine, bromine and iodine. Ozone, O₃, is a different molecule of the same element, which shows why the count matters: O₂ is what you breathe, while O₃ irritates the lungs.

Learning Path

Molecular Formula

You are here

Next →

Lewis Structure
You need Empirical Formula (turning mass data into the simplest atom ratio) and Molar Mass (adding up atomic masses) first. Molecular formula adds one step: compare the real molar mass with the mass of the empirical unit to find the whole-number multiplier. Once you know the true atom count, a Lewis Structure shows how those atoms are bonded to each other.

See Also