What is the empirical formula for a compound that is 31.9% potassium, 28.9% chlorine, and 39.2% oxygen?
The empirical formula is
In 100 g of stuff, there are 31.9 g potassium, 28.9 g of chlorine, and 39.2 g oxygen.
We divide these gram quantities by the respective atomic masses of each of the atoms to get the atomic ratio of constituents.
If we divide thru by the least molar quantity (that of potassium or oxygen), we get an empirical formula of
Note that because this is an ionic, and not a molecular species, we can quote the empirical as the actual formula.