⚙ Free · No Signup · Instant Results

Molecular Formula Calculator

Find the molecular formula of any compound from its empirical formula and molar mass, percent composition, or element masses — with step-by-step working.

Empirical → Molecular Percent Composition Element Masses DBE / Unsaturation
🐜 Glucose (CH₂O, 180) ◯ Benzene (CH, 78) 💧 H₂O₂ (HO, 34) 💊 Aspirin (C₉H₈O₄, 180)
🐶 Acetic Acid (C₂H₄O₂) 🐜 Glucose (C₆H₁₂O₆) ◯ Benzene (C₆H₆)
🐜 Glucose sample ◯ Benzene sample
Molecular Formula
Molecular Formula
1
Step 1
🔒
3 more steps available
See the complete step-by-step solution
🔓 See Full Solution — Free
How it works

How the Molecular Formula Calculator Works

The calculator accepts three types of input and handles each with a separate calculation pipeline. All three methods ultimately deliver the same result: the actual number of atoms of each element in one molecule of your compound.

1
Enter Your Data
Choose your input type — empirical formula and molar mass, percent composition, or actual element masses — and fill in the values.
2
Calculator Finds Ratio
The tool converts masses to moles, finds the simplest whole-number ratio (empirical formula), then calculates the multiplier n from the molar mass.
3
Get Molecular Formula
See the molecular formula, empirical formula, and each step of the working — including the DBE / degree of unsaturation.
Worked examples

Molecular Formula Examples

These three examples illustrate the most common exam scenarios: deriving the molecular formula from a known empirical formula, from percent composition data, and from combustion analysis masses.

Empirical + MM
C₆H₁₂O₆
Input: CH₂O, MM = 180 g/mol
Empirical mass: 30.03 g/mol
n = 180 / 30.03 = 6
Molecular: C₆H₁₂O₆ (Glucose)
% Composition
C₆H₆
Input: 92.3% C, 7.7% H, MM = 78
Moles: C = 7.69, H = 7.64
Ratio 1 : 1 → CH
n = 78 / 13 = 6 → C₆H₆ (Benzene)
Element Masses
C₉H₈O₄
Input: C = 5.40g, H = 0.48g, O = 3.20g
Moles: C = 0.450, H = 0.476, O = 0.200
Ratio 9:8:4
C₉H₈O₄ (Aspirin, MM = 180)
Core concepts

Molecular Formula vs Empirical Formula

Understanding the relationship between molecular and empirical formulas is essential for general chemistry, organic chemistry, and any stoichiometry exam. The two formulas are related by a single integer multiplier n.

PropertyEmpirical FormulaMolecular Formula
DefinitionSimplest whole-number ratio of atomsActual number of atoms per molecule
GlucoseCH₂O (mass 30)C₆H₁₂O₆ (mass 180)
BenzeneCH (mass 13)C₆H₆ (mass 78)
EthyleneCH₂ (mass 14)C₂H₄ (mass 28)
Acetic acidCH₂O (mass 30)C₂H₄O₂ (mass 60)
Requires molar mass?NoYes
Unique?No (multiple compounds share)Yes (per compound)

The key relationship: Molecular Formula = n × Empirical Formula, where n = Molar Mass ÷ Empirical Formula Mass. If n = 1, the molecular formula is identical to the empirical formula (e.g., water H₂O, carbon dioxide CO₂).

Method guide

How to Find Molecular Formula from Percent Composition

Percent composition problems are the most common molecular formula question type on general chemistry exams. The calculator automates every step, but understanding the process helps you check answers and catch rounding errors.

  • Step 1 — Assume 100 g sample. This converts percentages directly into grams. If carbon is 40.0%, you have 40.0 g of carbon.
  • Step 2 — Convert grams to moles. Divide each element’s mass by its atomic mass. Carbon: 40.0 ÷ 12.011 = 3.330 mol; Hydrogen: 6.71 ÷ 1.008 = 6.657 mol; Oxygen: 53.29 ÷ 16.00 = 3.331 mol.
  • Step 3 — Divide by the smallest mole value. All three divided by 3.330 give ratios of 1 : 2 : 1 → empirical formula CH₂O.
  • Step 4 — Calculate empirical formula mass. 12.011 + 2(1.008) + 15.999 = 30.03 g/mol.
  • Step 5 — Find n from molar mass. n = 180 ÷ 30.03 = 5.99 ≈ 6. Molecular formula: C₆H₁₂O₆.

A common exam trap: ratios that are not whole numbers after dividing by the smallest. If you get 1 : 1.5 : 1, multiply everything by 2 to get 2 : 3 : 2. Ratios ending in .33 multiply by 3; ratios ending in .25 multiply by 4. The calculator handles non-integer ratios automatically using a fractional-to-integer conversion routine.

Converting Molecular Formula to Empirical Formula (Reverse)

To go from molecular formula back to empirical formula, divide all subscripts by their greatest common divisor (GCD). For C₆H₁₂O₆, GCD of 6, 12, 6 is 6 → empirical formula CH₂O. For C₉H₈O₄ (aspirin), GCD of 9, 8, 4 is 1 → the molecular and empirical formulas are identical.

This reverse direction is tested in organic chemistry contexts: given the molecular formula, identify whether the compound can be represented more simply. If GCD = 1, the molecular formula is already in its simplest form.

Advanced

Degree of Unsaturation (DBE) from Molecular Formula

Once you have the molecular formula, you can calculate the degree of unsaturation (also called the double bond equivalent, DBE or DoU). This tells you how many rings and pi bonds the molecule contains, and it is one of the most powerful tools in organic chemistry structure determination.

For a compound with formula CₚHₛNₜO₝ (where oxygen and sulfur do not change the count):

DBE = C − H/2 + N/2 + 1

  • DBE = 0: Fully saturated, no rings, no double bonds (e.g., alkanes)
  • DBE = 1: One double bond or one ring (e.g., alkenes, cycloalkanes)
  • DBE = 2: Two pi bonds or two rings (e.g., alkynes, dienes)
  • DBE = 4: Benzene ring (3 double bonds + 1 ring = 4)
  • DBE ≥ 4: Likely contains an aromatic ring

Example: Aspirin C₉H₈O₄. DBE = 9 − 8/2 + 0/2 + 1 = 9 − 4 + 1 = 6. This accounts for the benzene ring (DBE 4) plus the carboxylic acid C=O (DBE 1) plus the ester C=O (DBE 1). The DBE correctly predicts the functional groups without any spectroscopy data.

Input methods

Three Ways to Calculate Molecular Formula

The calculator supports every common input format you will encounter in general chemistry and organic chemistry coursework.

Method 1: Empirical Formula + Molar Mass

This is the most direct method. You already know the empirical formula (perhaps derived from a previous calculation) and the experimental molar mass (from mass spectrometry or another technique). The calculator finds the empirical formula mass, divides the molar mass by it to get n, and multiplies all subscripts by n. Used for: most textbook stoichiometry problems, Orgo 1 review questions.

Method 2: Percent Composition by Element

Enter the percentage by mass of each element and, optionally, the molar mass. The calculator converts percentages to a 100 g sample, calculates mole ratios, derives the empirical formula, then scales to the molecular formula if the molar mass is provided. If no molar mass is given, the output is the empirical formula only. Used for: combustion analysis, elemental analysis (EA) data interpretation, general chemistry exam questions.

Method 3: Actual Element Masses

Enter the actual gram masses of each element from an experimental sample. This is the raw data form of Method 2 — the calculator converts masses to moles internally. Useful when you have combustion analysis output in grams (e.g., CO₂ mass → carbon mass → moles of carbon) or when working with a weighed sample. Used for: combustion analysis problems, analytical chemistry.

All three methods display the empirical formula, the multiplier n, and (when molar mass is provided) the final molecular formula with the degree of unsaturation. The organic chemistry solver can help you interpret what the molecular formula tells you about a compound’s structure and reactivity.

Related tools

Related Chemistry Calculators

FAQ

Frequently Asked Questions

What is a molecular formula calculator? +
A molecular formula calculator is a tool that determines the exact number of atoms of each element in one molecule of a compound. It works from inputs such as empirical formula and molar mass, percent composition by element, or actual gram masses of elements. Unlike the empirical formula, the molecular formula is not simplified — it shows the true atomic count.
How do you find molecular formula from empirical formula? +
Divide the compound’s molar mass by the empirical formula mass to get the integer multiplier n. Then multiply all subscripts in the empirical formula by n. For example, CH₂O (empirical, mass 30.03) with molar mass 180 gives n = 180 ÷ 30.03 = 5.99 ≈ 6, so the molecular formula is C₆H₁₂O₆.
How do you find molecular formula from percent composition? +
Assume a 100 g sample so percentages become grams. Divide each element’s mass by its atomic mass to get moles. Divide all mole values by the smallest to get whole-number ratios (the empirical formula). Then use the molar mass to calculate n and scale the empirical formula up to the molecular formula.
What is the difference between molecular and empirical formula? +
The empirical formula shows the simplest whole-number ratio of atoms (e.g., CH₂O). The molecular formula shows the actual number of atoms in one molecule (e.g., C₆H₁₂O₆ for glucose). The molecular formula is always a whole-number multiple of the empirical formula. They are identical when the GCD of all subscripts is 1 (e.g., H₂O, CO₂).
Why do my percent composition values not add up to exactly 100? +
Rounding of atomic masses and experimental measurement error can cause the sum to be 99.7–100.3% rather than exactly 100. The calculator handles this automatically and normalizes the input. If your values are significantly off (e.g., total 95%), double-check whether an element is missing from the input.
What is DBE (degree of unsaturation) and how is it calculated? +
DBE (degree of unsaturation, or double bond equivalent) = C − H/2 + N/2 + 1 for a compound CₚHₛNₜ. It counts the total number of rings and pi bonds. DBE = 0 is a saturated acyclic compound; DBE = 1 is one double bond or one ring; DBE = 4 suggests a benzene ring. The calculator shows DBE automatically once the molecular formula is found.
Can I convert a molecular formula back to an empirical formula? +
Yes. Divide all subscripts in the molecular formula by their greatest common divisor (GCD). For C₆H₁₂O₆, GCD of 6, 12, 6 is 6 → empirical formula CH₂O. For C₉H₈O₄ (aspirin), GCD of 9, 8, 4 is 1, so the molecular and empirical formulas are the same.
Scroll to Top