My Calculator

Molecular Formula Calculator

Find the molecular formula of a compound from its empirical formula and molar mass, or straight from percent composition and molar mass — with the atom-by-atom breakdown, charts, and full step-by-step working.

Stoichiometry Calculatorn = M ÷ empirical mass
g/mol

Try an example

Molecular Formula Result
Empirical: CH2On = 6
C₆H₁₂O₆

Calculated molar mass: 180.16 g/mol

Empirical → Molecular Scale-Up×6
CCarbon16
HHydrogen212
OOxygen16
Element Breakdown
6×

C (Carbon)

40% of mass

12×

H (Hydrogen)

6.71% of mass

6×

O (Oxygen)

53.28% of mass

Composition & Atom Count

See the mass percent of each element and how the empirical atom count scales up to the molecular formula.

Each slice shows what share of the molecule's total mass comes from that element.

Step-by-Step Solution

Here's exactly how this answer was calculated, one step at a time.

Given: Empirical formula = CH2O, Molar mass = 180.16 g/mol

  1. Step 1: Read the empirical formula and find its formula mass

    The empirical formula mass is found the same way as any molar mass — multiply each element's atomic mass by its subscript in the empirical formula, then add them up.

    (12.011 × 1) + (1.008 × 2) + (15.999 × 1) = 30.026 g/mol
  2. Step 2: Divide the real molar mass by the empirical formula mass

    The real molecule is always a whole-number multiple of the empirical formula. This division gives that multiple, n, which is then rounded to the nearest whole number.

    n = 180.16 ÷ 30.026 = 6.0001 ≈ 6
  3. Step 3: Multiply every subscript in the empirical formula by n

    Molecular formula = (CH2O) × 6 = C6H12O6
  4. Step 4: Check the result against the given molar mass

    These two values match closely, confirming the molecular formula is correct.

    Calculated molecular mass = 180.156 g/mol (given: 180.16 g/mol)

The molecular formula is:

C6H12O6

Free Online Molecular Formula Calculator

This molecular formula calculator finds the true, exact formula of a compound — not just the simplest ratio of atoms, but the real atom count in one actual molecule. Give it an empirical formula and the compound's molar mass, or give it a percent composition and the molar mass, and it works out the multiplier, builds the molecular formula, and shows a complete step-by-step solution so you can see exactly how the answer was reached.

It's built for chemistry students working through empirical-to-molecular formula problems, anyone checking lab data against a known molar mass, or a teacher preparing a quick answer key — with the full working shown, an atom-by-atom breakdown, and charts of mass composition so the result is easy to double-check, not just a bare formula.

What Is a Molecular Formula? (Simple Definition)

A molecular formula shows the exact, true number of atoms of each element in one real molecule of a compound. This is different from an empirical formula, which only shows the simplest whole-number ratio those atom counts can be reduced to.

For example, glucose really has 6 carbon atoms, 12 hydrogen atoms, and 6 oxygen atoms in every molecule, giving the molecular formula C6H12O6. Its empirical formula, CH2O, shows only the 1:2:1 ratio between those atoms — correct as a ratio, but not the true molecule size. The molecular formula is always a whole-number multiple of the empirical formula, and finding that multiple is exactly what this calculator does.

The Molecular Formula Formula (How the Multiplier Works)

The relationship between the two formulas comes down to one simple equation:

  • n = Molar Mass of the Compound ÷ Empirical Formula Mass
  • Molecular Formula = (Empirical Formula) × n
  • n is always a whole number — 1, 2, 3, 4, and so on — because a real molecule can only contain a whole number of empirical-formula "units", never a fraction of one.
  • Example: the empirical formula CH2O has a formula mass of about 30.03 g/mol. If the real compound's molar mass is 180.16 g/mol, then n = 180.16 ÷ 30.03 ≈ 6, so the molecular formula is (CH2O) × 6 = C6H12O6.

How to Find the Molecular Formula from an Empirical Formula

This is the most direct route, and it's the default mode of this calculator.

  • Step 1 — Find the empirical formula mass. Multiply each element's atomic mass by its subscript in the empirical formula, then add them all together.
  • Step 2 — Divide the real molar mass by the empirical formula mass. This gives the multiplier, n. Round it to the nearest whole number.
  • Step 3 — Multiply every subscript in the empirical formula by n. The result is the molecular formula.
  • Step 4 — Check your work by multiplying n by the empirical formula mass again — it should come out very close to the molar mass you were given.

How to Find the Molecular Formula from Percent Composition

If you're starting from raw percent composition data instead of an already-known empirical formula, there's just one extra step at the start: find the empirical formula first, then apply the same multiplier method.

  • Step 1 — Assume a 100 g sample, so each percent becomes a mass in grams.
  • Step 2 — Convert each mass to moles by dividing by atomic mass.
  • Step 3 — Divide every mole value by the smallest one to get the mole ratio, and scale it to whole numbers if needed — this gives the empirical formula.
  • Step 4 — Divide the compound's real molar mass by the empirical formula mass to get n, then multiply every subscript by n to get the molecular formula.
  • This calculator's "Percent Composition + Molar Mass" mode runs through all four steps automatically and shows the full working for each one.

Molecular Formula vs Empirical Formula: Quick Comparison

It helps to keep these two ideas clearly separated, since they're tested constantly in introductory chemistry and are easy to mix up.

  • Empirical formula — the simplest whole-number ratio of atoms; found directly from percent composition or mass data alone.
  • Molecular formula — the true, exact atom count in one molecule; needs the compound's molar mass as extra information on top of the ratio.
  • The two are only identical when the real atom ratio is already in its simplest form — water (H2O) and carbon dioxide (CO2) are common examples where empirical and molecular formulas match exactly.
  • For everything else, the molecular formula is some whole-number multiple (n = 2, 3, 4, 6, or more) of the empirical formula.

How to Use This Molecular Formula Calculator

Pick the mode that matches the data you already have. If you already know (or have already calculated) the empirical formula, choose "Empirical Formula + Molar Mass", type the formula in directly — such as CH2O or NO2 — and enter the compound's real molar mass.

If you're starting from raw lab or textbook percent composition instead, choose "Percent Composition + Molar Mass", add a row for every element with its percent by mass, and enter the molar mass. Either way, the calculator instantly shows the multiplier n, the finished molecular formula, an atom-by-atom breakdown, mass-composition charts, and a full step-by-step solution below.

Worked Example: Benzene

A hydrocarbon has the empirical formula CH and a molar mass of 78.11 g/mol. Find its molecular formula.

The empirical formula mass of CH is 12.011 + 1.008 = 13.02 g/mol. Dividing the real molar mass by this: n = 78.11 ÷ 13.02 ≈ 6. Multiplying every subscript in CH by 6 gives the molecular formula C6H6 — benzene, with a calculated molar mass of 6 × 13.02 = 78.11 g/mol, matching the given value exactly.

Worked Example: Dinitrogen Tetroxide

A compound is found to have the empirical formula NO2 and a molar mass of 92.02 g/mol.

The empirical formula mass of NO2 is 14.007 + 2 × 15.999 = 46.01 g/mol. Dividing: n = 92.02 ÷ 46.01 ≈ 2. Multiplying every subscript by 2 gives N2O4 — dinitrogen tetroxide, a real compound used in rocket propulsion, with a calculated molar mass of 92.02 g/mol, matching perfectly.

Why the Molar Mass Is Needed to Find a Molecular Formula

Percent composition or mass data alone can never tell you the molecular formula, because it only ever gives you a ratio — dividing every value in that ratio by any common factor still describes the exact same percent composition. CH2O, C2H4O2, and C6H12O6 all have the identical mass percentages of carbon, hydrogen, and oxygen, since they all reduce to the same 1:2:1 ratio.

The only way to tell these apart is with one extra, independent piece of information — the compound's actual molar mass, usually found experimentally using mass spectrometry, freezing-point depression, or another physical measurement technique. That single number is what lets the multiplier n, and therefore the true molecular formula, be pinned down.

Common Mistakes When Finding a Molecular Formula

The most common mistake is forgetting to round n to the nearest whole number — a real molecule can never contain a fractional number of empirical-formula units, so a result like n = 5.94 should be read as 6, not left as a decimal.

Another frequent error is applying the multiplier to only some of the elements instead of every subscript in the empirical formula. A third mistake is skipping the empirical formula step entirely and trying to divide molar mass directly by an atomic mass — the multiplier always has to be based on the empirical formula's full formula mass, not any single element's atomic mass.

Real-World Uses of Molecular Formula Determination

Finding a molecular formula from lab data is a genuine step in identifying unknown compounds, not just a textbook drill.

  • Organic chemistry — confirming the molecular formula of a newly synthesized compound matches what was intended, using combustion analysis plus mass spectrometry.
  • Pharmaceutical research — verifying the exact molecular identity of a drug candidate during structure elucidation.
  • Materials science — pinning down the true formula of a new material or polymer repeat unit.
  • Forensic and environmental chemistry — identifying an unknown compound recovered from a sample using elemental analysis and molar mass data together.
  • Academic labs — molecular formula determination is a standard follow-up experiment after finding an empirical formula in general chemistry courses.

Frequently Asked Questions

How do you find the molecular formula from the empirical formula? Divide the compound's real molar mass by the empirical formula mass to get a whole-number multiplier n, then multiply every subscript in the empirical formula by n.

What is the difference between molecular formula and empirical formula? The molecular formula shows the true, exact number of atoms in one molecule, while the empirical formula shows only the simplest whole-number ratio between those atom counts.

Can the molecular formula and empirical formula be the same? Yes, whenever the real atom ratio is already in its simplest form, such as water (H2O) or ammonia (NH3).

Why do I need the molar mass to find a molecular formula? Percent composition and mass data only ever give a ratio, and many different real compounds can share the exact same ratio — the molar mass is the extra piece of information needed to tell them apart.

Can this calculator find the molecular formula straight from percent composition? Yes — switch to the "Percent Composition + Molar Mass" mode and it works out the empirical formula and molecular formula in one pass.

Frequently Asked Questions

How do you find the molecular formula from the empirical formula?

Divide the compound's real molar mass by the empirical formula mass to get a whole-number multiplier n, then multiply every subscript in the empirical formula by n to get the molecular formula.

What is the difference between molecular formula and empirical formula?

The molecular formula shows the true, exact number of atoms of each element in one molecule, while the empirical formula shows only the simplest whole-number ratio between those atom counts. The molecular formula is always a whole-number multiple of the empirical formula.

Why do you need the molar mass to find a molecular formula?

Percent composition and mass data alone only ever give a ratio — many different compounds can share the same ratio. The compound's actual molar mass is the extra information needed to pin down exactly how many times bigger the real molecule is.

Can the molecular formula be the same as the empirical formula?

Yes — this happens whenever the atom ratio in the real molecule is already in its simplest form, such as water (H2O), ammonia (NH3), or carbon dioxide (CO2).

Can this calculator work directly from percent composition?

Yes — switch to "Percent Composition + Molar Mass" mode, enter each element's percent by mass, and the calculator finds the empirical formula and molecular formula in one pass with full step-by-step working.

What does it mean if the calculated molar mass doesn't match the given molar mass?

A small difference is normal rounding. A large difference usually means the empirical formula, percent composition, or given molar mass has an error somewhere — the calculator flags this automatically.