An empirical formula calculator finds the simplest whole-number ratio of atoms in a compound. It does not tell you the full molecular formula by itself, but it gives the basic building block from which the molecular formula can be found once the molar mass is known. That distinction matters in chemistry problems, where students often confuse a ratio with a complete molecule.
Percent composition is the usual starting point. If a sample is 40 percent carbon, 6.7 percent hydrogen, and 53.3 percent oxygen, those percentages can be treated as grams in a 100-gram sample. Dividing by atomic masses turns grams into moles, and dividing by the smallest mole value turns moles into a simple ratio. The calculator below follows exactly that path.
What this calculator does
The empirical formula is the lowest whole-number ratio, not a count of atoms in one molecule. Glucose, for example, has the molecular formula C6H12O6, but its empirical formula is CH2O, because 6, 12, and 6 all divide by 6. Acetic acid, C2H4O2, has the same empirical formula, CH2O, even though it is a different compound. That is why an empirical formula alone cannot identify a substance.
This tool works from percent composition for carbon, hydrogen, and oxygen, the three elements most common in introductory problems. It converts each percentage to moles, divides by the smallest mole amount, and rounds to the nearest whole number. If the result is close to a whole number, that is a good sign. If it lands near a half or a third, multiplying all values by 2 or 3 may be needed, and the guide below explains that step.
Formula
For each element: moles = percent (as grams in 100 g) / atomic mass. Then divide every mole value by the smallest mole value. Round the results to whole numbers to get the empirical formula.
How to use it
- Treat each percentage as grams in a 100-gram sample.
- Divide the carbon percentage by 12.01, hydrogen by 1.008, and oxygen by 16.00 to get moles.
- Divide all three mole values by the smallest one.
- Round to whole numbers. If a value is near 0.5 or 0.33, multiply all values by 2 or 3 before rounding.
- Write the elements with their whole-number subscripts, omitting a subscript of 1.
Try the calculator
Worked example
A compound is 40.0 percent carbon, 6.7 percent hydrogen, and 53.3 percent oxygen. In 100 g, that is 40.0 g carbon, 6.7 g hydrogen, and 53.3 g oxygen. Moles are 40.0 / 12.01 = 3.33 mol carbon, 6.7 / 1.008 = 6.65 mol hydrogen, and 53.3 / 16.00 = 3.33 mol oxygen. Dividing by 3.33 gives 1.00 for carbon, 2.00 for hydrogen, and 1.00 for oxygen. The empirical formula is therefore CH2O. This is the same ratio found in glucose, although glucose itself is C6H12O6, which shows why molar mass is needed for the next step.
To go from empirical to molecular formula, divide the known molar mass by the empirical formula mass. For CH2O, the empirical mass is about 30 g/mol. If the compound has a molar mass of about 180 g/mol, the multiplier is 6, giving C6H12O6.
How to check your answer
Check that the percentages add to about 100. A large gap usually means another element is present or a percentage was copied wrong.
Look at the unrounded ratios before rounding. Values such as 1.49 or 2.51 are warnings that a multiplier, not blind rounding, is needed.
Compare the empirical mass with the given molar mass. If the molar mass is not a near whole-number multiple, recheck the percentages.
Common mistakes
- Rounding 1.5 down to 1 instead of multiplying all ratios by 2 to get whole numbers.
- Using atomic numbers instead of atomic masses when converting grams to moles.
- Treating the empirical formula as the molecular formula without checking molar mass.
Frequently asked questions
What is the difference between empirical and molecular formulas?
An empirical formula is the simplest ratio. A molecular formula is the actual number of atoms in one molecule, which is a whole-number multiple of the empirical formula.
What do I do if a ratio is 1.5?
Multiply every ratio by 2. A ratio set of 1.5, 3, and 1.5 becomes 3, 6, and 3. Do not round 1.5 down to 1.
Can two compounds share an empirical formula?
Yes. CH2O is the empirical formula for both glucose and acetic acid, among others. Molar mass and structure distinguish them.