Find the empirical formula from element masses or percent composition, then the molecular formula from a known molar mass.
Enter each element as a symbol then an amount, separated by commas or new lines.
About this tool
Enter each element with its mass in grams, or its mass percent, and this tool derives the empirical formula — the simplest whole-number ratio of atoms. Add a known molar mass and it also returns the molecular formula. Everything is computed in your browser; nothing is uploaded.
The method converts each amount to moles by dividing by the element's atomic mass (for percent input the percentages are treated as grams per 100 g, which gives the same ratio). All mole counts are divided by the smallest, then multiplied by 1 through 6 until every value lands within 0.1 of a whole number, giving the empirical subscripts. The empirical formula mass is the sum of subscript times atomic mass. If you supply the molar mass, the whole-number multiplier is round(known molar mass / empirical formula mass), and the molecular formula is the empirical formula scaled by that multiplier.
Type elements as symbol then amount, separated by commas or new lines, for example "C 40.0, H 6.7, O 53.3". Results are shown in Hill order (carbon, then hydrogen, then the rest alphabetically) along with the normalized and whole-number mole ratios.
Frequently asked questions
What is the difference between an empirical and a molecular formula?
The empirical formula is the smallest whole-number ratio of atoms, such as CH2O. The molecular formula is the actual number of atoms in a molecule, such as C6H12O6, which is the empirical formula multiplied by a whole number found from the molar mass.
Should I use mass or percent composition?
Either works and gives the same empirical formula. Percent values are treated as grams present in a 100 g sample, so 40% carbon becomes 40 g of carbon before dividing by the atomic mass to get moles.
Why does the ratio get multiplied by a whole number?
After dividing by the smallest mole count you sometimes get values like 1.5 or 1.33. Multiplying by 2 or 3 clears these to whole numbers. The tool tries multipliers 1 through 6 and stops when every subscript is within 0.1 of an integer.
Is my data sent anywhere?
No. The atomic-mass table and all calculations run entirely in your browser, so nothing you type is uploaded or stored on a server.