Empirical Formula Calculator
Find the empirical formula of a compound from percent composition or lab masses, with mole ratios, whole-number subscripts, empirical formula mass, and an optional molecular formula — all with full step-by-step working.
Try an example
Mole ratios came out as whole numbers directly.
Molecular Formula (×6)
C (Carbon)
3.3303 mol, ratio 1
H (Hydrogen)
6.6468 mol, ratio 1.996
O (Oxygen)
3.3315 mol, ratio 1
Composition & Mole Ratio
See the mass percent of each element, the mole ratio each one works out to, and a full numeric table.
Each slice shows what share of the sample'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: Percent composition: C 40%, H 6.7%, O 53.3%
Step 1: Assume a 100 g sample
This is the standard first move for any percent-composition problem — it works because percent means 'parts per 100', so a 100 g sample makes the percent and the gram mass the same number.
Since every percent composition adds up to 100%, treating the sample as exactly 100 g turns each percent directly into a mass in grams: C = 40 g, H = 6.7 g, O = 53.3 g.Step 2: Convert grams of Carbon (C) to moles
Divide the mass of each element by its atomic mass (from the periodic table) to find how many moles of that element are present.
40 g ÷ 12.011 g/mol = 3.33028 molStep 3: Convert grams of Hydrogen (H) to moles
Divide the mass of each element by its atomic mass (from the periodic table) to find how many moles of that element are present.
6.7 g ÷ 1.008 g/mol = 6.64683 molStep 4: Convert grams of Oxygen (O) to moles
Divide the mass of each element by its atomic mass (from the periodic table) to find how many moles of that element are present.
53.3 g ÷ 15.999 g/mol = 3.33146 molStep 5: Divide every mole value by the smallest, 3.33028 mol (C)
This step turns the raw mole values into a mole ratio, always leaving the smallest value at exactly 1 — this ratio is the same as the ratio of atoms in the compound.
C: 3.33028 ÷ 3.33028 = 1 H: 6.64683 ÷ 3.33028 = 1.9959 O: 3.33146 ÷ 3.33028 = 1.0004Step 6: Round each ratio to the nearest whole number
The ratios already came out close to whole numbers, so no extra multiplying step is needed.
C: 1 ≈ 1 H: 1.9959 ≈ 2 O: 1.0004 ≈ 1Step 7: Write the empirical formula
The whole numbers from the last step become the subscripts, written in standard order (carbon first, then hydrogen, then the rest alphabetically).
Empirical formula = CH2OStep 8: Find the empirical formula mass
Add up the atomic mass of every atom shown in the empirical formula — this is the smallest possible molar mass the real compound could have.
(12.011 × 1) + (1.008 × 2) + (15.999 × 1) = 30.026 g/molStep 9: Find the molecular formula from the given molar mass
The actual molecule is always a whole-number multiple of the empirical formula. Dividing the true molar mass by the empirical formula mass gives that multiple, n.
n = molar mass ÷ empirical formula mass = 180.16 ÷ 30.026 ≈ 6Step 10: Multiply every subscript by n
Molecular formula = (CH2O) × 6 = C6H12O6
The empirical formula is:
CH2O (molecular: C6H12O6)
Free Online Empirical Formula Calculator
This empirical formula calculator finds the simplest whole-number ratio of atoms in a compound from either a percent composition or the actual masses of each element measured in a lab. Type in the elements, enter their percentages or masses, and the calculator instantly converts everything to moles, works out the mole ratio, scales it up to whole numbers, and shows the finished empirical formula — along with a complete step-by-step solution so you can see exactly how each number was reached.
It also goes one step further than most textbook problems ask for: if you know the actual molar mass of the compound, the calculator uses it to work out the full molecular formula too, not just the empirical one. Whether you're a high school or college chemistry student working through a homework set, prepping for an exam, or double-checking lab data from a combustion analysis, this tool gives a fast, accurate answer with the full working shown.
What Is an Empirical Formula? (Simple Definition)
An empirical formula is the simplest whole-number ratio of atoms of each element in a compound. It doesn't necessarily show the real number of atoms in one molecule — it just shows the smallest ratio those numbers can be reduced to, the same way a fraction like 4/8 is normally written in its simplest form, 1/2.
For example, the sugar glucose has the molecular formula C6H12O6, meaning one real molecule of glucose has 6 carbon atoms, 12 hydrogen atoms, and 6 oxygen atoms. But if you divide all three numbers by their common factor of 6, you get 1 carbon, 2 hydrogen, and 1 oxygen — written as the empirical formula CH2O. Both formulas describe the same compound, but the empirical formula shows only the ratio, while the molecular formula shows the true, exact atom count.
Empirical Formula vs Molecular Formula: What's the Difference?
This is one of the most common points of confusion in introductory chemistry, so it's worth spelling out clearly. The empirical formula is the reduced, simplest-ratio version — it's what you get directly from percent composition or lab mass data, and it's the same for every compound that shares that same atomic ratio.
The molecular formula is the true formula of one actual molecule, and it's always a whole-number multiple of the empirical formula. Acetic acid (CH3COOH, written as C2H4O2) and glucose (C6H12O6) are completely different compounds with very different properties, yet they share the exact same empirical formula, CH2O — the multiplier is 2 for acetic acid and 6 for glucose. This is exactly why you need extra information — the compound's actual molar mass — to go from an empirical formula to a molecular formula, and it's exactly what the optional molar mass field in this calculator does automatically.
How to Calculate Empirical Formula from Percent Composition
This is the most common version of the problem, and it follows a fixed set of steps every time.
- Step 1 — Assume a 100 g sample. Since percentages always add up to 100%, treating the whole sample as exactly 100 grams turns every percent straight into a mass in grams, with no extra math.
- Step 2 — Convert each mass to moles. Divide the mass of each element (in grams) by its atomic mass (from the periodic table) to find how many moles of that element are present.
- Step 3 — Divide by the smallest mole value. Take the smallest number of moles from Step 2, and divide every element's mole value by that number. This gives a mole ratio, always leaving the smallest element at exactly 1.
- Step 4 — Round or scale to whole numbers. If every ratio is already close to a whole number, round them. If any ratio ends in .5, .33, .25, .2, or a similar recurring decimal, multiply every ratio by the same small whole number (2, 3, 4, 5...) until they all become whole numbers.
- Step 5 — Write the formula. Use the final whole numbers as the subscripts for each element, written in standard chemical notation.
How to Calculate Empirical Formula from Mass (Lab Data)
If you're working from real experimental data — for example, from a combustion analysis or a direct-mass lab experiment — you skip the 'assume 100 g' step entirely, since you already have real measured masses in grams, milligrams, or another unit. The rest of the process is identical: convert every mass to moles using each element's atomic mass, divide through by the smallest mole value to get a ratio, and scale that ratio to whole numbers.
This calculator's 'Mass of Each Element' mode handles this directly, and it also supports the common combustion-analysis case where one element (usually oxygen) isn't measured directly but is instead found by subtracting the mass of everything else from the total sample mass — the 'find the last element by difference' option automates exactly that.
Converting Decimal Mole Ratios to Whole Numbers
The trickiest part of an empirical formula problem is usually Step 4 — turning an awkward decimal ratio like 1.33 or 1.5 into a whole number. The trick is recognizing common recurring decimals and knowing what to multiply by:
- x.5 → multiply everything by 2 (e.g. 1.5 × 2 = 3)
- x.33 or x.67 → multiply everything by 3 (e.g. 1.33 × 3 = 4, 1.67 × 3 = 5)
- x.25 or x.75 → multiply everything by 4 (e.g. 1.25 × 4 = 5)
- x.2, x.4, x.6, x.8 → multiply everything by 5
- This calculator tests every whole-number multiplier from 1 up to 12 automatically and picks the smallest one that turns every element's ratio into a value close enough to round cleanly — so you never have to guess which multiplier to use.
The Empirical Formula Mass and How to Use It
Once you have the empirical formula, its formula mass is found the same way any molar mass is calculated — multiply each element's atomic mass by its subscript in the empirical formula, then add everything together. This number matters because it's the smallest molar mass the real compound could possibly have.
Comparing this empirical formula mass to the compound's actual, experimentally measured molar mass tells you exactly how many times bigger the real molecule is — and that ratio (rounded to the nearest whole number) is the multiplier used to build the full molecular formula.
How to Find the Molecular Formula from an Empirical Formula
If a question gives you both a percent composition (or mass data) and the compound's actual molar mass, you can find the true molecular formula in one extra step.
- Step 1 — Find the empirical formula and its formula mass as usual.
- Step 2 — Divide the compound's actual molar mass by the empirical formula mass. Round the result to the nearest whole number — call this n.
- Step 3 — Multiply every subscript in the empirical formula by n to get the molecular formula.
- Worked example: glucose has the empirical formula CH2O, with an empirical formula mass of about 30.03 g/mol. Its real molar mass is about 180.16 g/mol, so n = 180.16 ÷ 30.03 ≈ 6, giving the molecular formula C6H12O6 — exactly right.
How to Use This Empirical Formula Calculator
Choose whether you're starting from a percent composition or from real lab masses using the mode buttons. Pick each element from the dropdown and type in its value, adding more rows for compounds with three, four, or more elements. If you know the compound's actual molar mass, turn on the molecular formula option and enter it — the calculator will show the molecular formula alongside the empirical one automatically.
The result panel shows the finished formula immediately, with a full breakdown of mass percent, moles, and mole ratio for every element, plus a pie chart of mass composition, a bar chart of mole ratios, and a downloadable results table. Scroll down for the complete step-by-step solution, written out exactly the way a textbook or a teacher would expect to see the working shown.
Worked Example: Glucose
A compound is found to be 40.0% carbon, 6.7% hydrogen, and 53.3% oxygen by mass, with a molar mass of about 180.16 g/mol.
Assuming a 100 g sample gives 40.0 g C, 6.7 g H, and 53.3 g O. Converting to moles: 40.0 ÷ 12.011 ≈ 3.33 mol C, 6.7 ÷ 1.008 ≈ 6.65 mol H, and 53.3 ÷ 15.999 ≈ 3.33 mol O. Dividing every value by the smallest (3.33) gives a ratio of C 1 : H 2 : O 1, which is already whole numbers — so the empirical formula is CH2O, with a formula mass of about 30.03 g/mol.
Since 180.16 ÷ 30.03 ≈ 6, the molecular formula is (CH2O) × 6 = C6H12O6 — the correct formula for glucose.
Worked Example: Magnesium Oxide (Direct Lab Masses)
In a lab experiment, 3.02 g of magnesium reacts completely with oxygen to form 5.00 g of magnesium oxide, meaning 1.98 g of oxygen was involved (5.00 − 3.02 g).
Converting to moles: 3.02 ÷ 24.305 ≈ 0.1243 mol Mg, and 1.98 ÷ 15.999 ≈ 0.1238 mol O. Dividing both by the smaller value gives a ratio very close to 1:1, so the empirical formula is MgO — matching the known formula for magnesium oxide.
Common Mistakes When Finding an Empirical Formula
The most common mistake is rounding a mole ratio too early — a value like 1.33 should never be rounded straight to 1, because that loses real information about the atom ratio. It needs to be recognized as a recurring decimal and scaled up (in this case, ×3) instead.
Another frequent error is dividing by the wrong element's mole value in Step 3 — always divide by the smallest mole value, not the smallest percent or mass. A third mistake is mixing up empirical and molecular formulas entirely, reporting C6H12O6 when the question specifically asked only for the simplest ratio, CH2O, or vice versa without using the molar mass to scale up correctly.
Where Empirical Formula Calculations Are Used
Finding an empirical formula isn't just a textbook exercise — it's one of the real ways chemists identify unknown compounds in the lab.
- Combustion analysis — burning a sample of an organic compound and measuring the carbon dioxide and water produced to work out its carbon, hydrogen, and oxygen content.
- Materials science — confirming the composition of a newly synthesized compound or mineral sample matches its expected formula.
- Pharmaceutical chemistry — verifying the elemental composition of a drug compound during quality control testing.
- Environmental and forensic chemistry — identifying unknown residues or contaminants from elemental analysis data.
- Academic labs — empirical formula determination is one of the standard experiments in general and analytical chemistry courses.
Frequently Asked Questions
How do you find the empirical formula? Convert the mass or percent of each element to moles, divide every value by the smallest mole value to get a ratio, and scale that ratio to whole numbers if needed.
What is the difference between empirical and molecular formula? The empirical formula shows the simplest whole-number ratio of atoms, while the molecular formula shows the true, exact number of atoms in one real molecule — the molecular formula is always a whole-number multiple of the empirical formula.
Can the empirical formula and molecular formula be the same? Yes — this happens whenever the atom ratio in the real molecule is already in its simplest form, such as water (H2O) or carbon dioxide (CO2).
How do you find the molecular formula from percent composition? First find the empirical formula and its formula mass, then divide the compound's actual molar mass by that formula mass to get a whole-number multiplier, and multiply every subscript by that number.
Does this calculator work for compounds with more than three elements? Yes — add as many element rows as the compound needs, up to eight elements at once.
Frequently Asked Questions
How do you find the empirical formula of a compound?
Convert each element's percent or mass to moles by dividing by its atomic mass, divide every mole value by the smallest one to get a ratio, then scale that ratio to whole numbers if it isn't already — those whole numbers become the formula's subscripts.
What is the difference between empirical formula and molecular formula?
The empirical formula is the simplest whole-number ratio of atoms in a compound, while the molecular formula is the true, exact atom count in one real molecule. The molecular formula is always a whole-number multiple of the empirical formula.
How do I find the molecular formula from the empirical formula?
Divide the compound's actual molar mass by the empirical formula mass and round to the nearest whole number — this gives the multiplier n. Multiply every subscript in the empirical formula by n to get the molecular formula.
Why do you assume a 100 g sample when given percent composition?
Because percentages always add up to 100%, treating the sample as exactly 100 grams turns every percent value directly into a mass in grams, with no extra conversion needed.
What if my mole ratio doesn't come out to a whole number?
Recurring decimals like .5, .33, .25, or .2 usually mean the ratio needs to be scaled up by a small whole number (2, 3, 4, or 5) before rounding — this calculator finds that multiplier automatically.
Can this calculator find the empirical formula from lab masses instead of percentages?
Yes — switch to "Mass of Each Element" mode and enter the measured mass of each element directly, in milligrams, grams, or kilograms.