Empirical Formula Calculator — From Mass or Percent
Find the empirical formula and molecular formula from mass percentages or grams of each element. Enter up to 6 elements, and see step-by-step mole calculations, ratio simplification, and molecular formula determination from molar mass.
Quick Presets
Input Mode
What Is the Empirical Formula Calculator — From Mass or Percent?
This calculator determines the empirical formula of any compound from either its mass percentages or measured grams of each element. Enter up to 6 elements, and the calculator handles all mole conversions, ratio simplification, and — if you provide the known molar mass — the full molecular formula.
- ›Two input modes — mass percentage (typical for combustion analysis or elemental analysis reports) or raw grams (for direct sample measurements).
- ›Auto-fill last element — in percentage mode, tick the checkbox to have the final element calculated as (100% − sum of others), removing rounding ambiguity.
- ›Intelligent ratio rounding — detects non-integer ratios (×1.5, ×1.33, ×1.67, etc.) and automatically applies the correct multiplier (×2, ×3, ×4…) to produce whole numbers.
- ›Molecular formula — enter the known molar mass to compute n and display the full molecular formula alongside the empirical formula.
- ›Step-by-step working — every step from grams through moles to final formula is shown explicitly, matching what you would write in an exam answer.
- ›Presets — glucose, aspirin, water, and ethanol loaded in one click so you can verify the method immediately.
Formula
The 5-Step Empirical Formula Method
Step 1 — Convert % to grams (assume 100 g sample)
mass (g) = mass percentage [e.g. 40% C → 40 g C]
Step 2 — Convert grams to moles
moles = mass (g) / atomic mass (g/mol)
e.g. C: 40 / 12.011 = 3.330 mol
Step 3 — Divide all moles by the smallest value
ratio_i = moles_i / min(moles)
→ this gives the simplest whole-number ratios
Step 4 — Round to whole numbers (multiply if needed)
If ratios end in .5: multiply all by 2
If ratios end in .33/.67: multiply all by 3, etc.
Step 5 — Write empirical formula
EmpiricalFormula = ∏ element_i^ratio_i
From Empirical → Molecular Formula (Step 6)
n = molar_mass / empirical_molar_mass
molecular_formula = empirical_formula × n
| Symbol | Name | Description |
|---|---|---|
| % | Mass percentage | Mass fraction of element in compound × 100 |
| m | Mass in grams | Grams of each element in a known sample |
| M_r | Atomic mass | Standard atomic weight in g/mol (from periodic table) |
| mol | Moles | mol = mass / atomic mass — the chemist's counting unit |
| ratio | Mole ratio | mol_i / min(mol) — divided by the smallest mole count |
| EF | Empirical formula | Simplest whole-number ratio of atoms in a compound |
| MF | Molecular formula | Actual number of atoms; MF = EF × n |
| n | Whole-number factor | n = known molar mass / empirical molar mass |
How to Use
- 1Choose input mode: Select "From Mass Percentage" if you have % composition data (e.g., from elemental analysis). Select "From Grams" if you have direct mass measurements.
- 2Enter element symbols: Type the standard chemical symbol for each element (C, H, O, N, Fe, etc.). The calculator recognises 60+ elements.
- 3Enter values: Type the mass percentage (must total ~100%) or grams for each element. Use the auto-fill checkbox to compute the last element automatically.
- 4Add more elements if needed: Click "+ Add Element" to add up to 6 elements total. Click × to remove a row.
- 5Enter known molar mass (optional): If you know the compound's molar mass (from mass spectrometry or a data sheet), enter it to get the molecular formula as well as the empirical formula.
- 6Press Enter or Calculate: The empirical formula appears prominently, with molar mass, mole ratios table, and full step-by-step working below.
- 7Try a preset: Click Glucose, Aspirin, Water, or Ethanol to load a real compound and see all steps worked out immediately.
Example Calculation
Glucose — find empirical formula from C(40%), H(6.67%), O(53.33%), then molecular formula from molar mass 180.16 g/mol
Given: C = 40.00%, H = 6.67%, O = 53.33%
Step 1: Assume 100 g sample → C = 40.00 g, H = 6.67 g, O = 53.33 g
Step 2: Convert to moles
C: 40.00 / 12.011 = 3.3303 mol
H: 6.67 / 1.008 = 6.6171 mol
O: 53.33 / 15.999 = 3.3333 mol
Step 3: Divide by smallest (3.3303 mol)
C: 3.3303 / 3.3303 = 1.000
H: 6.6171 / 3.3303 = 1.987 ≈ 2
O: 3.3333 / 3.3303 = 1.001 ≈ 1
Step 4: Ratios are whole numbers: C:H:O = 1:2:1
Step 5: Empirical formula = CH₂O (molar mass = 30.026 g/mol)
Step 6: n = 180.16 / 30.026 = 6
Molecular formula = C₆H₁₂O₆
| Element | Mass % | Grams | Atomic Mass | Moles | Ratio | Final |
|---|---|---|---|---|---|---|
| C | 40.00% | 40.00 | 12.011 | 3.330 | 1.000 | 1 |
| H | 6.67% | 6.67 | 1.008 | 6.617 | 1.987 | 2 |
| O | 53.33% | 53.33 | 15.999 | 3.333 | 1.001 | 1 |
Summary for glucose
Empirical formula: CH₂O (molar mass = 30.026 g/mol)
Known molar mass: 180.16 g/mol
n = 180.16 / 30.026 = 6
Molecular formula: C₆H₁₂O₆
Understanding Empirical Formula — From Mass or Percent
What Is an Empirical Formula?
An empirical formula shows the simplest whole-number ratio of atoms of each element in a compound. It is the most reduced representation — all atom counts are divided by their greatest common divisor. For example, hydrogen peroxide H₂O₂ has an empirical formula of HO, and glucose C₆H₁₂O₆ has an empirical formula of CH₂O.
Unlike the molecular formula, the empirical formula does not tell you the actual number of atoms in one molecule — only the ratio. Two completely different compounds can share the same empirical formula. Acetic acid (C₂H₄O₂) and glucose (C₆H₁₂O₆) both have the empirical formula CH₂O.
Empirical vs Molecular Formula
- ›Empirical formula — simplest integer ratio of atoms. Determined directly from percent composition or elemental analysis. Example: CH₂O.
- ›Molecular formula — actual count of atoms per molecule. Always a whole-number multiple of the empirical formula. Example: C₆H₁₂O₆ = (CH₂O) × 6.
- ›The molecular formula requires knowing the molar mass of the compound (from mass spectrometry, colligative properties, or a data sheet). Without it, you can only determine the empirical formula.
- ›Ionic compounds (like NaCl, MgO) are always expressed as empirical formulas — the concept of a discrete molecule does not apply to ionic lattices.
Same empirical formula, different compounds
CH₂O: formaldehyde (CH₂O, M = 30 g/mol), acetic acid (C₂H₄O₂, M = 60 g/mol), glucose (C₆H₁₂O₆, M = 180 g/mol)
All three have a 1:2:1 ratio of C:H:O. Only the molar mass distinguishes which compound is which.
How to Find the Empirical Formula Step by Step
The procedure is the same whether you start from mass percentages or grams measured in a laboratory experiment:
- ›1. Convert percentages to grams. Assume a 100 g sample so that the percentage number equals grams directly (40% C → 40 g C).
- ›2. Convert grams to moles. Divide each mass by the element's atomic mass from the periodic table (e.g. C: 40 ÷ 12.011 = 3.330 mol).
- ›3. Find the mole ratio. Divide every mole value by the smallest. This gives the ratio of atoms.
- ›4. Round to whole numbers. If ratios are already integers (within ±0.05), write them directly. Otherwise multiply through by 2, 3, 4, 5, or 6 to clear fractions.
- ›5. Write the formula. List each element with its subscript. The subscript 1 is omitted by convention (O₁ is written simply as O).
Handling Non-Integer Ratios
Real-world data is rarely perfectly clean. After dividing by the smallest mole value, ratios often come out as 1.5, 1.33, 1.67, 1.25, or similar. The correct strategy is:
- ›Ratio ends in .5 (e.g. 1.5, 2.5) — multiply all by 2
- ›Ratio ends in .33 or .67 (e.g. 1.33, 1.67) — multiply all by 3
- ›Ratio ends in .25 or .75 (e.g. 1.25, 2.75) — multiply all by 4
- ›Ratio ends in .20 or .40 etc. — multiply all by 5
Do not round arbitrarily — for example, 1.99 rounds to 2, but 1.45 does not round to 1. The calculator rounds to the nearest 0.5, then applies the appropriate multiplier automatically.
From Empirical to Molecular Formula
Once you have the empirical formula and its molar mass, finding the molecular formula requires only one additional step: divide the known molar mass of the compound by the empirical formula molar mass to get the whole-number multiplier n.
n = known molar mass / empirical formula molar mass
molecular formula = empirical formula × n
Example: empirical CH₂O (30.026 g/mol), known molar mass 180.16
n = 180.16 / 30.026 = 6 → C₆H₁₂O₆
The value of n should always be very close to a whole number. If it is not (e.g. n = 2.8), either the molar mass is incorrect or there is a rounding error in the percent composition data.
Frequently Asked Questions
What is the difference between an empirical and a molecular formula?
- ›Empirical formula: simplest ratio — e.g. CH₂O for glucose, HO for hydrogen peroxide
- ›Molecular formula: actual atoms per molecule — e.g. C₆H₁₂O₆ for glucose, H₂O₂ for hydrogen peroxide
- ›Molecular formula = empirical formula × n, where n = known molar mass / empirical molar mass
- ›Ionic compounds (NaCl, MgO) are always expressed as empirical formulas; they have no discrete molecule
Why do I assume a 100 g sample when starting from percentages?
Because percentages are already ratios, the sample size does not affect the result. With 100 g:
- ›The percentage number equals the gram amount directly — no multiplication needed
- ›40% C in 100 g sample → 40 g C → 40/12.011 = 3.330 mol
- ›The same ratio results from any sample size; 100 g is simply the most convenient choice
What do I do if my percentages do not add up to exactly 100%?
- ›A sum between 99.5% and 100.5% is accepted — rounding in elemental analysis causes small discrepancies
- ›If you know one element by difference (e.g. oxygen not directly measured), tick "Calculate last element as 100% − sum of others"
- ›Sums outside ±0.5% trigger an error — check your data for typos or missing elements
My mole ratio is 1.5 — do I round to 1 or 2?
- ›Ratio = 1.5: multiply all by 2 → 1.5×2 = 3 (whole number)
- ›Ratio = 1.33: multiply all by 3 → 1.33×3 ≈ 4
- ›Ratio = 1.25: multiply all by 4 → 1.25×4 = 5
- ›Only round if the ratio is within about 0.05 of a whole number (e.g. 1.99 → 2, 3.02 → 3)
Can two different compounds have the same empirical formula?
CH₂O is the empirical formula for all of these:
- ›Formaldehyde — CH₂O (M = 30 g/mol, n = 1)
- ›Acetic acid — C₂H₄O₂ (M = 60 g/mol, n = 2)
- ›Lactic acid — C₃H₆O₃ (M = 90 g/mol, n = 3)
- ›Glucose — C₆H₁₂O₆ (M = 180 g/mol, n = 6)
This is why mass spectrometry (which gives the molar mass) is essential for complete structural identification.
How do I find an empirical formula from grams measured in a lab?
In grams mode the steps are:
- ›Enter element symbols and grams directly (no need for a 100 g assumption)
- ›Calculator computes moles = grams ÷ atomic mass for each element
- ›Divides all mole counts by the smallest to get mole ratios
- ›Applies rounding and multiplier to get whole numbers
- ›Outputs the empirical formula and optionally the molecular formula
Does the calculator save my inputs?
- ›Element symbols, values, mode (% or grams), and molar mass are saved on every change
- ›All data stays in your browser — nothing is uploaded to any server
- ›Inputs are restored automatically the next time you visit the page
- ›Click Reset All to clear the form and remove the saved data