The empirical formula of a compound is the simplest whole-number ratio of atoms of each element it contains. This calculator determines the empirical formula from either elemental percentage composition (as typically obtained from combustion analysis or given in exam problems) or from raw mass data. It works by dividing each element's mass or percentage by its atomic mass to obtain mole amounts, then dividing through by the smallest mole value to find the integer ratio. If the resulting ratios are not whole numbers, a multiplier up to 10 is applied automatically. The molecular formula section lets you scale the empirical formula up to the true molecular formula by entering the compound's known molar mass — useful when the empirical and molecular formulas differ, like in glucose (empirical CH₂O, molecular C₆H₁₂O₆).